~ubuntu-branches/ubuntu/natty/sphinx/natty

« back to all changes in this revision

Viewing changes to sphinx/ext/autodoc.py

  • Committer: Bazaar Package Importer
  • Author(s): Debian Python Modules Team, Piotr Ożarowski
  • Date: 2009-06-17 19:32:26 UTC
  • mfrom: (5.2.1 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090617193226-nast2lougg1eohr7
Tags: 0.6.2-1
[ Piotr Ożarowski ]
* New upstream release (Closes: #527538)
  - add_missing_sphinx-autogen and rfind-invocation patches removed, no
    longer needed
  - move_static_files_outside_site-packages.patch updated
* Standards-Version bumped to 3.8.2, no changes needed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
330
330
                obj = self.get_attr(obj, part)
331
331
            self.object = obj
332
332
            return True
333
 
        except (ImportError, AttributeError), err:
 
333
        except (SyntaxError, ImportError, AttributeError), err:
334
334
            self.directive.warn(
335
335
                'autodoc can\'t import/find %s %r, it reported error: '
336
336
                '"%s", please check your spelling and sys.path' %
481
481
        else:
482
482
            # __dict__ contains only the members directly defined in
483
483
            # the class (but get them via getattr anyway, to e.g. get
484
 
            # unbound method objects instead of function objects)
 
484
            # unbound method objects instead of function objects);
 
485
            # using keys() because apparently there are objects for which
 
486
            # __dict__ changes while getting attributes
485
487
            return False, sorted([
486
 
                (mname, self.get_attr(self.object, mname))
487
 
                for mname in self.get_attr(self.object, '__dict__')])
 
488
                (mname, self.get_attr(self.object, mname, None))
 
489
                for mname in self.get_attr(self.object, '__dict__').keys()])
488
490
 
489
491
    def filter_members(self, members, want_all):
490
492
        """
841
843
        # if the class is documented under another name, document it
842
844
        # as data/attribute
843
845
        if ret:
844
 
            self.doc_as_attr = (self.objpath[-1] != self.object.__name__)
 
846
            if hasattr(self.object, '__name__'):
 
847
                self.doc_as_attr = (self.objpath[-1] != self.object.__name__)
 
848
            else:
 
849
                self.doc_as_attr = True
845
850
        return ret
846
851
 
847
852
    def format_args(self):