Skip to content
Snippets Groups Projects
Commit 39b98667 authored by marco's avatar marco
Browse files

wrap non-standard types into :class:

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@2393 5a81b35b-ba03-0410-adc8-b2c5c5119f08
parent 04d681ae
No related branches found
No related tags found
No related merge requests found
...@@ -10,10 +10,14 @@ print '.. currentmodule:: %s' % module ...@@ -10,10 +10,14 @@ print '.. currentmodule:: %s' % module
print '' print ''
print '.. class:: %s' % class_name print '.. class:: %s' % class_name
def _arg_type(arg_type):
if arg_type not in ('str', 'int', 'bool', 'float', 'None'):
return ':class:`%s`' % arg_type
return arg_type
class TypedArgument: class TypedArgument:
def __init__(self, name, arg_type): def __init__(self, name, arg_type):
self.name=name self.name=name
self.type=arg_type self.type=_arg_type(arg_type)
class Method: class Method:
def __init__(self, name, rtype, args, optional): def __init__(self, name, rtype, args, optional):
...@@ -57,10 +61,15 @@ def parse_signature(signature): ...@@ -57,10 +61,15 @@ def parse_signature(signature):
args.append(TypedArgument(a.groupdict()['name'], a.groupdict()['type'])) args.append(TypedArgument(a.groupdict()['name'], a.groupdict()['type']))
return Method(method_match.groupdict()['name'], return Method(method_match.groupdict()['name'],
method_match.groupdict()['rtype'], args[1:], opt_args) _arg_type(method_match.groupdict()['rtype']),
args[1:], opt_args)
print signature, 'not matched' print signature, 'not matched'
for m in dir(the_class): if '--no-derived' in sys.argv:
members=the_class.__dict__.keys()
else:
members=dir(the_class)
for m in members:
if m.startswith('__'): if m.startswith('__'):
continue continue
member_doc=getattr(the_class, m).__doc__ member_doc=getattr(the_class, m).__doc__
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment