On Fri, Feb 19, 2016 at 1:51 AM, Pietro <peter.zamb@gmail.com> wrote:
I've recently implemented a function in r.green.install
("add_rgreen_menu" [0]) that modify the main_menu.xml and
toolboxes.xml files in the ~/.grass7/toolboxes directory adding a menu
for the r.green modules.
Nice. The whole r.green.install is a nice work (although it is a workaround
I guess). Perhaps some things can go to grass.tools package. The whole
toolbox things should move there anyway.
Just now, I've seen the flag "t" in g.extension but it is not clear to
me how should I prepare the xml files, should I add the r.green
toolboxes in:
https://trac.osgeo.org/grass/browser/grass-addons/grass7/toolboxes.xml ?
The important part is that addon toolboxes and GUI toolboxes are unrelated.
The unification is a TODO (it might be on some list somewhere).
How toolboxes are used in addons is to install related modules together.
This happens automatically for r.green.* since it is one directory (I like
to call it module group).
If yes there is a way to test it locally without messing the official:
grass-addons/grass7/toolboxes.xml?
Generally, it is hard to test the addons things locally and Martin can
probably comment more on what is currently possible and what is not. Having
all local would definitively simplify development.
However, there is a test for g.extension using addons' toolboxes.xml which
is local. Unfortunately, it seems that there is something wrong with
g.extension as I was not able install toolbox last time I tried. I had no
time to look to the code and fix it.
Why generate an unique xml file for all the addons?
I'm not sure if I understand the question.
Perhaps g.extension could detect in the main root of the grass addon a
toolboxes directory and if the flag "-t" is true proceed installing
and merging the toolboxes in the GRASS GUI. For example for the
r.green module I should only define a directory in
grass-addons/grass7/raster/r.green/toolboxes that contains two xml
files (main_menu.xml and toolboxes.xml).
This is the addons and GUI toolboxes unification task. It makes sense to
have files and flag to add toolboxes to a special position in menu (as
opposed to on-the-fly auto-generated addon list (which is quite
problematic)). For some modules in addons it makes sense to install them
together, although they are not in the same directory (they have
independent implementations). Some toolboxes might even mix modules from
addons and from core.
Vaclav