[GRASS-dev] wxgrass prototype

Michael Barton michael.barton at asu.edu
Wed Mar 21 10:40:17 EDT 2007


Thanks for the comments Moritz. Some responses below.


On 3/21/07 7:04 AM, "Moritz Lennert" <mlennert at club.worldonline.be> wrote:

> On 21/03/07 00:30, Michael Barton wrote:
>> 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 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.

> 
> - 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)

Right now, all actions are very 'noisy', producing lots of messages in the
terminal

> 
> - 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'

I'll have to try and see what's up with this.

> 
> - 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'
> 

These should be fixable with better error-trapping in select.Select.

> 
> 
>   - 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=g at mlennert>

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.

> 
> - 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 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.

> 
> - 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






More information about the grass-dev mailing list