diff options
author | Georg Brandl <georg@python.org> | 2010-02-21 22:59:53 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-02-21 22:59:53 +0100 |
commit | 686824997dffd30b689f0abc5f3df8997149acc4 (patch) | |
tree | 45046d9fbe9e83f303d604e7dc49e04c62f62f3b /sphinx/ext/autodoc.py | |
parent | b81b7a046328dff1cac28b9b35920f4636a8465f (diff) | |
download | sphinx-git-686824997dffd30b689f0abc5f3df8997149acc4.tar.gz |
In autodoc, allow customizing the signature of an object via autodoc-process-signature where the built-in mechanism fails.
Diffstat (limited to 'sphinx/ext/autodoc.py')
-rw-r--r-- | sphinx/ext/autodoc.py | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index 2123692b5..ec0a993b4 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -365,9 +365,13 @@ class Documenter(object): args = "(%s)" % self.args else: # try to introspect the signature - args = self.format_args() - if args is None: - return '' + try: + args = self.format_args() + except Exception, err: + self.directive.warn('error while formatting arguments for ' + '%s: %s' % (self.fullname, err)) + args = None + retann = self.retann result = self.env.app.emit_firstresult( @@ -644,12 +648,7 @@ class Documenter(object): self.add_line(u'', '') # format the object's signature, if any - try: - sig = self.format_signature() - except Exception, err: - self.directive.warn('error while formatting signature for ' - '%s: %s' % (self.fullname, err)) - sig = '' + sig = self.format_signature() # generate the directive header and options, if applicable self.add_directive_header(sig) @@ -849,7 +848,6 @@ class ClassDocumenter(ModuleLevelDocumenter): return ret def format_args(self): - args = None # for classes, the relevant signature is the __init__ method's initmeth = self.get_attr(self.object, '__init__', None) # classes without __init__ method, default __init__ or |