g.parser does call the form.py with full path
|Reported by:||wenzeslaus||Owned by:||wenzeslaus|
|Keywords:||parser, forms, wxGUI, pyedit||Cc:|
When I run
gui/wxpython/gui_core/forms.py directly with full path:
python gui_core/forms.py ../../temporal/t.list/t.list.py
I get the module form/dialog (task frame) for the command and following debug output (
GUI D1/1: forms.py called using command: ../../temporal/t.list/t.list.py GUI D1/1: forms.py opening form for: ['t.list.py']
However, when I run the module itself (here with
--ui because of other parameters):
I don't get the GUI for module, I get an error dialog with message:
Unable to fetch interface description for command 't.list.py'. Details: [Errno 2] No such file or directory Try to set up GRASS_ADDON_PATH or GRASS_ADDON_BASE variable.
and the reason is actually clear from the debug output:
GUI D1/1: forms.py called using command: t.list.py type="strds" temporaltype="absolute,relative" order="id" columns="id" GUI D1/1: forms.py opening form for: ['unknown']
The parser mechanism does not pass the full path to file, so it is not found by the
task.py mechanism. The task.py should probably end with some other error then setting the name to
unknown but that's another story.
The function responsible for running GUI is
lib/gis/parser.c. It is passing result of
G_recreate_command() as a first parameter and this works pretty well. The problem is that it returns only base name of the command returned by
G_program_name() which uses global variable set by
G_set_program_name function which stripes the name to using
I cannot go further because
G_recreate_command does not have any useful documentations (the only line of doc is related to non-interactivity which is really outdated). I hope that some others knows what is the concept of this and so what is the right solution.
This functionality is important for testing non-core modules (addons/extensions) and more importantly it is crucial for running user scripts or scripts distributed in other way then GRASS Addons repository.
Note that you need at least r58212 (GRASS 7) to test this because I added the debug messages in r58212. By the way, I've fixed the two tests there and extended usage suggestions when you run it without parameters.
*This is the second Trac component I'm suggesting in past few weeks but what about Parser/G_parser/GRASS Parser/g.parser component*.
Change History (6)
comment:3 by , 8 years ago
|Keywords:||forms wxGUI added|
|Milestone:||7.0.0 → 7.1.0|