pydocmk2.loader

pydocmk2.loader

This module provides implementations to load documentation information from
an identifier as it is specified in the `pydocmk.yml:generate` configuration
key. A loader basically takes care of loading the documentation content for
that name, but is not supposed to apply preprocessing.

Modules

  • collections
  • inspect
  • types
  • uuid

Classes

class Parameter(builtin.object)



Methods

init(self, kind, name, annotation=None, default=None)



repr(self)



str(self)



replace(self, name=<object object>, annotation=<object object>, default=<object object>, kind=<object object>)



Descriptors

dict

dictionary for instance variables (if defined)

weakref

list of weak references to the object (if defined)

Attributes

KWONLY = 'KWONLY'
POS = 'POS'
VARARGS_KW = 'VARARGS_KW'
VARARGS_POS = 'VARARGS_POS'
Value = <class 'pydocmk2.loader.Value'>

Value(value,)

class PythonLoader(builtin.object)

Expects absolute identifiers to import with #import_object_with_scope().

Methods

init(self, config)



load_section(self, section)

Loads the contents of a #Section. The `section.identifier` is the name
of the object that we need to load.

# Arguments
  section (Section): The section to load. Fill the `section.title` and
    `section.content` values. Optionally, `section.loader_context` can
    be filled with custom arbitrary data to reference at a later point.

Descriptors

dict

dictionary for instance variables (if defined)

weakref

list of weak references to the object (if defined)

Functions

format_parameters_list(parameters)



get_docstring(function)


get_full_arg_spec(func)


get_function_signature(function, owner_class=None, strip_self_param=False, show_module=False, pretty=True)


get_paramaters_from_arg_spec(argspec, strip_self=False)


trim(docstring)


PythonLoader

pydocmk2.loader.PythonLoader = class PythonLoader(__builtin__.object)

Expects absolute identifiers to import with #import_object_with_scope().

Methods

__init__(self, config)


load_section(self, section)
Loads the contents of a #Section. The `section.identifier` is the name
of the object that we need to load.

# Arguments
  section (Section): The section to load. Fill the `section.title` and
    `section.content` values. Optionally, `section.loader_context` can
    be filled with custom arbitrary data to reference at a later point.

Descriptors

__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

load_section

pydocmk2.loader.PythonLoader.load_section = load_section(self, section) unbound pydocmk2.loader.PythonLoader method
Loads the contents of a #Section. The `section.identifier` is the name
of the object that we need to load.

# Arguments
  section (Section): The section to load. Fill the `section.title` and
    `section.content` values. Optionally, `section.loader_context` can
    be filled with custom arbitrary data to reference at a later point.

Parameter

pydocmk2.loader.Parameter = class Parameter(__builtin__.object)




Methods

__init__(self, kind, name, annotation=None, default=None)


__repr__(self)


__str__(self)


replace(self, name=<object object>, annotation=<object object>, default=<object object>, kind=<object object>)


Descriptors

__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Attributes

KWONLY = 'KWONLY'
POS = 'POS'
VARARGS_KW = 'VARARGS_KW'
VARARGS_POS = 'VARARGS_POS'
Value = <class 'pydocmk2.loader.Value'>
Value(value,)

KWONLY

pydocmk2.loader.Parameter.KWONLY = 'KWONLY'

POS

pydocmk2.loader.Parameter.POS = 'POS'

Value

pydocmk2.loader.Parameter.Value = class Value(__builtin__.tuple)

Value(value,)
Method resolution order:
Value
__builtin__.tuple
__builtin__.object

Methods

__getnewargs__(self)
Return self as a plain tuple.  Used by copy and pickle.
__getstate__(self)
Exclude the OrderedDict from pickling
__repr__(self)
Return a nicely formatted representation string
_asdict(self)
Return a new OrderedDict which maps field names to their values
_replace(_self, **kwds)
Return a new Value object replacing specified fields with new values

Class methods

_make(cls, iterable, new=<built-in method __new__ of type object>, len=<built-in function len>) from __builtin__.type
Make a new Value object from a sequence or iterable

Static methods

__new__(_cls, value)
Create new instance of Value(value,)

Descriptors

__dict__
Return a new OrderedDict which maps field names to their values
value
Alias for field number 0

Attributes

_fields = ('value',)

Methods from __builtin__.tuple

__add__(...)
x.__add__(y) <==> x+y
__contains__(...)
x.__contains__(y) <==> y in x
__eq__(...)
x.__eq__(y) <==> x==y
__ge__(...)
x.__ge__(y) <==> x>=y
__getattribute__(...)
x.__getattribute__('name') <==> x.name
__getitem__(...)
x.__getitem__(y) <==> x[y]
__getslice__(...)
x.__getslice__(i, j) <==> x[i:j]

Use of negative indices is not supported.
__gt__(...)
x.__gt__(y) <==> x>y
__hash__(...)
x.__hash__() <==> hash(x)
__iter__(...)
x.__iter__() <==> iter(x)
__le__(...)
x.__le__(y) <==> x<=y
__len__(...)
x.__len__() <==> len(x)
__lt__(...)
x.__lt__(y) <==> x

__mul__(...)
x.__mul__(n) <==> x*n
__ne__(...)
x.__ne__(y) <==> x!=y
__rmul__(...)
x.__rmul__(n) <==> n*x
count(...)
T.count(value) -> integer -- return number of occurrences of value
index(...)
T.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.

VARARGS_KW

pydocmk2.loader.Parameter.VARARGS_KW = 'VARARGS_KW'

VARARGS_POS

pydocmk2.loader.Parameter.VARARGS_POS = 'VARARGS_POS'