<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi all,<br>
</p>
<p>Thank you for your advices Moritz !<br>
</p>
<p>I succeed (I guess..) to make a package with several python
scripts (one by sub-folder) and a shared library (in its own
sub-folder). I can install with g.extension (only in command line)
(why?). But the entries does not appear in g.extension list
because they are not in in .grass7/addons/modules.xml. I do not
find anything about the way to add my entries in that file. It's
not a part of Makefile commands. How it's handled ?</p>
<p>I notice that: if I install twice my package (suite) with
g.extension, the library sub-folder is copied inside the library
sub-folder (one level too low and do not replace), if I install
once again, the library replace the lowest level folder. So, If i
update the library I must remove manually the library to keep it
at the right level. Do you have an idea of the reason ? (I
suppose Makefile, but I don't understand - see below the Makefile)</p>
<p>I have created a custom menu toolboxes.xml. Is there a way ton
install my menu and insert the sub-toolbox in main_menu.xml ?</p>
<p>Concerning french accent, as you suggest, I can use html special
characters &xxx; for the <description> part, and it
works. But not in the #% description module entries of the python
script for correct display in gui. However, the manual display bad
characters in the upper section (like é for é), and good in the
lowest... Is there a way to have accent both in gui and manual ?</p>
<p>Regards,</p>
<p>Frank</p>
<p><u>Library Makefile:</u></p>
<p>MODULE_TOPDIR = ../../..<br>
<br>
include $(MODULE_TOPDIR)/include/Make/Other.make<br>
include $(MODULE_TOPDIR)/include/Make/Python.make<br>
<br>
MODULES = utils __init__<br>
<br>
PGM = r.wtg<br>
LIBDIR = libwtg<br>
ETCDIR = $(ETC)/$(PGM)/$(LIBDIR)<br>
<br>
PYFILES := $(patsubst %,$(ETCDIR)/%.py,$(MODULES))<br>
PYCFILES := $(patsubst %,$(ETCDIR)/%.pyc,$(MODULES))<br>
<br>
default: $(PYFILES) $(PYCFILES)<br>
<br>
$(ETCDIR):<br>
$(MKDIR) $@<br>
<br>
$(ETCDIR)/%: % | $(ETCDIR)<br>
$(INSTALL_DATA) $< $@<br>
<br>
install:<br>
$(MKDIR) $(INST_DIR)/etc/$(PGM)<br>
cp -r $(ETCDIR) $(INST_DIR)/etc/$(PGM)/$(LIBDIR)<br>
<br>
</p>
<br>
<div class="moz-cite-prefix">Le 27/04/2018 à 17:34, Moritz Lennert a
écrit :<br>
</div>
<blockquote type="cite"
cite="mid:20180427173410.3c39f51e@moritz-ulb">
<pre wrap="">Le Fri, 27 Apr 2018 16:08:00 +0200,
Frank David <a class="moz-txt-link-rfc2396E" href="mailto:frank.david@geophom.fr"><frank.david@geophom.fr></a> a écrit :
</pre>
<blockquote type="cite">
<pre wrap="">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 ?
</pre>
</blockquote>
<pre wrap="">
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
</pre>
<blockquote type="cite">
<pre wrap="">Without this include, install works (only on console, not with gui)
</pre>
</blockquote>
<pre wrap="">
You would need to give us more details: what do you do exactly and what
doesn't work ?
</pre>
<blockquote type="cite">
<pre wrap="">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 ?.
</pre>
</blockquote>
<pre wrap="">
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.
'à' for à, etc).
</pre>
<blockquote type="cite">
<pre wrap="">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
</pre>
</blockquote>
<pre wrap="">
This sounds like it cannot find gzvibin.py. How and where did you
'install' it ?
Moritz
[1]
<a class="moz-txt-link-freetext" href="https://trac.osgeo.org/grass/browser/grass-addons/grass7/raster/r.agent">https://trac.osgeo.org/grass/browser/grass-addons/grass7/raster/r.agent</a>
[2]
<a class="moz-txt-link-freetext" href="https://trac.osgeo.org/grass/browser/grass-addons/grass7/raster/r.green">https://trac.osgeo.org/grass/browser/grass-addons/grass7/raster/r.green</a>
[3]
<a class="moz-txt-link-freetext" href="https://trac.osgeo.org/grass/browser/grass-addons/grass7/raster/r.agent/r.agent.rand/r.agent.rand.py#L91">https://trac.osgeo.org/grass/browser/grass-addons/grass7/raster/r.agent/r.agent.rand/r.agent.rand.py#L91</a>
</pre>
</blockquote>
<br>
<div class="moz-signature">-- <br>
<style>
div#signature {font-size:10px;color:#666;margin:10px 0}
span#geophom {font-size:11px;color:#A1CD1A}
div#important {font-size:10px;color:#CB110B;font-style:italic}
</style>
<div id="signature"> <span id="geophom"><b>Geophom</b></span><br>
327 rue de Vieille Cour 44521 OUDON<br>
Tel +33(0)2 85 52 02 59 - Port +33(0)6 04 47 91 06<br>
<a class="moz-txt-link-abbreviated" href="http://www.geophom.fr">www.geophom.fr</a><br>
</div>
</div>
</body>
</html>