Linux tsuru-no-tsurugi 5.15.0-186-generic #196-Ubuntu SMP Sat Jun 20 16:09:34 UTC 2026 x86_64
Apache/2.4.52 (Ubuntu)
Server IP : 192.168.0.18 & Your IP : 216.73.216.68
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
usr /
lib /
python3 /
dist-packages /
twisted /
python /
Delete
Unzip
Name
Size
Permission
Date
Action
__pycache__
[ DIR ]
drwxr-xr-x
2026-06-05 06:15
_pydoctortemplates
[ DIR ]
drwxr-xr-x
2026-06-05 06:15
test
[ DIR ]
drwxr-xr-x
2026-06-05 06:15
__init__.py
598
B
-rw-r--r--
2022-02-07 22:12
_appdirs.py
820
B
-rw-r--r--
2022-02-07 22:12
_inotify.py
3.41
KB
-rw-r--r--
2022-02-07 22:12
_pydoctor.py
6.58
KB
-rw-r--r--
2022-02-07 22:12
_release.py
18.44
KB
-rw-r--r--
2022-02-07 22:12
_shellcomp.py
24.69
KB
-rw-r--r--
2022-02-07 22:12
_textattributes.py
8.88
KB
-rw-r--r--
2022-02-07 22:12
_tzhelper.py
3.05
KB
-rw-r--r--
2022-02-07 22:12
_url.py
228
B
-rw-r--r--
2022-02-07 22:12
compat.py
16.53
KB
-rw-r--r--
2022-02-07 22:12
components.py
13.87
KB
-rw-r--r--
2022-02-07 22:12
constants.py
513
B
-rw-r--r--
2022-02-07 22:12
context.py
3.96
KB
-rw-r--r--
2022-02-07 22:12
deprecate.py
27.02
KB
-rw-r--r--
2022-02-07 22:12
failure.py
26.37
KB
-rw-r--r--
2022-02-07 22:12
fakepwd.py
6.57
KB
-rw-r--r--
2022-02-07 22:12
filepath.py
52.76
KB
-rw-r--r--
2022-02-07 22:12
formmethod.py
11.82
KB
-rw-r--r--
2022-02-07 22:12
htmlizer.py
3.54
KB
-rw-r--r--
2022-02-07 22:12
lockfile.py
7.84
KB
-rw-r--r--
2022-02-07 22:12
log.py
21.78
KB
-rw-r--r--
2022-02-07 22:12
logfile.py
9.88
KB
-rw-r--r--
2022-02-07 22:12
modules.py
26.09
KB
-rw-r--r--
2022-02-07 22:12
monkey.py
2.11
KB
-rw-r--r--
2022-02-07 22:12
procutils.py
1.34
KB
-rw-r--r--
2022-02-07 22:12
randbytes.py
3.38
KB
-rw-r--r--
2022-02-07 22:12
rebuild.py
6.96
KB
-rw-r--r--
2022-02-07 22:12
reflect.py
20
KB
-rw-r--r--
2022-02-07 22:12
release.py
1.08
KB
-rw-r--r--
2022-02-07 22:12
roots.py
7.01
KB
-rw-r--r--
2022-02-07 22:12
runtime.py
5.79
KB
-rw-r--r--
2022-02-07 22:12
sendmsg.py
2.62
KB
-rw-r--r--
2022-02-07 22:12
shortcut.py
2.25
KB
-rw-r--r--
2022-02-07 22:12
syslog.py
3.57
KB
-rw-r--r--
2022-02-07 22:12
systemd.py
2.92
KB
-rw-r--r--
2022-02-07 22:12
text.py
5.29
KB
-rw-r--r--
2022-02-07 22:12
threadable.py
3.25
KB
-rw-r--r--
2022-02-07 22:12
threadpool.py
9.96
KB
-rw-r--r--
2022-02-07 22:12
twisted-completion.zsh
1.34
KB
-rw-r--r--
2022-02-07 22:12
url.py
244
B
-rw-r--r--
2022-02-07 22:12
urlpath.py
8.25
KB
-rw-r--r--
2022-02-07 22:12
usage.py
33.77
KB
-rw-r--r--
2022-02-07 22:12
util.py
26.79
KB
-rw-r--r--
2022-02-07 22:12
versions.py
273
B
-rw-r--r--
2022-02-07 22:12
win32.py
4.68
KB
-rw-r--r--
2022-02-07 22:12
zippath.py
8.82
KB
-rw-r--r--
2022-02-07 22:12
zipstream.py
9.45
KB
-rw-r--r--
2022-02-07 22:12
Save
Rename
# -*- test-case-name: twisted.python.test.test_pydoctor -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Support for a few things specific to documenting Twisted using pydoctor. FIXME: https://github.com/twisted/pydoctor/issues/106 This documentation does not link to pydoctor API as there is no public API yet. """ import ast from typing import Optional from pydoctor import astbuilder, model, zopeinterface # type: ignore[import] from pydoctor.sphinx import SphinxInventory # type: ignore[import] class TwistedSphinxInventory(SphinxInventory): """ Custom SphinxInventory to work around broken external references to Sphinx. All exceptions should be reported upstream and a comment should be created with a link to the upstream report. """ def getLink(self, name): """ Resolve the full URL for a cross reference. @param name: Value of the cross reference. @type name: L{str} @return: A full URL for the I{name} reference or L{None} if no link was found. @rtype: L{str} or L{None} """ result = super().getLink(name) if result is not None: # We already got a link. Look no further. return result if name.startswith("zope.interface."): # This is a link from zope.interface. which is not advertised in # the Sphinx inventory. # See if the link is a known broken link which should be handled # as an exceptional case. # We get the base URL from IInterface which is assume that is # always and already well defined in the Sphinx index. baseURL, _ = self._links.get( "zope.interface.interfaces.IInterface", (None, None) ) if baseURL is None: # Most probably the zope.interface inventory was # not loaded. return None if name == "zope.interface.adapter.AdapterRegistry": # FIXME: # https://github.com/zopefoundation/zope.interface/issues/41 relativeLink: Optional[str] = "adapter.html" else: # Not a known exception. relativeLink = None if relativeLink is None: return None return f"{baseURL}/{relativeLink}" return None def getDeprecated(self, decorators): """ With a list of decorators, and the object it is running on, set the C{_deprecated_info} flag if any of the decorators are a Twisted deprecation decorator. """ for a in decorators: if isinstance(a, ast.Call): fn = astbuilder.node2fullname(a.func, self) if fn in ( "twisted.python.deprecate.deprecated", "twisted.python.deprecate.deprecatedProperty", ): try: self._deprecated_info = deprecatedToUsefulText(self, self.name, a) except AttributeError: # It's a reference or something that we can't figure out # from the AST. pass class TwistedModuleVisitor(zopeinterface.ZopeInterfaceModuleVisitor): def visit_ClassDef(self, node): """ Called when a class definition is visited. """ super().visit_ClassDef(node) try: cls = self.builder.current.contents[node.name] except KeyError: # Classes inside functions are ignored. return getDeprecated(cls, cls.raw_decorators) def visit_FunctionDef(self, node): """ Called when a function definition is visited. """ super().visit_FunctionDef(node) try: func = self.builder.current.contents[node.name] except KeyError: # Inner functions are ignored. return if func.decorators: getDeprecated(func, func.decorators) def versionToUsefulObject(version): """ Change an AST C{Version()} to a real one. """ from incremental import Version package = version.args[0].s major = getattr(version.args[1], "n", getattr(version.args[1], "s", None)) assert isinstance(major, int) or major == "NEXT" return Version(package, major, *(x.n for x in version.args[2:] if x)) def deprecatedToUsefulText(visitor, name, deprecated): """ Change a C{@deprecated} to a display string. """ from twisted.python.deprecate import _getDeprecationWarningString version = versionToUsefulObject(deprecated.args[0]) if len(deprecated.args) > 1 and deprecated.args[1]: if isinstance(deprecated.args[1], ast.Name): replacement = visitor.resolveName(deprecated.args[1].id) else: replacement = deprecated.args[1].s else: replacement = None for keyword in deprecated.keywords: if keyword.arg == "replacement": replacement = keyword.value.s return _getDeprecationWarningString(name, version, replacement=replacement) + "." class TwistedASTBuilder(zopeinterface.ZopeInterfaceASTBuilder): # Vistor is not a typo... ModuleVistor = TwistedModuleVisitor class TwistedSystem(zopeinterface.ZopeInterfaceSystem): """ A PyDoctor "system" used to generate the docs. """ defaultBuilder = TwistedASTBuilder def __init__(self, options=None): super().__init__(options=options) # Use custom SphinxInventory so that we can resolve valid L{} markup # for which the Sphinx inventory is not published or broken. self.intersphinx = TwistedSphinxInventory( logger=self.msg, project_name=self.projectname ) def privacyClass(self, documentable): """ Report the privacy level for an object. Hide all tests with the exception of L{twisted.test.proto_helpers}. param obj: Object for which the privacy is reported. type obj: C{model.Documentable} rtype: C{model.PrivacyClass} member """ if documentable.fullName() == "twisted.test": # Match this package exactly, so that proto_helpers # below is visible return model.PrivacyClass.VISIBLE current = documentable while current: if current.fullName() == "twisted.test.proto_helpers": return model.PrivacyClass.VISIBLE if isinstance(current, model.Package) and current.name == "test": return model.PrivacyClass.HIDDEN current = current.parent return super().privacyClass(documentable)