Martin Landa wrote:

> > implemented in the other branches. But there isn't much point until
> > menuform.py is fixed.
> 
> I am not sure what should have been fixed. It's possible to launch a
> script which is not in the PATH. The script must be executable, then
> wxGUI is started properly.

1. Create a script in the current directory, e.g.:

        #!/usr/bin/env python
        #%Module
        #% description: Test script.
        #%End
        #%option
        #% key: option
        #% type: string
        #% description: An Option
        #% required: yes
        #%END
        
        import sys
        from grass.script import core as grass
        
        def main():
            print options['option']
        
        if __name__ == "__main__":
            options, flags = grass.parser()
            main()


2. Run it with e.g. "./test.py --ui". It invokes g.parser which
invokes menuform.py with the full path to the script.


3. Fill in the option then click on the "Run" button. This results in
an error dialog:

        Execution failed: 'test.py option=foo'
        
        Details: 
        Error: Unable to exectute command: 'test.py option=foo'

If you copy the script to a directory in $PATH, clicking the "Run"
button runs that script. This indicates that menuform.py is executing
the script using its basename, not the full path given as an argument.

-- 
Glynn Clements <[email protected]>
_______________________________________________
grass-dev mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/grass-dev

Reply via email to