testing wxgrass

6 messages Options
Embed this post
Permalink
Moritz Lennert

testing wxgrass

Reply Threaded More More options
Print post
Permalink
Hi,

here are some remarks on wxgrass (rev. 338):

- Beautiful !

- Trying to start grass63 -wx without an existing .grassrc6 file, I
cannot choose a GISDBASE directory:

Traceback (most recent call last):
   File "/usr/lib/grass/etc/wx/gis_set.py", line 652, in OnBrowse
     grassdata = dlg.GetDirectory()
AttributeError: 'DirDialog' object has no attribute 'GetDirectory'

If I create a .grassrc6 file with only GISDBASE set, grass starts.


- Creating a new mapset only creates an empty mapset directory, without
WIND file.

- Using a freashly downloaded spearfish60 dataset, and setting my
.grassrc6 as follows, I get the following error message, the startup
screen (where one choses the location and mapset) is skipped, and grass
opens directly in the spearfish60 location and user1 mapset:

GISDBASE: /home/mlennert/GRASS/DATA
GRASS_GUI: wx
LOCATION_NAME: spearfish60
MAPSET: user1


Traceback (most recent call last):
   File "/usr/lib/grass/etc/wx/gis_set.py", line 728, in ?
     GRASSStartUp = StartUp(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/gis_set.py", line 719, in OnInit
     StartUp = GRASSStartup(None, -1, "")
   File "/usr/lib/grass/etc/wx/gis_set.py", line 462, in __init__
     self.__set_properties()
   File "/usr/lib/grass/etc/wx/gis_set.py", line 508, in __set_properties
     self.lbmapsets.SetSelection(self.listOfMapsets.index(mapset))
ValueError: list.index(x): x not in list

- When I set MAPSET back to PERMANENT in the .grassrc6 file, startup
works as expected, with the exception of the fact that spearfish60 being
selected by default (as expected) the list of available mapsets shows
'PERMANENT' and 'mlennert' even though there is no 'mlennert' directory
  in the spearfish60 location. When I click on another location and then
back on spearfish60, I see the correct PERMANENT and user1...
The same happens for locations where I tried to create a new mapset. At
first I only see the mapset that existed before. Only when I click on
another location and then back, I see the newly created (though not
correct) mapsets.

- When I add a raster or vector file, I get:

Traceback (most recent call last):
   File "/usr/lib/grass/etc/wx/gui_modules/wxgui_utils.py", line 311, in
onExpandNode
     if self.layertype[self.layer_selected] == 'group':
KeyError: <wx._controls.TreeItemId; proxy of <Swig Object of type
'wxTreeItemId *' at 0x8899f18> >

but I do get the layer options (d.rast/d.vect) dialog and can display a map.


- Contrary to what I said before, I still have a problem displaying
several layers. I can add a first layer, but when I try to add a second
layer, I get the following error message, the second layer is unusable
(only transparency field visible, see attached image), and I cannot
erase it either:

Traceback (most recent call last):
   File "/usr/lib/grass/etc/wx/wxgui.py", line 460, in addVector
     self.SetTree('vector')
   File "/usr/lib/grass/etc/wx/wxgui.py", line 487, in SetTree
     self.maptree.AddLayer(disp_idx, layertype)
   File "/usr/lib/grass/etc/wx/gui_modules/wxgui_utils.py", line 151, in
AddLayer    if (self.layer_selected and self.layer_selected !=
self.GetRootItem() and
   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 *'

- How do I chose 'none' as a color ?

- In the d.vect window, shouldn't the flags concerning colors, (-a and
-c) be on the colors tab ?

Moritz


_______________________________________________
grassgui mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/grassgui

wxgrass_second_layer_bug.png (21K) Download Attachment
Michael Barton

Re: testing wxgrass

Reply Threaded More More options
Print post
Permalink
Moritz,

Thanks very much for the testing. I'm only responding to a couple of items
since I'm going to try to go into my office today.


On 3/27/07 5:16 AM, "Moritz Lennert" <[hidden email]> wrote:

> - When I add a raster or vector file, I get:
>
> Traceback (most recent call last):
>    File "/usr/lib/grass/etc/wx/gui_modules/wxgui_utils.py", line 311, in
> onExpandNode
>      if self.layertype[self.layer_selected] == 'group':
> KeyError: <wx._controls.TreeItemId; proxy of <Swig Object of type
> 'wxTreeItemId *' at 0x8899f18> >
>
> but I do get the layer options (d.rast/d.vect) dialog and can display a map.
>
>
> - Contrary to what I said before, I still have a problem displaying
> several layers. I can add a first layer, but when I try to add a second
> layer, I get the following error message, the second layer is unusable
> (only transparency field visible, see attached image), and I cannot
> erase it either:
>
> Traceback (most recent call last):
>    File "/usr/lib/grass/etc/wx/wxgui.py", line 460, in addVector
>      self.SetTree('vector')
>    File "/usr/lib/grass/etc/wx/wxgui.py", line 487, in SetTree
>      self.maptree.AddLayer(disp_idx, layertype)
>    File "/usr/lib/grass/etc/wx/gui_modules/wxgui_utils.py", line 151, in
> AddLayer    if (self.layer_selected and self.layer_selected !=
> self.GetRootItem() and
>    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 *'

These seem to be failing where an if clause breaks across 2 lines. As per
normal Python syntax, this clause is enclosed in parentheses and shouldn't
need a backslash. But your system is not reading it correctly. I've added
the backslash at the line break (redundant but no harm done on my system at
least). Try it now and see if it clears things up.

>
> - How do I chose 'none' as a color ?
>
> - In the d.vect window, shouldn't the flags concerning colors, (-a and
> -c) be on the colors tab ?

This is determined by the guisections setting in the d.vect code. It can be
switched there.

Michael

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


_______________________________________________
grassgui mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/grassgui
Michael Barton

Re: testing wxgrass

Reply Threaded More More options
Print post
Permalink
In reply to this post by Moritz Lennert
I just fixed this and committed it to the svn. But we may need to add a line
to set permissions (I just copied the PERMANENT/WIND permissions with the
file because I don't understand how to use os.chmod yet).

Michael


On 3/27/07 5:16 AM, "Moritz Lennert" <[hidden email]> wrote:

>
>
> - Creating a new mapset only creates an empty mapset directory, without
> WIND file.
>

__________________________________________
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


_______________________________________________
grassgui mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/grassgui
Moritz Lennert

Re: testing wxgrass

Reply Threaded More More options
Print post
Permalink
In reply to this post by Michael Barton
On 27/03/07 16:32, Michael Barton wrote:

>>
>> - Contrary to what I said before, I still have a problem displaying
>> several layers. I can add a first layer, but when I try to add a second
>> layer, I get the following error message, the second layer is unusable
>> (only transparency field visible, see attached image), and I cannot
>> erase it either:
>>
>> Traceback (most recent call last):
>>    File "/usr/lib/grass/etc/wx/wxgui.py", line 460, in addVector
>>      self.SetTree('vector')
>>    File "/usr/lib/grass/etc/wx/wxgui.py", line 487, in SetTree
>>      self.maptree.AddLayer(disp_idx, layertype)
>>    File "/usr/lib/grass/etc/wx/gui_modules/wxgui_utils.py", line 151, in
>> AddLayer    if (self.layer_selected and self.layer_selected !=
>> self.GetRootItem() and
>>    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 *'
>
> These seem to be failing where an if clause breaks across 2 lines. As per
> normal Python syntax, this clause is enclosed in parentheses and shouldn't
> need a backslash. But your system is not reading it correctly. I've added
> the backslash at the line break (redundant but no harm done on my system at
> least). Try it now and see if it clears things up.

Nope, that's apparently not the problem. I tried by just removing the
newline between the two lines, and I still get:

Traceback (most recent call last):
   File "/usr/lib/grass/etc/wx/wxgui.py", line 444, in addRaster
     self.SetTree('raster')
   File "/usr/lib/grass/etc/wx/wxgui.py", line 487, in SetTree
     self.maptree.AddLayer(disp_idx, layertype)
   File "/usr/lib/grass/etc/wx/gui_modules/wxgui_utils.py", line 151, in
AddLayer    if (self.layer_selected and self.layer_selected !=
self.GetRootItem() and self.layertype[self.layer_selected] != 'group'):
   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 *'

Sounds more like a wrong data type being sent to a method...

Moritz

_______________________________________________
grassgui mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/grassgui
William Kyngesburye

Re: testing wxgrass

Reply Threaded More More options
Print post
Permalink
In reply to this post by Michael Barton
I used os.chmod in my old python app wrapper for OSX.  Pretty simple,  
but I think the file/folder needs to exist (I must have got errors  
when I did this):

import os
if os.path.exists('/path/to/file-or-folder') :
     os.chmod('/path/to/file-or-folder', 0775)

The mode can be a unix-style bit pattern on unix systems, or a  
simpler set of os. constants on other platforms (basic r/w/x, no  
owner/group/all).  But it looks like it converts unix modes to the  
simpler modes for you if it's used on one of those systems.

On Mar 27, 2007, at 10:58 AM, Michael Barton wrote:

> I just fixed this and committed it to the svn. But we may need to  
> add a line
> to set permissions (I just copied the PERMANENT/WIND permissions  
> with the
> file because I don't understand how to use os.chmod yet).
>

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"Time is an illusion - lunchtime doubly so."

- Ford Prefect


_______________________________________________
grassgui mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/grassgui
Moritz Lennert

Re: testing wxgrass

Reply Threaded More More options
Print post
Permalink
In reply to this post by Michael Barton
On 27/03/07 17:58, Michael Barton wrote:
> I just fixed this and committed it to the svn. But we may need to add a line
> to set permissions (I just copied the PERMANENT/WIND permissions with the
> file because I don't understand how to use os.chmod yet).

Now the WIND file gets created (exactly identical to the PERMANENT
file), but when my .grassrc6 contains the name of this new mapset I also
get (as I do for the user1 mapset in spearfish60):

Traceback (most recent call last):
   File "/usr/lib/grass/etc/wx/gis_set.py", line 731, in ?
     GRASSStartUp = StartUp(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/gis_set.py", line 722, in OnInit
     StartUp = GRASSStartup(None, -1, "")
   File "/usr/lib/grass/etc/wx/gis_set.py", line 462, in __init__
     self.__set_properties()
   File "/usr/lib/grass/etc/wx/gis_set.py", line 508, in __set_properties
     self.lbmapsets.SetSelection(self.listOfMapsets.index(mapset))
ValueError: list.index(x): x not in list

Moritz

_______________________________________________
grassgui mailing list
[hidden email]
http://grass.itc.it/mailman/listinfo/grassgui