[GRASS-user] GRASS can't fetch interface description for Python script

Hi there,

I'm having a lot of trouble starting this script in GRASS. As I'm more than
a newbie in programming, this is probably some really basic mistake, but my
other scripts all work consistently in GRASS and I've been working on this
for quite a while with no success, so here goes :slight_smile:

I quickly put together a script, copied it into /opt/grass/scripts, and when
I try to call it from within GRASS it returns the following error:
Traceback (most recent call last):
  File "/opt/grass/etc/wxpython/gui_modules/prompt.py", line
1067, in OnKeyPressed

self.parent.RunCmd(cmd)
  File "/opt/grass/etc/wxpython/gui_modules/goutput.py",
line 516, in RunCmd

task = menuform.GUI().ParseInterface(command)
  File "/opt/grass/etc/wxpython/gui_modules/menuform.py",
line 2020, in ParseInterface

tree = etree.fromstring(getInterfaceDescription(cmd[0]))
  File "/opt/grass/etc/wxpython/gui_modules/menuform.py",
line 1970, in getInterfaceDescription

"Details: %s") % (cmd, e.value)
AttributeError
:
'exceptions.OSError' object has no attribute 'value'

I'm not really able to find any differences between this script and another
script that works just fine. However, several scripts that I'd used about a
year ago don't work any more, even though the code's the same - very
mysterious. I'm using the most recent GRASS 6.4.1 from the OpenSUSE
geo-repository.

Any clues or tips would be greatly appreciated! Would enclose more
information, but I'm not sure what's exactly relevant and I don't want to
spam ya'll with my entire code. Thanks!
Daniel

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/GRASS-can-t-fetch-interface-description-for-Python-script-tp6393688p6393688.html
Sent from the Grass - Users mailing list archive at Nabble.com.

...Yes, you can laugh at me...

I've been trying to solve this program for a week. The only problem was that
I hadn't made the script executable. Sorry!!! It works now :wink:

Now I have to go dunk my head in icewater...

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/GRASS-can-t-fetch-interface-description-for-Python-script-tp6393688p6393725.html
Sent from the Grass - Users mailing list archive at Nabble.com.

Daniel wrote:

I'm having a lot of trouble starting this script in GRASS.
As I'm more than a newbie in programming, this is probably
some really basic mistake, but my other scripts all work
consistently in GRASS and I've been working on this
for quite a while with no success, so here goes :slight_smile:

I quickly put together a script, copied it into
/opt/grass/scripts, and when I try to call it from within
GRASS it returns the following error:

...

'exceptions.OSError' object has no attribute 'value'

Is /opt/grass/scripts set up in GRASS_ADDON_PATH, and
  export GRASS_ADDON_PATH=/opt/grass/scripts
set up in ~/.bashrc ?

(Scripts run in two passes, the first will start from the pwd,
but if that's not in the $PATH then the second g.parser pass
won't be able to find itself, and you get a not-very-helpful
error message.)

just a guess,
Hamish

Hi Hamisch,

thanks for the reply, but the problem was even more basic than that - I'd
simply forgotten to make the script executable. A simple mistake, but one
that I needed hours to recognize, probably due to programming for too long
without a break :wink:

Thanks,
Daniel

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/GRASS-can-t-fetch-interface-description-for-Python-script-tp6393688p6411247.html
Sent from the Grass - Users mailing list archive at Nabble.com.