<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Jul 2, 2014 at 11:19 AM, Anna Petrášová <span dir="ltr"><<a href="mailto:kratochanna@gmail.com" target="_blank">kratochanna@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">
<div><div class="h5">On Wed, Jul 2, 2014 at 10:59 AM, Vaclav Petras <span dir="ltr"><<a href="mailto:wenzeslaus@gmail.com" target="_blank">wenzeslaus@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div><div><div class="gmail_extra">
<br><div class="gmail_quote">On Wed, Jul 2, 2014 at 10:39 AM, Martin Landa <span dir="ltr"><<a href="mailto:landa.martin@gmail.com" target="_blank">landa.martin@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div style="overflow:hidden">The reason is empty XML wxGUI menu file (menudata.xml) produced by<br>
building system, see [2].<br>
<div><br>
Traceback (most recent call last):<br>
</div> File "core/toolboxes.py", line 759, in <module><br>
sys.exit(main())<br>
File "core/toolboxes.py", line 745, in main<br>
userDefined=False)<br>
File "core/toolboxes.py", line 204, in createTree<br>
moduleItems=moduleItems)<br>
File "core/toolboxes.py", line 241, in toolboxes2menudata<br>
_expandRuntimeModules(root)<br>
File "core/toolboxes.py", line 514, in _expandRuntimeModules<br>
desc, keywords = _loadMetadata(name)<br>
File "core/toolboxes.py", line 540, in _loadMetadata<br>
task = gtask.parse_interface(module)<br>
File "c:\osgeo4w\usr\src\grass_trunk\dist.i686-pc-mingw32\etc\python\grass\script\task.py",<br>
line 501, in parse_interface<br>
tree = etree.fromstring(get_interface_description(name))<br>
File "c:\osgeo4w\usr\src\grass_trunk\dist.i686-pc-mingw32\etc\python\grass\script\task.py",<br>
line 465, in get_interface_description<br>
stderr = PIPE)<br>
File "c:\osgeo4w\usr\src\grass_trunk\dist.i686-pc-mingw32\etc\python\grass\script\core.py",<br>
line 58, in __init__<br>
name, ext = os.path.splitext(cmd)<br>
File "c:/OSGeo4W/apps/Python27\lib\ntpath.py", line 190, in splitext<br>
return genericpath._splitext(p, sep, altsep, extsep)<br>
File "c:/OSGeo4W/apps/Python27\lib\genericpath.py", line 91, in _splitext<br>
sepIndex = p.rfind(sep)<br>
AttributeError: 'NoneType' object has no attribute 'rfind'<br>
make[4]: *** [xml/menudata.xml] Error 1</div></blockquote></div><br></div></div></div></div></blockquote></div></div><div>It's because it can't find v.in.gps. I suggest to add to the patch something like this:</div>
<div><br>
</div><div><span style="font-family:arial,sans-serif;font-size:13px">+ def __init__(self, args, **kwargs):</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">+ if ( sys.platform == 'win32'</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">+ and isinstance(args, list)</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">+ and not kwargs.get('shell', False)</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">+ and kwargs.get('executable') is None ):</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">+ cmd = shutil_which(args[0])</span></div>
<div><span style="background-color:rgb(255,255,255)"><font color="#ff0000"> if cmd is None:</font></span></div><div><span style="background-color:rgb(255,255,255)"><font color="#ff0000"> raise OSError</font></span><br>
<span style="font-family:arial,sans-serif;font-size:13px">+ args = [cmd] + args[1:]</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">+ name, ext = os.path.splitext(cmd)</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">+ if ext.lower() not in self._builtin_exts:</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">+ kwargs['shell'] = True</span><br style="font-family:arial,sans-serif;font-size:13px">
<span style="font-family:arial,sans-serif;font-size:13px">+ args = [self._escape_for_shell(arg) for arg in args]</span><br style="font-family:arial,sans-serif;font-size:13px"><span style="font-family:arial,sans-serif;font-size:13px">+ subprocess.Popen.__init__(</span><span style="font-family:arial,sans-serif;font-size:13px">self, args, **kwargs)</span></div>
</div></div></div></blockquote><div><br></div><div>Otherwise the patch seems to work, I can run:</div><div><span style="font-family:arial,sans-serif;font-size:13px">grass.run_comma</span><span style="font-family:arial,sans-serif;font-size:13px">nd('r.support', map='mymap', title="|@#~$%^&</span><span style="font-family:arial,sans-serif;font-size:13px">*()><") in GUI python console which was not possible before. <a href="http://r.info">r.info</a> then gives correct result.</span><br>
</div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">Running this command in gui console works but <a href="http://r.info">r.info</a> gives incorrect result:</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px">r.support map=scanned title="|@#$%^&*(</span><span style="font-family:arial,sans-serif;font-size:13px">)"</span><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">and <a href="http://r.info">r.info</a> gives </span><span style="font-size:13px;font-family:arial,sans-serif">^^^|@#$%^^^^^^^</span><span style="font-size:13px;font-family:arial,sans-serif">&*()</span></div>
<div><span style="font-size:13px;font-family:arial,sans-serif"><br></span></div><div><span style="font-size:13px;font-family:arial,sans-serif">but gui command line functionality was not affected by this patch, it uses different popen class, this is related to r</span><font face="arial, sans-serif">60634 and following.</font></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><br>
</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class=""><div dir="ltr">
<div><div>
<div class="gmail_extra"></div></div></div><div class="gmail_extra">It seems that shutil_which returned None at line (from the patch):<br><br>cmd = shutil_which(args[0])<br></div></div>
<br></div><div class="">_______________________________________________<br>
grass-dev mailing list<br>
<a href="mailto:grass-dev@lists.osgeo.org" target="_blank">grass-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-dev</a><br></div></blockquote></div><br></div></div>
</blockquote></div><br></div></div>