[Epydoc-commits] SF.net SVN: epydoc: [1479] trunk/epydoc/src/epydoc/docwriter/latex.py
Brought to you by:
edloper
From: <ed...@us...> - 2007-02-13 22:01:18
|
Revision: 1479 http://svn.sourceforge.net/epydoc/?rev=1479&view=rev Author: edloper Date: 2007-02-13 14:01:15 -0800 (Tue, 13 Feb 2007) Log Message: ----------- - Fixed bug where latex writer would crash if vardoc.value was UNKNOWN. Modified Paths: -------------- trunk/epydoc/src/epydoc/docwriter/latex.py Modified: trunk/epydoc/src/epydoc/docwriter/latex.py =================================================================== --- trunk/epydoc/src/epydoc/docwriter/latex.py 2007-02-13 21:59:10 UTC (rev 1478) +++ trunk/epydoc/src/epydoc/docwriter/latex.py 2007-02-13 22:01:15 UTC (rev 1479) @@ -812,29 +812,21 @@ out(' & ') has_descr = var_doc.descr not in (None, UNKNOWN) has_type = var_doc.type_descr not in (None, UNKNOWN) - out('\\raggedright ') + has_value = var_doc.value is not UNKNOWN + if has_type or has_value: + out('\\raggedright ') if has_descr: out(self.docstring_to_latex(var_doc.descr, 10).strip()) - out('\n\n') - out('\\textbf{Value:} \n') - out(self._pprint_var_value(var_doc)) + if has_type or has_value: out('\n\n') + if has_value: + out('\\textbf{Value:} \n{\\tt %s}' % + var_doc.value.summary_pyval_repr().to_latex(None)) if has_type: ptype = self.docstring_to_latex(var_doc.type_descr, 12).strip() out('%s\\textit{(type=%s)}' % (' '*12, ptype)) out('&\\\\\n') out('\\cline{1-2}\n') - def _pprint_var_value(self, var_doc): - pyval_repr = var_doc.value.pyval_repr().to_latex(None) - if '\n' in pyval_repr: - return ('\\begin{alltt}\n%s\\end{alltt}' % - pyval_repr) - #plaintext_to_latex(pyval_repr, nbsp=False, breakany=True)) - else: - return '{\\tt %s}' % pyval_repr - #plaintext_to_latex(pyval_repr, nbsp=True, - #breakany=True) - def write_property_list_line(self, out, var_doc): prop_doc = var_doc.value out('\\raggedright ') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |