Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#111 uml error

closed-fixed
Edward Loper
None
5
2006-08-21
2006-06-23
Anonymous
No

File
"/usr/lib/python2.4/site-packages/epydoc/cli.py", line
599, in cli
main(options, names)
File
"/usr/lib/python2.4/site-packages/epydoc/cli.py", line
458, in main
write_html(docindex, options)
File
"/usr/lib/python2.4/site-packages/epydoc/cli.py", line
489, in write_html
html_writer.write(options.target)
File
"/usr/lib/python2.4/site-packages/epydoc/docwriter/html.py",
line 547, in write
self._write(self.write_class, directory, filename, doc)
File
"/usr/lib/python2.4/site-packages/epydoc/docwriter/html.py",
line 585, in _write
write_func(f.write, *args)
File
"/usr/lib/python2.4/site-packages/epydoc/docwriter/html.py",
line 726, in write_class
graph = uml_class_tree_graph(doc, linker, doc)
File
"/usr/lib/python2.4/site-packages/epydoc/docwriter/dotgraph.py",
line 1090, in uml_class_tree_graph
node.link_attributes(nodes)
File
"/usr/lib/python2.4/site-packages/epydoc/docwriter/dotgraph.py",
line 533, in link_attributes
self.attributes = [var for var in self.attributes
File
"/usr/lib/python2.4/site-packages/epydoc/docwriter/dotgraph.py",
line 548, in _link_attribute
if m and self._add_attribute_edge(var, nodes,
m.group(1)):
File
"/usr/lib/python2.4/site-packages/epydoc/docwriter/dotgraph.py",
line 600, in _add_attribute_edge
self.context, collapsed=True)
File
"/usr/lib/python2.4/site-packages/epydoc/docwriter/dotgraph.py",
line 459, in __init__
for name, var in class_doc.variables.iteritems():
AttributeError: 'ValueDoc' object has no attribute
'variables'

Discussion

  • Logged In: YES
    user_id=600513

    It's a type error. The following is a simple workaround,
    maybe a better solution can be found.

    --- dotgraph.py 2006-06-01 15:38:28.000000000 +0200
    +++
    /usr/lib/python2.4/site-packages/epydoc/docwriter/dotgraph.py
    2006-06-30 13:55:03.000000000 +0200
    @@ -456,16 +456,19 @@
    show_private = options.get('show_private_vars', False)
    show_magic = options.get('show_magic_vars', True)
    show_inherited = options.get('show_inherited_vars',
    False)
    - for name, var in class_doc.variables.iteritems():
    - if ((not show_private and var.is_public ==
    False) or
    - (not show_magic and re.match('__\w+__$',
    name)) or
    - (not show_inherited and var.container !=
    class_doc)):
    - pass
    - elif isinstance(var.value, RoutineDoc):
    - self.operations.append(var)
    - else:
    - self.attributes.append(var)

    + if isinstance(class_doc, ClassDoc):
    + for name, var in
    class_doc.variables.iteritems():
    + if ((not show_private and
    var.is_public == False) or
    + (not show_magic and
    re.match('__\w+__$', name)) or
    + (not show_inherited and
    var.container != class_doc)):
    + pass
    + elif isinstance(var.value, RoutineDoc):
    + self.operations.append(var)
    + else:
    + self.attributes.append(var)
    +
    +
    # Initialize our dot node settings.
    DotGraphNode.__init__(self,
    tooltip=class_doc.canonical_name,
    width=0, height=0,
    shape='plaintext',

     
  • Edward Loper
    Edward Loper
    2006-08-21

    Logged In: YES
    user_id=195958

    The real problem here is that if epydoc doesn't have class
    documentation for the type of the variable, then it
    shouldn't attempt to create a DotGraphUmlClassNode for
    that type. I modified dotgraph.py so that in this case,
    it should now just write the type out as text, rather than
    trying to link to it.

    Fixed in subversion revision 1274.

     
  • Edward Loper
    Edward Loper
    2006-08-21

    • assigned_to: nobody --> edloper
    • status: open --> closed-fixed