[Python-Dev] status of development documentation

Walter Dörwald walter at livinglogic.de
Thu Dec 22 00:20:32 CET 2005


A.M. Kuchling wrote:
> On Wed, Dec 21, 2005 at 07:55:42PM +0100, Walter Dörwald wrote:
>>> reST is a possibility, though I don't think anyone has worked on
>>> building the required toolchain.  Fred has a LaTeX-to-XML-format
>>> converter kicking around somewhere,
>> Is this available somewhere?
> 
> Docs/tools/sgmlconv/, I think.  The code's age is apparent from the
> README saying "Python 2.0 is required."

Hmm, I get the following:

$ make -f tools/sgmlconv/Makefile
for DIR in api dist ext lib mac ref ; do \
     (cd $DIR && make -f ../tools/sgmlconv/make.rules TOOLSDIR=../tools 
xml) || exit $? ; done
../tools/sgmlconv/latex2esis.py  abstract.tex abstract.esis1
../tools/sgmlconv/docfixer.py abstract.esis1 abstract.esis
Traceback (most recent call last):
   File "../tools/sgmlconv/docfixer.py", line 1073, in ?
     main()
   File "../tools/sgmlconv/docfixer.py", line 1064, in main
     convert(ifp, ofp)
   File "../tools/sgmlconv/docfixer.py", line 1012, in convert
     fixup_descriptors(doc, fragment)
   File "../tools/sgmlconv/docfixer.py", line 168, in fixup_descriptors
     find_and_fix_descriptors(doc, section)
   File "../tools/sgmlconv/docfixer.py", line 177, in 
find_and_fix_descriptors
     rewrite_descriptor(doc, child)
   File "../tools/sgmlconv/docfixer.py", line 242, in rewrite_descriptor
     sig = methodline_to_signature(doc, children[pos])
   File "../tools/sgmlconv/docfixer.py", line 276, in 
methodline_to_signature
     methodline.removeAttribute("name")
   File 
"/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/site-packages/_xmlplus/dom/minidom.py", 
line 762, in removeAttribute
     raise xml.dom.NotFoundErr()
xml.dom.NotFoundErr: Node does not exist in this context


Applying the following patch:
===================================================================
--- tools/sgmlconv/docfixer.py  (revision 41780)
+++ tools/sgmlconv/docfixer.py  (working copy)
@@ -273,7 +273,10 @@
      signature.appendChild(doc.createTextNode("\n    "))
      name = doc.createElement("name")
      name.appendChild(doc.createTextNode(methodline.getAttribute("name")))
-    methodline.removeAttribute("name")
+    try:
+       methodline.removeAttribute("name")
+    except xml.dom.NotFoundErr:
+       pass
      signature.appendChild(name)
      if len(methodline.childNodes):
          args = doc.createElement("args")

gives me this error:

Traceback (most recent call last):
   File "../tools/sgmlconv/docfixer.py", line 1076, in ?
     main()
   File "../tools/sgmlconv/docfixer.py", line 1067, in main
     convert(ifp, ofp)
   File "../tools/sgmlconv/docfixer.py", line 1044, in convert
     write_esis(fragment, ofp, knownempty)
   File "../tools/sgmlconv/docfixer.py", line 978, in write_esis
     write_esis(node, ofp, knownempty)
   File "../tools/sgmlconv/docfixer.py", line 978, in write_esis
     write_esis(node, ofp, knownempty)
   File "../tools/sgmlconv/docfixer.py", line 978, in write_esis
     write_esis(node, ofp, knownempty)
   File "../tools/sgmlconv/docfixer.py", line 978, in write_esis
     write_esis(node, ofp, knownempty)
   File "../tools/sgmlconv/docfixer.py", line 968, in write_esis
     raise ValueError, \
ValueError: declared-empty node <cmemberline> has children

Commenting out the node.hasChildNodes() check in docfixer.write_esis() 
gives me:

Traceback (most recent call last):
   File "../tools/sgmlconv/docfixer.py", line 1076, in ?
     main()
   File "../tools/sgmlconv/docfixer.py", line 1067, in main
     convert(ifp, ofp)
   File "../tools/sgmlconv/docfixer.py", line 1032, in convert
     if fragment.lastChild.data[-1:] == "\n":
AttributeError: Element instance has no attribute 'data'

Is there any change of getting this to work?

Bye,
    Walter Dörwald



More information about the Python-Dev mailing list