merge with 0.6

This commit is contained in:
Georg Brandl 2009-04-01 12:01:06 -05:00
commit cb33979cde
6 changed files with 26 additions and 8 deletions

View File

@ -5,6 +5,10 @@ Release 0.7 (in development)
Release 0.6.2 (in development) Release 0.6.2 (in development)
============================== ==============================
* Fix autodoc crash for objects without a ``__name__``.
* Fix intersphinx for installations without urllib2.HTTPSHandler.
* #134: Fix pending_xref leftover nodes when using the todolist * #134: Fix pending_xref leftover nodes when using the todolist
directive from the todo extension. directive from the todo extension.

View File

@ -8,6 +8,7 @@ include TODO
include babel.cfg include babel.cfg
include Makefile include Makefile
include ez_setup.py include ez_setup.py
include sphinx-autogen.py
include sphinx-build.py include sphinx-build.py
include sphinx-quickstart.py include sphinx-quickstart.py

View File

@ -30,5 +30,11 @@ How do I...
Glenn Hutchings has written a SCons build script to build Sphinx Glenn Hutchings has written a SCons build script to build Sphinx
documentation; it is hosted here: http://bitbucket.org/zondo/sphinx-scons documentation; it is hosted here: http://bitbucket.org/zondo/sphinx-scons
... convert from my existing docs using MoinMoin markup?
The easiest way is to convert to xhtml, then convert `xhtml to reST`_. You'll
still need to mark up classes and such, but the headings and code examples
come through cleanly.
.. _api role: http://git.savannah.gnu.org/cgit/kenozooid.git/tree/doc/extapi.py .. _api role: http://git.savannah.gnu.org/cgit/kenozooid.git/tree/doc/extapi.py
.. _xhtml to reST: http://docutils.sourceforge.net/sandbox/xhtml2rest/xhtml2rest.py

View File

@ -481,10 +481,12 @@ class Documenter(object):
else: else:
# __dict__ contains only the members directly defined in # __dict__ contains only the members directly defined in
# the class (but get them via getattr anyway, to e.g. get # the class (but get them via getattr anyway, to e.g. get
# unbound method objects instead of function objects) # unbound method objects instead of function objects);
# using keys() because apparently there are objects for which
# __dict__ changes while getting attributes
return False, sorted([ return False, sorted([
(mname, self.get_attr(self.object, mname)) (mname, self.get_attr(self.object, mname))
for mname in self.get_attr(self.object, '__dict__')]) for mname in self.get_attr(self.object, '__dict__').keys()])
def filter_members(self, members, want_all): def filter_members(self, members, want_all):
""" """
@ -841,7 +843,10 @@ class ClassDocumenter(ModuleLevelDocumenter):
# if the class is documented under another name, document it # if the class is documented under another name, document it
# as data/attribute # as data/attribute
if ret: if ret:
if hasattr(self.object, '__name__'):
self.doc_as_attr = (self.objpath[-1] != self.object.__name__) self.doc_as_attr = (self.objpath[-1] != self.object.__name__)
else:
self.doc_as_attr = True
return ret return ret
def format_args(self): def format_args(self):

View File

@ -235,4 +235,4 @@ def main(argv):
if __name__ == '__main__': if __name__ == '__main__':
main() main(sys.argv)

View File

@ -33,10 +33,12 @@ from docutils import nodes
from sphinx.builders.html import INVENTORY_FILENAME from sphinx.builders.html import INVENTORY_FILENAME
handlers = [urllib2.ProxyHandler(), urllib2.HTTPRedirectHandler(),
urllib2.HTTPHandler()]
if hasattr(urllib2, 'HTTPSHandler'):
handlers.append(urllib2.HTTPSHandler)
urllib2.install_opener(urllib2.build_opener( urllib2.install_opener(urllib2.build_opener(*handlers))
urllib2.ProxyHandler(), urllib2.HTTPRedirectHandler(),
urllib2.HTTPHandler(), urllib2.HTTPSHandler()))
def fetch_inventory(app, uri, inv): def fetch_inventory(app, uri, inv):