[GRASS-user] script html manual file directory

Moritz Lennert mlennert at club.worldonline.be
Fri Apr 27 08:34:10 PDT 2018


Le Fri, 27 Apr 2018 16:08:00 +0200,
Frank David <frank.david at geophom.fr> a écrit :

> Thank you Moritz,
> 
> I succeed to install python script, But.. my script use a custom lib
> in a sub-folder for my shared functions, so g.extension fails with
> the line "from gg.geolib import *". How may I manage this included
> lib ?
> 

Check examples of other scripts and how they handle this. For example:
r.agent [1] or r.green [2].

Check the Makefiles at each level, including the one in the
library directory, and how the set the path for import of the library
files before importing them:

From r.agent.rand [3]:

from grass.pygrass.utils import set_path

set_path('r.agent', 'libagent', '..')
from libagent import error, grassland, world


> Without this include, install works (only on console, not with gui)

You would need to give us more details: what do you do exactly and what
doesn't work ?

> and allows to exec the script from console. I notice encoding manual
> is not in UTF-8. Is it possible to force UTF-8 encoding ?. 

I don't think so, but others should know better than me. If you want to
include accented characters, you should use html symbol codes (i.e.
'&‌agrave;' for à, etc).

> However,
> my custom menu (toolboxes.xml) fails with the following error :
> 
> "/usr/local/grass-7.4.0svn/gui/wxpython/lmgr/frame.py", line
> 905, in OnMenuCmd
> 
> GUI(parent=self, giface=self._giface).ParseCommand(cmd)
>    File
> "/usr/local/grass-7.4.0svn/gui/wxpython/gui_core/forms.py",
> line 2834, in ParseCommand
> 
> raise gcmd.GException(e.value)
> core.gcmd
> .
> GException
> :
> Unable to fetch interface description for command
> 'gzvibin.py'.
> Details: [Errno 2] No such file or directory

This sounds like it cannot find gzvibin.py. How and where did you
'install' it ?

Moritz


[1]
https://trac.osgeo.org/grass/browser/grass-addons/grass7/raster/r.agent
[2]
https://trac.osgeo.org/grass/browser/grass-addons/grass7/raster/r.green
[3]
https://trac.osgeo.org/grass/browser/grass-addons/grass7/raster/r.agent/r.agent.rand/r.agent.rand.py#L91


More information about the grass-user mailing list