Coverage for sources/dynadoc/xtnsapi.py: 100%
20 statements
« prev ^ index » next coverage.py v7.10.1, created at 2025-07-29 05:16 +0000
« prev ^ index » next coverage.py v7.10.1, created at 2025-07-29 05:16 +0000
1# vim: set filetype=python fileencoding=utf-8:
2# -*- coding: utf-8 -*-
4#============================================================================#
5# #
6# Licensed under the Apache License, Version 2.0 (the "License"); #
7# you may not use this file except in compliance with the License. #
8# You may obtain a copy of the License at #
9# #
10# http://www.apache.org/licenses/LICENSE-2.0 #
11# #
12# Unless required by applicable law or agreed to in writing, software #
13# distributed under the License is distributed on an "AS IS" BASIS, #
14# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
15# See the License for the specific language governing permissions and #
16# limitations under the License. #
17# #
18#============================================================================#
21''' Interface for extension development. '''
23# ruff: noqa: F403,F405
26from . import __
28from .context import *
29from .interfaces import *
30from .introspection import *
31from .nomina import *
34FragmentRectifierArgument: __.typx.TypeAlias = __.typx.Annotated[
35 FragmentRectifier, Fname( 'fragment rectifier' ) ]
36FragmentsArgumentMultivalent: __.typx.TypeAlias = __.typx.Annotated[
37 Fragment,
38 Doc(
39 ''' Fragments from which to produce a docstring.
41 If fragment is a string, then it will be used as an index
42 into a table of docstring fragments.
43 If fragment is a :pep:`727` ``Doc`` object, then the value of its
44 ``documentation`` attribute will be incorporated.
45 ''' ),
46]
47FragmentsNameArgument: __.typx.TypeAlias = __.typx.Annotated[
48 str, Fname( 'fragments name' ) ]
49IntrospectionLimitNameArgument: __.typx.TypeAlias = __.typx.Annotated[
50 str, Fname( 'introspection limit name' ) ]
51InvokerGlobalsArgument: __.typx.TypeAlias = __.typx.Annotated[
52 __.typx.Optional[ Variables ], Fname( 'invoker globals' ) ]
53NotifierArgument: __.typx.TypeAlias = __.typx.Annotated[
54 Notifier, Fname( 'notifier' ) ]
55PreserveArgument: __.typx.TypeAlias = __.typx.Annotated[
56 bool, Doc( ''' Preserve extant docstring? ''' ) ]
57ResolverGlobalsArgument: __.typx.TypeAlias = __.typx.Annotated[
58 __.typx.Optional[ Variables ], Fname( 'resolver globals' ) ]
59ResolverLocalsArgument: __.typx.TypeAlias = __.typx.Annotated[
60 __.typx.Optional[ Variables ], Fname( 'resolver locals' ) ]
61VisibilityDeciderArgument: __.typx.TypeAlias = __.typx.Annotated[
62 VisibilityDecider, Fname( 'visibility decider' ) ]
65RendererReturnValue: __.typx.TypeAlias = __.typx.Annotated[
66 str, Doc( ''' Rendered docstring fragment. ''' ) ]
68class Renderer( __.typx.Protocol ):
69 ''' Produces docstring fragment from object and information about it. '''
71 @staticmethod
72 def __call__(
73 possessor: PossessorArgument,
74 informations: InformationsArgument,
75 context: ContextArgument,
76 ) -> RendererReturnValue:
77 ''' (Signature for fragment renderer.) '''
78 raise NotImplementedError # pragma: no cover
80RendererArgument: __.typx.TypeAlias = __.typx.Annotated[
81 Renderer, Fname( 'renderer' ) ]