Discussion:
[GRASSGUI] wxgrass prototype
Michael Barton
2007-11-14 22:56:48 UTC
Permalink
I just committed the last pieces to having a pretty much fully functional
(most of the time) GUI prototype in wxPython. This has been a real team
effort; a special recognition is owed to J?chym Cepicky for getting this off
the ground and keeping it going?along with a lot of coding. But there have
also been contributions from Martin Landa, Daniel Calvelo, Markus Neteler,
and Glynn Clements.

What we have now is a GIS Manager with the option of adding raster, vector,
and command layers (and setting transparency for map layers); an integrated
command input and output window; menus for all (or most) GRASS commands; and
a parser that will create a simple GUI dialog for any command selected. The
GIS Manager can launch multiple map display windows, which have a simple set
of controls on a tear-off toolbar. There is a nice startup screen and the
beginnings of a location creation wizard.

To add a map to the layer tree, click on the appropriate button (or type
d.rast or d.vect from the command line). Then double click on the layer to
open up an options dialog. When you have the settings, press ?run? or hit
enter in the options dialog (you?ll see the name of the layer change to
match the map you?ve selected. Set the desired transparency. Press display
on the associated map display window.

The prototype is in the new GRASS subversion repository
<https://grasssvn.itc.it/grasssvn/grassaddons/trunk/grassaddons/gui/#_trunk_
grassaddons_gui_>

Most of the files go into $GISBASE/etc/wx. The script ?wxgrass? goes into
$GISBASE/scripts. If you want to automatically start up in wxgrass, you can
use the init.sh script provided (you may need to edit it to match your
exiting version if you have trouble with the LD_LIBRARY setting).

To use this, you?ll need to have Python 2.4 or greater and wxPython 2.8.1 or
greater.

We still have a lot to do on this, but the initial work is done to a point
that you can try it out.

Enjoy
Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-gui/attachments/20070320/cdf9b2ee/attachment.html
Jachym Cepicky
2007-11-14 22:56:48 UTC
Permalink
Hi, congrats, great work, Michael!
To use this, you'll need to have Python 2.4 or greater and wxPython 2.8.1
or greater.
Python 2.3 here :-)

Jachym
--
Jachym Cepicky
e-mail: jachym.cepicky gmail com
URL: http://les-ejk.cz
GPG: http://www.les-ejk.cz/pgp/jachym_cepicky-gpg.pub
Moritz Lennert
2007-11-14 22:56:48 UTC
Permalink
Post by Michael Barton
I just committed the last pieces to having a pretty much fully
functional (most of the time) GUI prototype in wxPython.
Congratulations !

Some very first remarks (all messages appear in the terminal window):

- I have to do a 'ln -s Gism gism', otherwise I get:

ValueError: unknown url type:
/usr/lib/grass/etc/wx/gism//grass-interface.dtd

- I still get the following at startup:

GRASS_INFO_ERROR(21763,1): region for current mapset is not set
GRASS_INFO_ERROR(21763,1): run "g.region"
GRASS_INFO_END(21763,1)


- Everytime I change the value of transparency, I get:

GRASS_INFO_WARNING(21970,1): 'vector/communes' was found in more mapsets
(also found in mlennert).
GRASS_INFO_END(21970,1)

- Config->Region gives me:

Traceback (most recent call last):
File "/usr/lib/grass/etc/wx/gism.py", line 281, in runMenuCmd
menuform.GUI().parseCommand(cmd,gmpath, parentframe=self)
File "/usr/lib/grass/etc/wx/Gism/menuform.py", line 514, in parseCommand
mf = mainFrame(self.parent ,-1, self.w, self.h, self.get_dcmd, layer)
File "/usr/lib/grass/etc/wx/Gism/menuform.py", line 315, in __init__
type=grass_task['params'][p_count]['element'])
File "/usr/lib/grass/etc/wx/Gism/select.py", line 15, in __init__
tcp.getElementList(type)
File "/usr/lib/grass/etc/wx/Gism/select.py", line 113, in getElementList
elem_list = os.listdir(os.path.join (location_path, dir, element))
OSError: [Errno 2] Aucun fichier ou r?pertoire de ce type:
'/home/mlennert/GRASS/DATA/BELGIQUE/mlennert/3d.view'

- If there is no PERMANENT/cell directory, I cannot display a raster map
in another mapset (i.e. I am in mapset mlennert, wishing to display a
raster map which is in mapset mlennert):

Traceback (most recent call last):
File "/usr/lib/grass/etc/wx/gism.py", line 359, in addRaster
self.SetTree('raster')
File "/usr/lib/grass/etc/wx/gism.py", line 378, in SetTree
self.maptree.AddLayer(disp_idx, layertype)
File "/usr/lib/grass/etc/wx/Gism/gismutils.py", line 139, in AddLayer
menuform.GUI().parseCommand('d.rast', gmpath,
completed=(self.getOptData,layer), parentframe=self)
File "/usr/lib/grass/etc/wx/Gism/menuform.py", line 514, in parseCommand
mf = mainFrame(self.parent ,-1, self.w, self.h, self.get_dcmd, layer)
File "/usr/lib/grass/etc/wx/Gism/menuform.py", line 315, in __init__
type=grass_task['params'][p_count]['element'])
File "/usr/lib/grass/etc/wx/Gism/select.py", line 15, in __init__
tcp.getElementList(type)
File "/usr/lib/grass/etc/wx/Gism/select.py", line 120, in getElementList
elem_list = os.listdir(os.path.join (location_path, dir, element))
OSError: [Errno 2] Aucun fichier ou r?pertoire de ce type:
'/home/mlennert/GRASS/DATA/BELGIQUE/PERMANENT/cell'

- The same for the PERMANENT/vector directory:


Traceback (most recent call last):
File "/usr/lib/grass/etc/wx/gism.py", line 363, in addVector
self.SetTree('vector')
File "/usr/lib/grass/etc/wx/gism.py", line 378, in SetTree
self.maptree.AddLayer(disp_idx, layertype)
File "/usr/lib/grass/etc/wx/Gism/gismutils.py", line 144, in AddLayer
menuform.GUI().parseCommand('d.vect', gmpath,
completed=(self.getOptData,layer), parentframe=self)
File "/usr/lib/grass/etc/wx/Gism/menuform.py", line 514, in parseCommand
mf = mainFrame(self.parent ,-1, self.w, self.h, self.get_dcmd, layer)
File "/usr/lib/grass/etc/wx/Gism/menuform.py", line 315, in __init__
type=grass_task['params'][p_count]['element'])
File "/usr/lib/grass/etc/wx/Gism/select.py", line 15, in __init__
tcp.getElementList(type)
File "/usr/lib/grass/etc/wx/Gism/select.py", line 120, in getElementList
elem_list = os.listdir(os.path.join (location_path, dir, element))
OSError: [Errno 2] Aucun fichier ou r?pertoire de ce type:
'/home/mlennert/GRASS/DATA/ESPON/PERMANENT/vector'



- When I chose a vector map name, I get:

Could not execute 'd.vect map=ssbel01
type=point,line,boundary,centroid,area,face display=shape icon=basic/x
size=8 layer=1 width=0 wscale=1 color=black fcolor=200:200:200
rgb_column=GRASSRGB lcolor=red bgcolor=none bcolor=none lsize=8
xref=left yref=center render=g'
Could not render layer <d.vect map=ssbel01
type=point,line,boundary,centroid,area,face display=shape icon=basic/x
size=8 layer=1 width=0 wscale=1 color=black fcolor=200:200:200
rgb_column=GRASSRGB lcolor=red bgcolor=none bcolor=none lsize=8
xref=left yref=center render=***@mlennert>

- I still cannot add a second vector or raster map:

vector:

Traceback (most recent call last):
File "/usr/lib/grass/etc/wx/gism.py", line 363, in addVector
self.SetTree('vector')
File "/usr/lib/grass/etc/wx/gism.py", line 378, in SetTree
self.maptree.AddLayer(disp_idx, layertype)
File "/usr/lib/grass/etc/wx/Gism/gismutils.py", line 117, in AddLayer
if self.layer_selected and self.layer_selected != self.GetRootItem():
File
"/usr/lib/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/_controls.py",
line 4996, in __ne__
return _controls_.TreeItemId___ne__(*args, **kwargs)
TypeError: in method 'TreeItemId___ne__', expected argument 2 of type
'wxTreeItemId const *'


raster:

Traceback (most recent call last):
File "/usr/lib/grass/etc/wx/gism.py", line 359, in addRaster
self.SetTree('raster')
File "/usr/lib/grass/etc/wx/gism.py", line 378, in SetTree
self.maptree.AddLayer(disp_idx, layertype)
File "/usr/lib/grass/etc/wx/Gism/gismutils.py", line 117, in AddLayer
if self.layer_selected and self.layer_selected != self.GetRootItem():
File
"/usr/lib/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/_controls.py",
line 4996, in __ne__
return _controls_.TreeItemId___ne__(*args, **kwargs)
TypeError: in method 'TreeItemId___ne__', expected argument 2 of type
'wxTreeItemId const *'

- I add a vector layer, the d.vect window opens, I select a map, press
run and display it, then within the same d.vect window (which is still
open) I select another map and press run, but nothing happens. This is
not true for other options (color, type, etc).
To change the map, I have to close the d.vect window and double click on
the layer to reopen the d.vect window. Then I can change the map name,
click run and the new map displays.


That's it for now...

Good job guys !

Moritz

P.S.
Debian with
python2.4 2.4.4-2 2.4 and python-wxgtk2.8 2.8.1.1-0
Moritz Lennert
2007-11-14 22:56:48 UTC
Permalink
And a few more remarks:

- When double-clicking on an already existing layer to make the
d.vect/d.rast window appear, this window does not contain the map name
of the map that was selected before. I think this should be the case, as
when you just want to modify one option, you don't want to always have
to reselect the map name

- Flags (such as d.vect -c) do not seem to be taken into account (at
least they don't show in the command line displayed in the output window).

- When using the provided Init.sh to run grass -wx, wxgrass is modal,
i.e. you don't have access to the command line in the terminal window
anymore.


Moritz
Michael Barton
2007-11-14 22:56:48 UTC
Permalink
Thanks for the comments Moritz. Some responses below.
Post by Moritz Lennert
Post by Michael Barton
I just committed the last pieces to having a pretty much fully
functional (most of the time) GUI prototype in wxPython.
Congratulations !
/usr/lib/grass/etc/wx/gism//grass-interface.dtd
I don't get this because I'm on a Mac, which isn't very strict on
capitalization/non-capitalization of file and directory names. Need to see
where this typo is. Also need to change from gism to gismgr or something
like that.
Post by Moritz Lennert
GRASS_INFO_ERROR(21763,1): region for current mapset is not set
GRASS_INFO_ERROR(21763,1): run "g.region"
GRASS_INFO_END(21763,1)
GRASS_INFO_WARNING(21970,1): 'vector/communes' was found in more mapsets
(also found in mlennert).
GRASS_INFO_END(21970,1)
Right now, all actions are very 'noisy', producing lots of messages in the
terminal
Post by Moritz Lennert
File "/usr/lib/grass/etc/wx/gism.py", line 281, in runMenuCmd
menuform.GUI().parseCommand(cmd,gmpath, parentframe=self)
File "/usr/lib/grass/etc/wx/Gism/menuform.py", line 514, in parseCommand
mf = mainFrame(self.parent ,-1, self.w, self.h, self.get_dcmd, layer)
File "/usr/lib/grass/etc/wx/Gism/menuform.py", line 315, in __init__
type=grass_task['params'][p_count]['element'])
File "/usr/lib/grass/etc/wx/Gism/select.py", line 15, in __init__
tcp.getElementList(type)
File "/usr/lib/grass/etc/wx/Gism/select.py", line 113, in getElementList
elem_list = os.listdir(os.path.join (location_path, dir, element))
'/home/mlennert/GRASS/DATA/BELGIQUE/mlennert/3d.view'
I'll have to try and see what's up with this.
Post by Moritz Lennert
- If there is no PERMANENT/cell directory, I cannot display a raster map
in another mapset (i.e. I am in mapset mlennert, wishing to display a
File "/usr/lib/grass/etc/wx/gism.py", line 359, in addRaster
self.SetTree('raster')
File "/usr/lib/grass/etc/wx/gism.py", line 378, in SetTree
self.maptree.AddLayer(disp_idx, layertype)
File "/usr/lib/grass/etc/wx/Gism/gismutils.py", line 139, in AddLayer
menuform.GUI().parseCommand('d.rast', gmpath,
completed=(self.getOptData,layer), parentframe=self)
File "/usr/lib/grass/etc/wx/Gism/menuform.py", line 514, in parseCommand
mf = mainFrame(self.parent ,-1, self.w, self.h, self.get_dcmd, layer)
File "/usr/lib/grass/etc/wx/Gism/menuform.py", line 315, in __init__
type=grass_task['params'][p_count]['element'])
File "/usr/lib/grass/etc/wx/Gism/select.py", line 15, in __init__
tcp.getElementList(type)
File "/usr/lib/grass/etc/wx/Gism/select.py", line 120, in getElementList
elem_list = os.listdir(os.path.join (location_path, dir, element))
'/home/mlennert/GRASS/DATA/BELGIQUE/PERMANENT/cell'
File "/usr/lib/grass/etc/wx/gism.py", line 363, in addVector
self.SetTree('vector')
File "/usr/lib/grass/etc/wx/gism.py", line 378, in SetTree
self.maptree.AddLayer(disp_idx, layertype)
File "/usr/lib/grass/etc/wx/Gism/gismutils.py", line 144, in AddLayer
menuform.GUI().parseCommand('d.vect', gmpath,
completed=(self.getOptData,layer), parentframe=self)
File "/usr/lib/grass/etc/wx/Gism/menuform.py", line 514, in parseCommand
mf = mainFrame(self.parent ,-1, self.w, self.h, self.get_dcmd, layer)
File "/usr/lib/grass/etc/wx/Gism/menuform.py", line 315, in __init__
type=grass_task['params'][p_count]['element'])
File "/usr/lib/grass/etc/wx/Gism/select.py", line 15, in __init__
tcp.getElementList(type)
File "/usr/lib/grass/etc/wx/Gism/select.py", line 120, in getElementList
elem_list = os.listdir(os.path.join (location_path, dir, element))
'/home/mlennert/GRASS/DATA/ESPON/PERMANENT/vector'
These should be fixable with better error-trapping in select.Select.
Post by Moritz Lennert
Could not execute 'd.vect map=ssbel01
type=point,line,boundary,centroid,area,face display=shape icon=basic/x
size=8 layer=1 width=0 wscale=1 color=black fcolor=200:200:200
rgb_column=GRASSRGB lcolor=red bgcolor=none bcolor=none lsize=8
xref=left yref=center render=g'
Could not render layer <d.vect map=ssbel01
type=point,line,boundary,centroid,area,face display=shape icon=basic/x
size=8 layer=1 width=0 wscale=1 color=black fcolor=200:200:200
rgb_column=GRASSRGB lcolor=red bgcolor=none bcolor=none lsize=8
This happens when any map is first added. Part of the 'noisy' output. The
map can't be rendered until all information is complete. You can ignore it,
but we should track it down anyway.
Post by Moritz Lennert
File "/usr/lib/grass/etc/wx/gism.py", line 363, in addVector
self.SetTree('vector')
File "/usr/lib/grass/etc/wx/gism.py", line 378, in SetTree
self.maptree.AddLayer(disp_idx, layertype)
File "/usr/lib/grass/etc/wx/Gism/gismutils.py", line 117, in AddLayer
File
"/usr/lib/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/_controls.py",
line 4996, in __ne__
return _controls_.TreeItemId___ne__(*args, **kwargs)
TypeError: in method 'TreeItemId___ne__', expected argument 2 of type
'wxTreeItemId const *'
File "/usr/lib/grass/etc/wx/gism.py", line 359, in addRaster
self.SetTree('raster')
File "/usr/lib/grass/etc/wx/gism.py", line 378, in SetTree
self.maptree.AddLayer(disp_idx, layertype)
File "/usr/lib/grass/etc/wx/Gism/gismutils.py", line 117, in AddLayer
File
"/usr/lib/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/_controls.py",
line 4996, in __ne__
return _controls_.TreeItemId___ne__(*args, **kwargs)
TypeError: in method 'TreeItemId___ne__', expected argument 2 of type
'wxTreeItemId const *'
I don't understand the problem here. It is not happening on my system. Can
someone else check this out? This is not a version problem, and I don't know
what is wrong.
Post by Moritz Lennert
- I add a vector layer, the d.vect window opens, I select a map, press
run and display it, then within the same d.vect window (which is still
open) I select another map and press run, but nothing happens. This is
not true for other options (color, type, etc).
To change the map, I have to close the d.vect window and double click on
the layer to reopen the d.vect window. Then I can change the map name,
click run and the new map displays.
Yes. This is a consequence of just using the autogenerated command dialogs
for setting options at the moment. If you want to set options for a layer,
you need to open the options dialog for that layer, set the options, and
close the dialog. Repeat to set options for another layer. Also, if you want
to change options, you have to start over with an empty options dialog. This
is pretty clunky, but it was a fast way to make some kind of layer options
setting available. Clearly this needs to be considerably more sophisticated.

Thanks for the comments.

Michael

__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton
Moritz Lennert
2007-11-14 22:56:48 UTC
Permalink
Post by Moritz Lennert
- When double-clicking on an already existing layer to make the
d.vect/d.rast window appear, this window does not contain the map name
of the map that was selected before. I think this should be the case, as
when you just want to modify one option, you don't want to always have
to reselect the map name
I definitely agree. Using the autogenerated dialogs has considerable
drawbacks at the moment. I don't know if these can be overcome with
enhancements to menuform.py or whether this will turn out to be further
reason for custom created dialogs for the few d.* commands.
Maybe the settings for each layer can be saved in some temporary file,
which could then also be the basis for saving a session ?

But this would mean enhancing the code generating the dialogs so that it
can take into account existing settings...

Moritz
Michael Barton
2007-11-14 22:56:48 UTC
Permalink
In fact, the settings for each layer *are* saved. But getting them into the
autogenerated dialogs is the issue.

Michael
Post by Moritz Lennert
Post by Moritz Lennert
- When double-clicking on an already existing layer to make the
d.vect/d.rast window appear, this window does not contain the map name
of the map that was selected before. I think this should be the case, as
when you just want to modify one option, you don't want to always have
to reselect the map name
I definitely agree. Using the autogenerated dialogs has considerable
drawbacks at the moment. I don't know if these can be overcome with
enhancements to menuform.py or whether this will turn out to be further
reason for custom created dialogs for the few d.* commands.
Maybe the settings for each layer can be saved in some temporary file,
which could then also be the basis for saving a session ?
But this would mean enhancing the code generating the dialogs so that it
can take into account existing settings...
Moritz
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton
Michael Barton
2007-11-14 22:56:48 UTC
Permalink
Moritz,

See below...
Post by Moritz Lennert
Post by Michael Barton
I just committed the last pieces to having a pretty much fully
functional (most of the time) GUI prototype in wxPython.
Congratulations !
/usr/lib/grass/etc/wx/gism//grass-interface.dtd
GRASS_INFO_ERROR(21763,1): region for current mapset is not set
GRASS_INFO_ERROR(21763,1): run "g.region"
GRASS_INFO_END(21763,1)
Fixed by Glynn
Post by Moritz Lennert
GRASS_INFO_WARNING(21970,1): 'vector/communes' was found in more mapsets
(also found in mlennert).
GRASS_INFO_END(21970,1)
This is a function of the "error" messages that I've been griping about that
don't really do much except clutter up the screen. At least they are less
frequent now.
Post by Moritz Lennert
File "/usr/lib/grass/etc/wx/gism.py", line 281, in runMenuCmd
menuform.GUI().parseCommand(cmd,gmpath, parentframe=self)
File "/usr/lib/grass/etc/wx/Gism/menuform.py", line 514, in parseCommand
mf = mainFrame(self.parent ,-1, self.w, self.h, self.get_dcmd, layer)
File "/usr/lib/grass/etc/wx/Gism/menuform.py", line 315, in __init__
type=grass_task['params'][p_count]['element'])
File "/usr/lib/grass/etc/wx/Gism/select.py", line 15, in __init__
tcp.getElementList(type)
File "/usr/lib/grass/etc/wx/Gism/select.py", line 113, in getElementList
elem_list = os.listdir(os.path.join (location_path, dir, element))
'/home/mlennert/GRASS/DATA/BELGIQUE/mlennert/3d.view'
This works for me. Want to update all and check again?
Post by Moritz Lennert
- If there is no PERMANENT/cell directory, I cannot display a raster map
in another mapset (i.e. I am in mapset mlennert, wishing to display a
File "/usr/lib/grass/etc/wx/gism.py", line 359, in addRaster
self.SetTree('raster')
File "/usr/lib/grass/etc/wx/gism.py", line 378, in SetTree
self.maptree.AddLayer(disp_idx, layertype)
File "/usr/lib/grass/etc/wx/Gism/gismutils.py", line 139, in AddLayer
menuform.GUI().parseCommand('d.rast', gmpath,
completed=(self.getOptData,layer), parentframe=self)
File "/usr/lib/grass/etc/wx/Gism/menuform.py", line 514, in parseCommand
mf = mainFrame(self.parent ,-1, self.w, self.h, self.get_dcmd, layer)
File "/usr/lib/grass/etc/wx/Gism/menuform.py", line 315, in __init__
type=grass_task['params'][p_count]['element'])
File "/usr/lib/grass/etc/wx/Gism/select.py", line 15, in __init__
tcp.getElementList(type)
File "/usr/lib/grass/etc/wx/Gism/select.py", line 120, in getElementList
elem_list = os.listdir(os.path.join (location_path, dir, element))
'/home/mlennert/GRASS/DATA/BELGIQUE/PERMANENT/cell'
This is fixed
Post by Moritz Lennert
Could not execute 'd.vect map=ssbel01
type=point,line,boundary,centroid,area,face display=shape icon=basic/x
size=8 layer=1 width=0 wscale=1 color=black fcolor=200:200:200
rgb_column=GRASSRGB lcolor=red bgcolor=none bcolor=none lsize=8
xref=left yref=center render=g'
Could not render layer <d.vect map=ssbel01
type=point,line,boundary,centroid,area,face display=shape icon=basic/x
size=8 layer=1 width=0 wscale=1 color=black fcolor=200:200:200
rgb_column=GRASSRGB lcolor=red bgcolor=none bcolor=none lsize=8
File "/usr/lib/grass/etc/wx/gism.py", line 363, in addVector
self.SetTree('vector')
File "/usr/lib/grass/etc/wx/gism.py", line 378, in SetTree
self.maptree.AddLayer(disp_idx, layertype)
File "/usr/lib/grass/etc/wx/Gism/gismutils.py", line 117, in AddLayer
File
"/usr/lib/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/_controls.py",
line 4996, in __ne__
return _controls_.TreeItemId___ne__(*args, **kwargs)
TypeError: in method 'TreeItemId___ne__', expected argument 2 of type
'wxTreeItemId const *'
I can't duplicate and so don't know what the problem is here.
Post by Moritz Lennert
File "/usr/lib/grass/etc/wx/gism.py", line 359, in addRaster
self.SetTree('raster')
File "/usr/lib/grass/etc/wx/gism.py", line 378, in SetTree
self.maptree.AddLayer(disp_idx, layertype)
File "/usr/lib/grass/etc/wx/Gism/gismutils.py", line 117, in AddLayer
File
"/usr/lib/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/_controls.py",
line 4996, in __ne__
return _controls_.TreeItemId___ne__(*args, **kwargs)
TypeError: in method 'TreeItemId___ne__', expected argument 2 of type
'wxTreeItemId const *'
- I add a vector layer, the d.vect window opens, I select a map, press
run and display it, then within the same d.vect window (which is still
open) I select another map and press run, but nothing happens. This is
not true for other options (color, type, etc).
To change the map, I have to close the d.vect window and double click on
the layer to reopen the d.vect window. Then I can change the map name,
click run and the new map displays.
I've made this a bit easier. The buttons change to cancel/apply/OK for
display command options windows. Simply pressing return (OK) will save the
options and close the window; pressing "apply" will save the options and
leave the window open.


Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton
Michael Barton
2007-11-14 22:56:48 UTC
Permalink
Post by Moritz Lennert
- When double-clicking on an already existing layer to make the
d.vect/d.rast window appear, this window does not contain the map name
of the map that was selected before. I think this should be the case, as
when you just want to modify one option, you don't want to always have
to reselect the map name
This will take some work.
Post by Moritz Lennert
- Flags (such as d.vect -c) do not seem to be taken into account (at
least they don't show in the command line displayed in the output window).
I haven't checked this out yet.
Post by Moritz Lennert
- When using the provided Init.sh to run grass -wx, wxgrass is modal,
i.e. you don't have access to the command line in the terminal window
anymore.
I made the wxgrass script start the GUI non-modally.
Post by Moritz Lennert
Moritz
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University

phone: 480-965-6213
fax: 480-965-7671
www: http://www.public.asu.edu/~cmbarton
Moritz Lennert
2007-11-14 22:56:48 UTC
Permalink
Post by Michael Barton
Post by Moritz Lennert
- When using the provided Init.sh to run grass -wx, wxgrass is modal,
i.e. you don't have access to the command line in the terminal window
anymore.
I made the wxgrass script start the GUI non-modally.
This doesn't work for me:

GRASS 6.3.cvs (BELGIQUE):~ > wxgrass
python: can't open file '/usr/lib/grass/etc/wx/gism.py &': [Errno 2] No
such file or directory

Without the ampersand, I now get the following error when trying to
launch wxgrass:

GRASS 6.3.cvs (BELGIQUE):~ > wxgrass
Traceback (most recent call last):
File "/usr/lib/grass/etc/wx/gism.py", line 445, in ?
app = GMApp(0)
File
"/usr/lib/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/_core.py", line
7757, in __init__
self._BootstrapApp()
File
"/usr/lib/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/_core.py", line
7354, in _BootstrapApp
return _core_.PyApp__BootstrapApp(*args, **kwargs)
File "/usr/lib/grass/etc/wx/gism.py", line 427, in OnInit
mainframe = GMFrame(None, -1, "")
File "/usr/lib/grass/etc/wx/gism.py", line 110, in __init__
self.menubar = self.__createMenuBar()
File "/usr/lib/grass/etc/wx/gism.py", line 166, in __createMenuBar
self.menubar.Append(self.__createMenu(menuItems), menuLabel)
File "/usr/lib/grass/etc/wx/gism.py", line 181, in __createMenu
self.__createMenuItem(menu, *eachItem)
File "/usr/lib/grass/etc/wx/gism.py", line 193, in __createMenuItem
rhandler = eval(handler)
File "<string>", line 0, in ?
AttributeError: 'GMFrame' object has no attribute 'Nomethod'


Moritz
Daniel Calvelo
2007-11-14 22:56:48 UTC
Permalink
Hi Moritz,

As a temporary workaround, revert to revision 239 in svn:

svn update -r 239 gism.py

(in Gism/.., that is gui for me, but could be $GISBASE/etc/wx/)
Post by Moritz Lennert
Without the ampersand, I now get the following error when trying to
[...]
Post by Moritz Lennert
AttributeError: 'GMFrame' object has no attribute 'Nomethod'
Daniel.
--
-- Daniel Calvelo Aros
Moritz Lennert
2007-11-14 22:56:48 UTC
Permalink
Post by Daniel Calvelo
Hi Moritz,
svn update -r 239 gism.py
Yes, thanks, now I can start wxgrass again.

Good news: I can now add several layers !

Bad news: whenever I add a layer I get (for raster this is +/- the same):

GRASS 6.3.cvs (BELGIQUE):~ > Traceback (most recent call last):
File "/usr/lib/grass/etc/wx/gism.py", line 363, in addVector
self.SetTree('vector')
File "/usr/lib/grass/etc/wx/gism.py", line 378, in SetTree
self.maptree.AddLayer(disp_idx, layertype)
File "/usr/lib/grass/etc/wx/Gism/gismutils.py", line 150, in AddLayer
menuform.GUI().parseCommand('d.vect', gmpath,
completed=(self.getOptData,layer), parentframe=self)
File "/usr/lib/grass/etc/wx/Gism/menuform.py", line 535, in parseCommand
xml.sax.parseString(cmdout2, handler)
File "/usr/lib/python2.4/site-packages/_xmlplus/sax/__init__.py",
line 47, in parseString
parser.parse(inpsrc)
File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py",
line 109, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib/python2.4/site-packages/_xmlplus/sax/xmlreader.py",
line 123, in parse
self.feed(buffer)
File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py",
line 216, in feed
self._parser.Parse(data, isFinal)
File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py",
line 395, in external_entity_ref
self._source.getSystemId() or
File "/usr/lib/python2.4/site-packages/_xmlplus/sax/saxutils.py",
line 523, in prepare_input_source
f = urllib2.urlopen(source.getSystemId())
File "/usr/lib/python2.4/urllib2.py", line 130, in urlopen
return _opener.open(url, data)
File "/usr/lib/python2.4/urllib2.py", line 350, in open
protocol = req.get_type()
File "/usr/lib/python2.4/urllib2.py", line 233, in get_type
raise ValueError, "unknown url type: %s" % self.__original
ValueError: unknown url type:
/usr/lib/grass/etc/wx/gism//grass-interface.dtd

Moritz
Daniel Calvelo
2007-11-14 22:56:48 UTC
Permalink
Moritz, that's SAX not finding its DTD file. Try this patch:

--- menuform.py 2007-03-22 04:51:49.000000000 -0500
+++ mff.py 2007-03-22 04:55:08.000000000 -0500
@@ -578,7 +578,7 @@
cmd = cmd + r' --interface-description'
cmdout = os.popen(cmd, "r").read()
p = re.compile( '(grass-interface.dtd)')
- cmdout2 = p.sub( gmpath+r'/grass-interface.dtd', cmdout)
+ cmdout2 = p.sub( gmpath+r'grass-interface.dtd', cmdout)
handler = processTask()
xml.sax.parseString(cmdout2, handler)

Daniel.
Post by Moritz Lennert
Post by Daniel Calvelo
Hi Moritz,
svn update -r 239 gism.py
Yes, thanks, now I can start wxgrass again.
Good news: I can now add several layers !
File "/usr/lib/grass/etc/wx/gism.py", line 363, in addVector
self.SetTree('vector')
File "/usr/lib/grass/etc/wx/gism.py", line 378, in SetTree
self.maptree.AddLayer(disp_idx, layertype)
File "/usr/lib/grass/etc/wx/Gism/gismutils.py", line 150, in AddLayer
menuform.GUI().parseCommand('d.vect', gmpath,
completed=(self.getOptData,layer), parentframe=self)
File "/usr/lib/grass/etc/wx/Gism/menuform.py", line 535, in parseCommand
xml.sax.parseString(cmdout2, handler)
File "/usr/lib/python2.4/site-packages/_xmlplus/sax/__init__.py",
line 47, in parseString
parser.parse(inpsrc)
File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py",
line 109, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib/python2.4/site-packages/_xmlplus/sax/xmlreader.py",
line 123, in parse
self.feed(buffer)
File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py",
line 216, in feed
self._parser.Parse(data, isFinal)
File "/usr/lib/python2.4/site-packages/_xmlplus/sax/expatreader.py",
line 395, in external_entity_ref
self._source.getSystemId() or
File "/usr/lib/python2.4/site-packages/_xmlplus/sax/saxutils.py",
line 523, in prepare_input_source
f = urllib2.urlopen(source.getSystemId())
File "/usr/lib/python2.4/urllib2.py", line 130, in urlopen
return _opener.open(url, data)
File "/usr/lib/python2.4/urllib2.py", line 350, in open
protocol = req.get_type()
File "/usr/lib/python2.4/urllib2.py", line 233, in get_type
raise ValueError, "unknown url type: %s" % self.__original
/usr/lib/grass/etc/wx/gism//grass-interface.dtd
Moritz
--
-- Daniel Calvelo Aros
Moritz Lennert
2007-11-14 22:56:48 UTC
Permalink
Post by Daniel Calvelo
--- menuform.py 2007-03-22 04:51:49.000000000 -0500
+++ mff.py 2007-03-22 04:55:08.000000000 -0500
@@ -578,7 +578,7 @@
cmd = cmd + r' --interface-description'
cmdout = os.popen(cmd, "r").read()
p = re.compile( '(grass-interface.dtd)')
- cmdout2 = p.sub( gmpath+r'/grass-interface.dtd', cmdout)
+ cmdout2 = p.sub( gmpath+r'grass-interface.dtd', cmdout)
handler = processTask()
xml.sax.parseString(cmdout2, handler)
No the problem was the fact that gmpath was hardcoded to /etc/wx/gism
not /etc/wx/Gism on line 20 in gismutils.py.

But now I get the following when trying to add a layer:

Traceback (most recent call last):
File "/usr/lib/grass/etc/wx/gism.py", line 363, in addVector
self.SetTree('vector')
File "/usr/lib/grass/etc/wx/gism.py", line 378, in SetTree
self.maptree.AddLayer(disp_idx, layertype)
File "/usr/lib/grass/etc/wx/Gism/gismutils.py", line 150, in AddLayer
menuform.GUI().parseCommand('d.vect', gmpath,
completed=(self.getOptData,layer), parentframe=self)
File "/usr/lib/grass/etc/wx/Gism/menuform.py", line 537, in parseCommand
mf = mainFrame(self.parent ,-1, self.w, self.h, self.get_dcmd, layer)
File "/usr/lib/grass/etc/wx/Gism/menuform.py", line 342, in __init__
self.btn_apply.Bind(wx.EVT_BUTTON, self.onApply)
AttributeError: 'mainFrame' object has no attribute 'onApply'

Moritz
Daniel Calvelo
2007-11-14 22:56:48 UTC
Permalink
Oooops. My fault:

--- Gism/menuform.py 2007-03-22 05:12:22.000000000 -0500
+++ Gism/mff.py 2007-03-22 05:14:55.000000000 -0500
@@ -380,7 +380,7 @@
self.btn_ok = wx.Button(self.panel, ID_RUN, "OK")
btnsizer.Add(self.btn_ok, 0, wx.ALL| wx.ALIGN_CENTER, 10)
self.btn_ok.SetDefault()
- self.btn_apply.Bind(wx.EVT_BUTTON, self.onApply)
+ self.btn_apply.Bind(wx.EVT_BUTTON, self.OnApply)
self.btn_ok.Bind(wx.EVT_BUTTON, self.OnOK)
else: # We're standalone
self.btn_run = wx.Button(self.panel, ID_RUN, "Run")

D.
Post by Moritz Lennert
Post by Daniel Calvelo
--- menuform.py 2007-03-22 04:51:49.000000000 -0500
+++ mff.py 2007-03-22 04:55:08.000000000 -0500
@@ -578,7 +578,7 @@
cmd = cmd + r' --interface-description'
cmdout = os.popen(cmd, "r").read()
p = re.compile( '(grass-interface.dtd)')
- cmdout2 = p.sub( gmpath+r'/grass-interface.dtd', cmdout)
+ cmdout2 = p.sub( gmpath+r'grass-interface.dtd', cmdout)
handler = processTask()
xml.sax.parseString(cmdout2, handler)
No the problem was the fact that gmpath was hardcoded to /etc/wx/gism
not /etc/wx/Gism on line 20 in gismutils.py.
File "/usr/lib/grass/etc/wx/gism.py", line 363, in addVector
self.SetTree('vector')
File "/usr/lib/grass/etc/wx/gism.py", line 378, in SetTree
self.maptree.AddLayer(disp_idx, layertype)
File "/usr/lib/grass/etc/wx/Gism/gismutils.py", line 150, in AddLayer
menuform.GUI().parseCommand('d.vect', gmpath,
completed=(self.getOptData,layer), parentframe=self)
File "/usr/lib/grass/etc/wx/Gism/menuform.py", line 537, in parseCommand
mf = mainFrame(self.parent ,-1, self.w, self.h, self.get_dcmd, layer)
File "/usr/lib/grass/etc/wx/Gism/menuform.py", line 342, in __init__
self.btn_apply.Bind(wx.EVT_BUTTON, self.onApply)
AttributeError: 'mainFrame' object has no attribute 'onApply'
Moritz
--
-- Daniel Calvelo Aros
Loading...