[GRASS-user] script by bash to Python
glynn at gclements.plus.com
Wed Sep 24 09:21:46 EDT 2008
Gabriele N. wrote:
> All my scripts in bash work with tcltk.
> Now, I take as example my 2 scripts: v.to.dem.sh and v.impact.sh.
> With WxPython all the scripts were not working with grass 63. With Grass64,
> instead, some scripts works (es v.impact.sh) and some other scripts does not
> works (es.v.to.dem.sh). But I do not know what may be the characteristic
> that makes v.impact.sh work and that does not work v.to.dem.sh.
> I hope to have been clearer.
> Thanks :-)
> The error is always the same. Here's an example:
> GRASS 6.4.svn (gb2):~ > v.to.dem.sh
> Traceback (most recent call last):
> File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/menuform.py", line 1687, in <module>
> GrassGUIApp( grassTask( sys.argv ) ).MainLoop()
> File "/usr/local/grass-6.4.svn/etc/wxpython/gui_modules/menuform.py", line 193, in __init__
> xml.sax.parseString( getInterfaceDescription( grassModule ) , processTask( self ) )
> File "/usr/lib/python2.5/xml/sax/__init__.py", line 49, in parseString
> File "/usr/lib/python2.5/xml/sax/expatreader.py", line 107, in parse
> xmlreader.IncrementalParser.parse(self, source)
> File "/usr/lib/python2.5/xml/sax/xmlreader.py", line 123, in parse
> File "/usr/lib/python2.5/xml/sax/expatreader.py", line 211, in feed
> File "/usr/lib/python2.5/xml/sax/handler.py", line 38, in fatalError
> raise exception
> xml.sax._exceptions.SAXParseException: <unknown>:21:73: not well-formed
> (invalid token)
This indicates the the output from
isn't valid XML.
This is likely to be caused by the contents of the option descriptions
at the top of the script (the #% lines).
Does one of the entries have <unknown> as its value? If so, which
field (gisprompt, label, etc) is it in?
I suspect that the code which generates the XML data isn't always
converting <, > and & to <, > and & when it should.
You can work around the problem by using e.g. (unknown), but we should
really fix this in the code which generates the XML.
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-user