File: _pydoctor.py

package info (click to toggle)
docstring-parser 0.17.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 300 kB
  • sloc: python: 3,384; makefile: 5
file content (22 lines) | stat: -rw-r--r-- 770 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""Private pydoctor customization code in order to exclude the package
docstring_parser.tests from the API documentation. Based on Twisted code.
"""

# pylint: disable=invalid-name

try:
    from pydoctor.model import Documentable, PrivacyClass, System
except ImportError:
    pass
else:

    class HidesTestsPydoctorSystem(System):
        """A PyDoctor "system" used to generate the docs."""

        def privacyClass(self, documentable: Documentable) -> PrivacyClass:
            """Report the privacy level for an object. Hide the module
            'docstring_parser.tests'.
            """
            if documentable.fullName().startswith("docstring_parser.tests"):
                return PrivacyClass.HIDDEN
            return super().privacyClass(documentable)