merge with 1.0

This commit is contained in:
Georg Brandl 2011-01-06 13:07:07 +01:00
commit 0d1a8e5720
8 changed files with 54 additions and 10 deletions

View File

@ -60,6 +60,13 @@ Release 1.1 (in development)
Release 1.0.7 (in development)
==============================
* #568: Fix lookup of class attribute documentation on descriptors
so that comment documentation now works.
* Fix traceback with ``only`` directives preceded by targets.
* Fix tracebacks occurring for duplicate C++ domain objects.
Release 1.0.6 (Jan 04, 2011)
============================

View File

@ -28,6 +28,8 @@ Documentation using the default theme
* Heapkeeper: http://heapkeeper.org/
* Hedge: http://documen.tician.de/hedge/
* Kaa: http://doc.freevo.org/api/kaa/
* Leo: http://webpages.charter.net/edreamleo/front.html
* Lino: http://lino.saffre-rumma.ee/
* MeshPy: http://documen.tician.de/meshpy/
* mpmath: http://mpmath.googlecode.com/svn/trunk/doc/build/index.html
* OpenEXR: http://excamera.com/articles/26/doc/index.html
@ -90,6 +92,7 @@ Documentation using the sphinxdoc theme
* MyHDL: http://www.myhdl.org/doc/0.6/
* NetworkX: http://networkx.lanl.gov/
* Pweave: http://mpastell.com/pweave/
* Pyre: http://docs.danse.us/pyre/sphinx/
* Pysparse: http://pysparse.sourceforge.net/
* PyTango:
http://www.tango-controls.org/static/PyTango/latest/doc/html/index.html

View File

@ -165,7 +165,7 @@ class DefExpr(object):
return unicode(self).encode('utf-8')
def __repr__(self):
return '<defexpr %s>' % self
return '<%s %s>' % (self.__class__.__name__, self)
class PrimaryDefExpr(DefExpr):
@ -822,13 +822,14 @@ class CPPObject(ObjectDescription):
def add_target_and_index(self, sigobj, sig, signode):
theid = sigobj.get_id()
name = unicode(sigobj.name)
signode['names'].append(theid)
signode['ids'].append(theid)
signode['first'] = (not self.names)
self.state.document.note_explicit_target(signode)
if theid not in self.state.document.ids:
signode['names'].append(theid)
signode['ids'].append(theid)
signode['first'] = (not self.names)
self.state.document.note_explicit_target(signode)
self.env.domaindata['cpp']['objects'].setdefault(name,
(self.env.docname, self.objtype, theid))
self.env.domaindata['cpp']['objects'].setdefault(name,
(self.env.docname, self.objtype, theid))
indextext = self.get_index_text(name)
if indextext:

View File

@ -1409,7 +1409,9 @@ class BuildEnvironment:
if ret:
node.replace_self(node.children)
else:
node.replace_self([])
# replacing by [] would result in an "Losing ids" exception
# if there is a target node before the only node
node.replace_self(nodes.comment())
# allow custom references to be resolved
builder.app.emit('doctree-resolved', doctree, fromdocname)

View File

@ -1142,6 +1142,10 @@ class AttributeDocumenter(ClassLevelDocumenter):
def document_members(self, all_members=False):
pass
def get_real_modname(self):
return self.get_attr(self.parent or self.object, '__module__', None) \
or self.modname
class InstanceAttributeDocumenter(AttributeDocumenter):
"""

View File

@ -102,8 +102,10 @@ class ExtBabel(Babel):
return '\\shorthandoff{"}'
return ''
_ISO639_TO_BABEL = Babel._ISO639_TO_BABEL.copy()
_ISO639_TO_BABEL['sl'] = 'slovene'
# in latest trunk, the attribute is called Babel.language_codes and already
# includes Slovene
if hasattr(Babel, '_ISO639_TO_BABEL'):
Babel._ISO639_TO_BABEL['sl'] = 'slovene'
class Table(object):

View File

@ -161,3 +161,14 @@ User markup
Referencing :userdescrole:`myobj`.
CPP domain
==========
.. cpp:class:: n::Array<T,d>
.. cpp:function:: T& operator[]( unsigned j )
.. cpp:function:: const T& operator[]( unsigned j ) const

View File

@ -17,6 +17,7 @@ from docutils.statemachine import ViewList
from sphinx.ext.autodoc import AutoDirective, add_documenter, \
ModuleLevelDocumenter, FunctionDocumenter, cut_lines, between, ALL
from StringIO import StringIO
def setup_module():
global app, lid, options, directive
@ -418,6 +419,7 @@ def test_generate():
('attribute', 'test_autodoc.Class.attr'),
('attribute', 'test_autodoc.Class.docattr'),
('attribute', 'test_autodoc.Class.udocattr'),
('attribute', 'test_autodoc.Class.mdocattr'),
('attribute', 'test_autodoc.Class.inst_attr_comment'),
('attribute', 'test_autodoc.Class.inst_attr_string')
])
@ -486,11 +488,19 @@ def test_generate():
' .. py:attribute:: Class.prop',
' .. py:attribute:: Class.docattr',
' .. py:attribute:: Class.udocattr',
' .. py:attribute:: Class.mdocattr',
' .. py:attribute:: Class.inst_attr_comment',
' .. py:attribute:: Class.inst_attr_string',
' .. py:method:: Class.inheritedmeth()',
],
'class', 'Class', member_order='bysource', all_members=True)
del directive.env.temp_data['py:module']
# test attribute initialized to class instance from other module
directive.env.temp_data['autodoc:class'] = 'test_autodoc.Class'
assert_result_contains(u' should be documented as well - s\xfc\xdf',
'attribute', 'mdocattr')
del directive.env.temp_data['autodoc:class']
# test autodoc_docstring_signature
assert_result_contains(
@ -561,6 +571,10 @@ class Class(Base):
udocattr = 'quux'
u"""should be documented as well - süß"""
# initialized to any class imported from another module
mdocattr = StringIO()
"""should be documented as well - süß"""
def __init__(self, arg):
#: a documented instance attribute
self.inst_attr_comment = None