Discussion:
[Docutils-users] rst2wiki.py problem
McHugh, Michael
2014-06-10 16:28:28 UTC
Permalink
Hi Joshua,

I am having some trouble converting some documents from RST to twiki format. I wonder if there's something obvious that I'm doing wrong...

I am using Windows Python 2.7 within a Cygwin shell (although I get similar output from a "cmd" shell window).

I have copied the following files as indicated
rst2wiki.py ==> C:\Python27\Scripts\
wiki.py ==> C:\Python27\Lib\site-packages\docutils\writers\

I get the following output:

***@laptop ~
$ /cygdrive/c/Python27/python.exe C:/Python27/Scripts/rst2wiki.py --wiki twiki test.rst test.twiki
NotImplementedError: docutils.writers.wiki.TWikiTranslator visiting unknown node type: transition
Exiting due to error. Use "--traceback" to diagnose.
Please report errors to <docutils-***@lists.sf.net>.
Include "--traceback" output, Docutils version (0.11 [repository]),
Python version (2.7.2), your OS type & version, and the
command line used.

***@laptop ~
$ /cygdrive/c/Python27/python.exe C:/Python27/Scripts/rst2wiki.py --traceback --wiki twiki test.rst test.twiki
Traceback (most recent call last):
File "C:/Python27/Scripts/rst2wiki.py", line 37, in <module>
publish_cmdline(writer=wiki.Writer(), description=description)
File "C:\Python27\lib\site-packages\docutils\core.py", line 352, in publish_cmdline
config_section=config_section, enable_exit_status=enable_exit_status)
File "C:\Python27\lib\site-packages\docutils\core.py", line 219, in publish
output = self.writer.write(self.document, self.destination)
File "C:\Python27\lib\site-packages\docutils\writers\__init__.py", line 80, in write
self.translate()
File "C:\Python27\lib\site-packages\docutils\writers\wiki.py", line 55, in translate
self.document.walkabout(visitor)
File "C:\Python27\lib\site-packages\docutils\nodes.py", line 174, in walkabout
if child.walkabout(visitor):
File "C:\Python27\lib\site-packages\docutils\nodes.py", line 166, in walkabout
visitor.dispatch_visit(self)
File "C:\Python27\lib\site-packages\docutils\nodes.py", line 1882, in dispatch_visit
return method(node)
File "C:\Python27\lib\site-packages\docutils\nodes.py", line 1907, in unknown_visit
% (self.__class__, node.__class__.__name__))
NotImplementedError: docutils.writers.wiki.TWikiTranslator visiting unknown node type: transition


If I can't use this tool, my team and I might have to convert the RST to wiki by hand (ugh...) or we might roll-our-own script to do most of the heavy lifting. We would love to use the tool you've created though!

Many thanks for your help!

Mike McHugh
DSP Engineer
Automotive Systems Division
Bose Corporation
***@bose.com<mailto:***@bose.com>
office: (508)-305-4531
cell: (970)-367-6443
David Goodger
2014-06-10 19:41:06 UTC
Permalink
Post by McHugh, Michael
NotImplementedError: docutils.writers.wiki.TWikiTranslator visiting unknown
node type: transition
I'm not Joshua, and I don't know the code in question, but the message
above tells me that the wiki.py module simply doesn't handle
"transition" nodes. You could either remove the transitions from your
source, or add code to the wiki.py module to handle them. After you do
that, if you get other similar "NotImplementedError" messages, you'll
have to repeat the process.

-- David Goodger


On Tue, Jun 10, 2014 at 11:28 AM, McHugh, Michael
Post by McHugh, Michael
Hi Joshua,
I am having some trouble converting some documents from RST to twiki format.
I wonder if there’s something obvious that I’m doing wrong...
I am using Windows Python 2.7 within a Cygwin shell (although I get similar
output from a “cmd” shell window).
I have copied the following files as indicated
rst2wiki.py è C:\Python27\Scripts\
wiki.py è C:\Python27\Lib\site-packages\docutils\writers\
$ /cygdrive/c/Python27/python.exe C:/Python27/Scripts/rst2wiki.py --wiki
twiki test.rst test.twiki
Exiting due to error. Use "--traceback" to diagnose.
Include "--traceback" output, Docutils version (0.11 [repository]),
Python version (2.7.2), your OS type & version, and the
command line used.
$ /cygdrive/c/Python27/python.exe C:/Python27/Scripts/rst2wiki.py
--traceback --wiki twiki test.rst test.twiki
File "C:/Python27/Scripts/rst2wiki.py", line 37, in <module>
publish_cmdline(writer=wiki.Writer(), description=description)
File "C:\Python27\lib\site-packages\docutils\core.py", line 352, in publish_cmdline
config_section=config_section, enable_exit_status=enable_exit_status)
File "C:\Python27\lib\site-packages\docutils\core.py", line 219, in publish
output = self.writer.write(self.document, self.destination)
File "C:\Python27\lib\site-packages\docutils\writers\__init__.py", line 80, in write
self.translate()
File "C:\Python27\lib\site-packages\docutils\writers\wiki.py", line 55, in translate
self.document.walkabout(visitor)
File "C:\Python27\lib\site-packages\docutils\nodes.py", line 174, in walkabout
File "C:\Python27\lib\site-packages\docutils\nodes.py", line 166, in walkabout
visitor.dispatch_visit(self)
File "C:\Python27\lib\site-packages\docutils\nodes.py", line 1882, in dispatch_visit
return method(node)
File "C:\Python27\lib\site-packages\docutils\nodes.py", line 1907, in unknown_visit
% (self.__class__, node.__class__.__name__))
NotImplementedError: docutils.writers.wiki.TWikiTranslator visiting unknown
node type: transition
If I can’t use this tool, my team and I might have to convert the RST to
wiki by hand (ugh...) or we might roll-our-own script to do most of the
heavy lifting. We would love to use the tool you’ve created though!
Many thanks for your help!
Mike McHugh
DSP Engineer
Automotive Systems Division
Bose Corporation
office: (508)-305-4531
cell: (970)-367-6443
------------------------------------------------------------------------------
HPCC Systems Open Source Big Data Platform from LexisNexis Risk Solutions
Find What Matters Most in Your Big Data with HPCC Systems
Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
Leverages Graph Analysis for Fast Processing & Easy Data Exploration
http://p.sf.net/sfu/hpccsystems
_______________________________________________
Docutils-users mailing list
https://lists.sourceforge.net/lists/listinfo/docutils-users
Please use "Reply All" to reply to the list.
Loading...