[Epydoc-commits] SF.net SVN: epydoc: [1370] trunk/epydoc/src/epydoc
Brought to you by:
edloper
|
From: <dva...@us...> - 2006-09-07 18:41:29
|
Revision: 1370
http://svn.sourceforge.net/epydoc/?rev=1370&view=rev
Author: dvarrazzo
Date: 2006-09-07 11:41:20 -0700 (Thu, 07 Sep 2006)
Log Message:
-----------
Documentation for __slots__ class variable is not generated.
Modified Paths:
--------------
trunk/epydoc/src/epydoc/docintrospecter.py
trunk/epydoc/src/epydoc/docparser.py
trunk/epydoc/src/epydoc/test/docintrospecter.doctest
trunk/epydoc/src/epydoc/test/docparser.doctest
Modified: trunk/epydoc/src/epydoc/docintrospecter.py
===================================================================
--- trunk/epydoc/src/epydoc/docintrospecter.py 2006-09-07 15:56:54 UTC (rev 1369)
+++ trunk/epydoc/src/epydoc/docintrospecter.py 2006-09-07 18:41:20 UTC (rev 1370)
@@ -295,7 +295,7 @@
#: A list of class variables that should not be included in a
#: class's API documentation.
UNDOCUMENTED_CLASS_VARS = (
- '__doc__', '__module__', '__dict__', '__weakref__')
+ '__doc__', '__module__', '__dict__', '__weakref__', '__slots__')
def introspect_class(cls, class_doc):
"""
Modified: trunk/epydoc/src/epydoc/docparser.py
===================================================================
--- trunk/epydoc/src/epydoc/docparser.py 2006-09-07 15:56:54 UTC (rev 1369)
+++ trunk/epydoc/src/epydoc/docparser.py 2006-09-07 18:41:20 UTC (rev 1370)
@@ -1078,6 +1078,11 @@
if lhs_name is not None:
lhs_parent = get_lhs_parent(lhs_name, parent_docs)
if lhs_parent is None: continue
+
+ # Skip a special class variable.
+ if lhs_name[-1] == '__slots__':
+ continue
+
# Create the VariableDoc.
var_doc = VariableDoc(name=lhs_name[-1], value=rhs_val,
is_imported=False, is_alias=is_alias,
Modified: trunk/epydoc/src/epydoc/test/docintrospecter.doctest
===================================================================
--- trunk/epydoc/src/epydoc/test/docintrospecter.doctest 2006-09-07 15:56:54 UTC (rev 1369)
+++ trunk/epydoc/src/epydoc/test/docintrospecter.doctest 2006-09-07 18:41:20 UTC (rev 1370)
@@ -374,7 +374,28 @@
+- docstring = u'calculated base'
+- variables = {}
+Some class variable have a special meaning. The ``__slots__`` variable isn't
+very useful and should be discarded.
+ >>> runintrospecter(s="""
+ ... class Foo:
+ ... __slots__ = ['bar']
+ ... def __init__(self):
+ ... self.bar = 0
+ ... """,
+ ... attribs="variables name value")
+ ModuleDoc for epydoc_test [0]
+ +- variables
+ +- Foo => VariableDoc for epydoc_test.Foo [1]
+ +- name = 'Foo'
+ +- value
+ +- ClassDoc for epydoc_test.Foo [2]
+ +- variables
+ +- __init__ => VariableDoc for epydoc_test.Foo.__init__ [3]
+ +- name = '__init__'
+ +- value
+ +- RoutineDoc [4]
+
Delete Statements
=================
Modified: trunk/epydoc/src/epydoc/test/docparser.doctest
===================================================================
--- trunk/epydoc/src/epydoc/test/docparser.doctest 2006-09-07 15:56:54 UTC (rev 1369)
+++ trunk/epydoc/src/epydoc/test/docparser.doctest 2006-09-07 18:41:20 UTC (rev 1370)
@@ -229,6 +229,28 @@
+- GenericValueDoc [2]
+- parse_repr = u'33'
+Some class variable have a special meaning. The ``__slots__`` variable isn't
+very useful and should be discarded.
+
+ >>> runparser(s="""
+ ... class Foo:
+ ... __slots__ = ['bar']
+ ... def __init__(self):
+ ... self.bar = 0
+ ... """,
+ ... attribs="variables name value")
+ ModuleDoc for test [0]
+ +- variables
+ +- Foo => VariableDoc for test.Foo [1]
+ +- name = u'Foo'
+ +- value
+ +- ClassDoc for test.Foo [2]
+ +- variables
+ +- __init__ => VariableDoc for test.Foo.__init__ [3]
+ +- name = u'__init__'
+ +- value
+ +- RoutineDoc for test.Foo.__init__ [4]
+
Module Control Blocks
=====================
DocParser will look inside certain types of module-level control
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|