From 42ade899dcc838976eabcba9b384d3d68605cd53 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Sat, 28 Mar 2009 14:51:45 -0500 Subject: [PATCH 1/6] Fix manifest. Again. --- MANIFEST.in | 1 + sphinx/ext/autosummary/generate.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index c7d276bd6..25cbc334f 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -8,6 +8,7 @@ include TODO include babel.cfg include Makefile include ez_setup.py +include sphinx-autogen.py include sphinx-build.py include sphinx-quickstart.py diff --git a/sphinx/ext/autosummary/generate.py b/sphinx/ext/autosummary/generate.py index 765b88ec8..c21d71ac5 100644 --- a/sphinx/ext/autosummary/generate.py +++ b/sphinx/ext/autosummary/generate.py @@ -235,4 +235,4 @@ def main(argv): if __name__ == '__main__': - main() + main(sys.argv) From 48c4bf0cb388b8960e49639d19fb45c5880b6952 Mon Sep 17 00:00:00 2001 From: Christophe de Vienne Date: Mon, 30 Mar 2009 19:11:20 +0200 Subject: [PATCH 2/6] Fix import_object if the object has no '__name__' attribute. --- sphinx/ext/autodoc.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index 72d500297..ce5eac780 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -841,7 +841,10 @@ class ClassDocumenter(ModuleLevelDocumenter): # if the class is documented under another name, document it # as data/attribute if ret: - self.doc_as_attr = (self.objpath[-1] != self.object.__name__) + if hasattr(self.object, '__name__'): + self.doc_as_attr = (self.objpath[-1] != self.object.__name__) + else: + self.doc_as_attr = True return ret def format_args(self): From cf1435afb513148bbf368cacfe33fdeba42a4dd5 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 31 Mar 2009 14:01:26 -0500 Subject: [PATCH 3/6] Fix intersphinx for installations without urllib2.HTTPSHandler. --- CHANGES | 2 ++ sphinx/ext/intersphinx.py | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGES b/CHANGES index a2eeb6818..189fd3fe8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ Release 0.6.2 (in development) ============================== +* Fix intersphinx for installations without urllib2.HTTPSHandler. + * #134: Fix pending_xref leftover nodes when using the todolist directive from the todo extension. diff --git a/sphinx/ext/intersphinx.py b/sphinx/ext/intersphinx.py index 4401915eb..3c97a7342 100644 --- a/sphinx/ext/intersphinx.py +++ b/sphinx/ext/intersphinx.py @@ -33,10 +33,12 @@ from docutils import nodes 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.ProxyHandler(), urllib2.HTTPRedirectHandler(), - urllib2.HTTPHandler(), urllib2.HTTPSHandler())) +urllib2.install_opener(urllib2.build_opener(*handlers)) def fetch_inventory(app, uri, inv): From 7a29549a0ec49fddef9842afdd7f523ed8b0d2f5 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Tue, 31 Mar 2009 16:50:09 -0500 Subject: [PATCH 4/6] Add a FAQ item. --- doc/faq.rst | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/faq.rst b/doc/faq.rst index 723601f18..10a6f2c48 100644 --- a/doc/faq.rst +++ b/doc/faq.rst @@ -29,6 +29,12 @@ How do I... ... use Sphinx with SCons? Glenn Hutchings has written a SCons build script to build Sphinx 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 +.. _xhtml to reST: http://docutils.sourceforge.net/sandbox/xhtml2rest/xhtml2rest.py From 67827b38061c88c7824f2eefa2f79ce54525d589 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Wed, 1 Apr 2009 09:20:02 -0500 Subject: [PATCH 5/6] Add changelog entry for fd52839b069b. --- CHANGES | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES b/CHANGES index 189fd3fe8..3c8a1af35 100644 --- a/CHANGES +++ b/CHANGES @@ -1,6 +1,8 @@ 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 From 546a1b4187b94ea1c3135fd7d7d7833a9b5ad373 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Wed, 1 Apr 2009 11:58:15 -0500 Subject: [PATCH 6/6] Add a fix for objects whose getattr adds new members to __dict__. --- sphinx/ext/autodoc.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index ce5eac780..53f533979 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -481,10 +481,12 @@ class Documenter(object): else: # __dict__ contains only the members directly defined in # 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([ (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): """