More refactoring for language-independent domain support.

* Renamed "desc"ription unit to "object" wherever possible.
* Added standard x-ref types to a StandardDomain which is always consulted.
* Split domains module into a subpackage.
* Removed additional_xref_types in favor of new directive classes in StandardDomain.
* Implemented x-ref inventory version 2, for all object types.
* Added env.doc_read_data which is for temporary data stored while reading.
* Minimally updated extension tutorial.
* Started to implement changes to interactive search.
* Test suite passes again.
This commit is contained in:
Georg Brandl
2009-09-07 22:52:26 +02:00
parent 0d029eeb9c
commit fa7f8812cd
28 changed files with 1086 additions and 845 deletions

View File

@@ -97,28 +97,28 @@ def test_parse_name():
verify('function', 'util.raises', ('util', ['raises'], None, None))
verify('function', 'util.raises(exc) -> None',
('util', ['raises'], 'exc', 'None'))
directive.env.autodoc_current_module = 'util'
directive.env.doc_read_data['autodoc_module'] = 'util'
verify('function', 'raises', ('util', ['raises'], None, None))
directive.env.autodoc_current_module = None
directive.env.currmodule = 'util'
del directive.env.doc_read_data['autodoc_module']
directive.env.doc_read_data['py_module'] = 'util'
verify('function', 'raises', ('util', ['raises'], None, None))
verify('class', 'TestApp', ('util', ['TestApp'], None, None))
# for members
directive.env.currmodule = 'foo'
directive.env.doc_read_data['py_module'] = 'foo'
verify('method', 'util.TestApp.cleanup',
('util', ['TestApp', 'cleanup'], None, None))
directive.env.currmodule = 'util'
directive.env.currclass = 'Foo'
directive.env.autodoc_current_class = 'TestApp'
directive.env.doc_read_data['py_module'] = 'util'
directive.env.doc_read_data['py_class'] = 'Foo'
directive.env.doc_read_data['autodoc_class'] = 'TestApp'
verify('method', 'cleanup', ('util', ['TestApp', 'cleanup'], None, None))
verify('method', 'TestApp.cleanup',
('util', ['TestApp', 'cleanup'], None, None))
# and clean up
directive.env.currmodule = None
directive.env.currclass = None
directive.env.autodoc_current_class = None
del directive.env.doc_read_data['py_module']
del directive.env.doc_read_data['py_class']
del directive.env.doc_read_data['autodoc_class']
def test_format_signature():
@@ -353,7 +353,7 @@ def test_generate():
'function', 'util.foobar', more_content=None)
# test auto and given content mixing
directive.env.currmodule = 'test_autodoc'
directive.env.doc_read_data['py_module'] = 'test_autodoc'
assert_result_contains(' Function.', 'method', 'Class.meth')
add_content = ViewList()
add_content.append('Content.', '', 0)
@@ -428,7 +428,7 @@ def test_generate():
'class', 'Outer', all_members=True)
# test generation for C modules (which have no source file)
directive.env.currmodule = 'time'
directive.env.doc_read_data['py_module'] = 'time'
assert_processes([('function', 'time.asctime')], 'function', 'asctime')
assert_processes([('function', 'time.asctime')], 'function', 'asctime')