[GRASS-dev] [GRASS GIS] #1085: grass64 svn:42488; TypeError: __init__() got an unexpected keyword argument 'ctstyle'

#1085: grass64 svn:42488; TypeError: __init__() got an unexpected keyword argument
'ctstyle'
----------------------+-----------------------------------------------------
Reporter: zarch | Owner: grass-dev@lists.osgeo.org
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.0
Component: Python | Version: svn-releasebranch64
Keywords: wxpython | Platform: Linux
      Cpu: x86-64 |
----------------------+-----------------------------------------------------
I'm running grass6.4 from svn 42488, I'm on Linux 64bit with python 2.6.5
and wxpython 2.8.11.0-1 If I start grass I reach this error:

{{{
           __________ _ __________ _______________
          / ____/ __ \/ | / ___/ ___/ / ____/ _/ ___/
         / / __/ _ / /| | \__ \\_ \ / / __ / / \__ \
        / _ / _, _/ _ |___/ __ / / _ // / ___/ /
        \____/_/ |_/_/ |_/____/____/ \____/___//____/

Welcome to GRASS 6.4.0svn (2010)
GRASS homepage: http://grass.osgeo.org/
This version running thru: Bash Shell (/bin/bash)
Help is available with the command: g.manual -i
See the licence terms with: g.version -c
If required, restart the GUI with: g.gui wxpython
When ready to quit enter: exit

WARNING: Vector digitizer is not available (No module named
grass6_wxvdigit).

Note that the vector digitizer is currently not working under MS Windows
(hopefully this will be fixed soon).
Please keep an eye out for updated versions of GRASS.
GRASS 6.4.0svn (trentinGBrm40):~/builds/grass-svn > Traceback (most recent
call
last):
   File "/opt/grass-42488/etc/wxpython/wxgui.py", line 1818, in <module>
     sys.exit(main())
   File "/opt/grass-42488/etc/wxpython/wxgui.py", line 1811, in main
     app = GMApp(workspaceFile)
   File "/opt/grass-42488/etc/wxpython/wxgui.py", line 1736, in __init__
     wx.App.__init__(self, False)
   File "/usr/lib/python2.6/site-packages/wx-2.8-gtk2-unicode/wx/_core.py",
line
7978, in __init__
     self._BootstrapApp()
   File "/usr/lib/python2.6/site-packages/wx-2.8-gtk2-unicode/wx/_core.py",
line
7552, in _BootstrapApp
     return _core_.PyApp__BootstrapApp(*args, **kwargs)
   File "/opt/grass-42488/etc/wxpython/wxgui.py", line 1754, in OnInit
     workspace = self.workspaceFile)
   File "/opt/grass-42488/etc/wxpython/wxgui.py", line 185, in __init__
     self.NewDisplay(show=False)
   File "/opt/grass-42488/etc/wxpython/wxgui.py", line 1235, in NewDisplay
     auimgr=self._auimgr, showMapDisplay=show)
   File "/opt/grass-42488/etc/wxpython/gui_modules/wxgui_utils.py", line
73, in
__init__
     super(LayerTree, self).__init__(parent, id, pos, size, style=style,
ctstyle=ctstyle)
   File "/usr/lib/python2.6/site-packages/wx-2.8-gtk2-
unicode/wx/lib/mixins/treemixin.py", line 488, in __init__
     super(DragAndDrop, self).__init__(*args, **kwargs)
TypeError: __init__() got an unexpected keyword argument 'ctstyle'

}}}

Since 22-March-2007 with wxpython 2.8.3.0 seems that ctstyle has been
replaced by style ([http://www.wxpython.org/recentchanges.php\] )[[BR]]

"ctstyle keyword is now defaulted to 0: every style related to
CustomTreeCtrl and the underlying wx.PyScrolledWindow should be declared
using the keyword "style" only. For backward compatibility, ctstyle
continues to work as I merged ctstyle and style in the __init__
method."[[BR]]

It seems that with wxpython 2.8.11 there is not more backward
compatibility (at least on my system!). :frowning:

Do you know how to solve? Which version of wxpython are you using?

I try to modify the class LayerTree like this:

{{{
class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
     """
     Creates layer tree structure
     """
     def __init__(self, parent,
                  id=wx.ID_ANY, pos=wx.DefaultPosition,
                  size=wx.DefaultSize,
                  style=wx.SUNKEN_BORDER | CT.TR_HAS_BUTTONS |
CT.TR_HAS_VARIABLE_ROW_HEIGHT |
                  CT.TR_HIDE_ROOT | CT.TR_ROW_LINES |
CT.TR_FULL_ROW_HIGHLIGHT |
                  CT.TR_MULTIPLE,
                  **kargs):
         self.items =
         self.itemCounter = 0
         super(LayerTree, self).__init__(parent, id, pos, size,
style=style)
         self.SetName("LayerTree")
}}}

Now the GUI it's starting but if I try to load a map I reach this error on
the command output:

{{{
Traceback (most recent call last):
   File "/opt/grass-42488/etc/wxpython/wxgui.py", line 1268,
in OnAddRaster

self.AddRaster(event)
   File "/opt/grass-42488/etc/wxpython/wxgui.py", line 1393,
in AddRaster

self.curr_page.maptree.AddLayer('raster')
   File
"/opt/grass-42488/etc/wxpython/gui_modules/wxgui_utils.py",
line 676, in AddLayer

layer = self.PrependItem(parent=self.root, text='',
ct_type=1, wnd=ctrl)
   File "/usr/lib/python2.6/site-
packages/wx-2.8-gtk2-unicode/wx/lib/agw/customtreectrl.py",
line 4065, in PrependItem

return self.DoInsertItem(parent, 0, text, ct_type, wnd,
image, selImage, data)
   File "/usr/lib/python2.6/site-
packages/wx-2.8-gtk2-unicode/wx/lib/agw/customtreectrl.py",
line 3966, in DoInsertItem

raise Exception("\nERROR: In Order To Append/Insert Controls
You Have To Use The Style TR_HAS_VARIABLE_ROW_HEIGHT")
Exception
:
ERROR: In Order To Append/Insert Controls You Have To Use
The Style TR_HAS_VARIABLE_ROW_HEIGHT
}}}

I'm new in wx, and I don't now how should be fix.

Thank you, for your great work!

Pietro

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1085&gt;
GRASS GIS <http://grass.osgeo.org>

#1085: grass64 svn:42488; TypeError: __init__() got an unexpected keyword argument
'ctstyle'
---------------------+------------------------------------------------------
  Reporter: zarch | Owner: grass-dev@lists.osgeo.org
      Type: defect | Status: new
  Priority: normal | Milestone: 6.4.0
Component: Python | Version: svn-releasebranch64
Resolution: | Keywords: wxpython
  Platform: Linux | Cpu: x86-64
---------------------+------------------------------------------------------
Comment (by glynn):

See also:

http://lists.osgeo.org/pipermail/grass-dev/2010-June/050766.html

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1085#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#1085: grass64 svn:42488; TypeError: __init__() got an unexpected keyword argument
'ctstyle'
----------------------+-----------------------------------------------------
  Reporter: zarch | Owner: martinl
      Type: defect | Status: assigned
  Priority: blocker | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Resolution: | Keywords:
  Platform: Linux | Cpu: x86-64
----------------------+-----------------------------------------------------
Changes (by martinl):

  * status: new => assigned
* cc: grass-dev@lists.osgeo.org (added)
  * component: Python => wxGUI
  * priority: normal => blocker
  * owner: grass-dev@lists.osgeo.org => martinl
  * keywords: wxpython =>

Comment:

Hopefully fixed in r42520 (GRASS 7.0) and r42522 (GRASS 6.5). Not yet
backported to GRASS 6.4. Testing welcomed. Martin

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1085#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#1085: grass64 svn:42488; TypeError: __init__() got an unexpected keyword argument
'ctstyle'
---------------------+------------------------------------------------------
Reporter: zarch | Owner: martinl
     Type: defect | Status: assigned
Priority: blocker | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Keywords: | Platform: Linux
      Cpu: x86-64 |
---------------------+------------------------------------------------------

Comment(by martinl):

Replying to [comment:2 martinl]:
> Hopefully fixed in r42520 (GRASS 7.0) and r42522 (GRASS 6.5). Not yet
backported to GRASS 6.4. Testing welcomed. Martin

Patch for GRASS 6.4 applied in r42548.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1085#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#1085: grass64 svn:42488; TypeError: __init__() got an unexpected keyword argument
'ctstyle'
---------------------+------------------------------------------------------
Reporter: zarch | Owner: martinl
     Type: defect | Status: assigned
Priority: blocker | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Keywords: | Platform: Linux
      Cpu: x86-64 |
---------------------+------------------------------------------------------

Comment(by martinl):

Replying to [comment:3 martinl]:
> Replying to [comment:2 martinl]:
> > Hopefully fixed in r42520 (GRASS 7.0) and r42522 (GRASS 6.5). Not yet
backported to GRASS 6.4. Testing welcomed. Martin
>
> Patch for GRASS 6.4 applied in r42548.

There are more problems related to wxPython 2.8.11 - hopefully fixed in
r42549 (7.0), backported as r42550 (6.5) and r42551 (6.4).

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1085#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#1085: grass64 svn:42488; TypeError: __init__() got an unexpected keyword argument
'ctstyle'
---------------------+------------------------------------------------------
Reporter: zarch | Owner: martinl
     Type: defect | Status: assigned
Priority: blocker | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Keywords: | Platform: Linux
      Cpu: x86-64 |
---------------------+------------------------------------------------------

Comment(by martinl):

Replying to [comment:4 martinl]:
> Replying to [comment:3 martinl]:
> > Replying to [comment:2 martinl]:
> > > Hopefully fixed in r42520 (GRASS 7.0) and r42522 (GRASS 6.5). Not
yet backported to GRASS 6.4. Testing welcomed. Martin
> >
> > Patch for GRASS 6.4 applied in r42548.
>
> There are more problems related to wxPython 2.8.11 - hopefully fixed in
r42549 (7.0), backported as r42550 (6.5) and r42551 (6.4).

Not really, awgStyle (style is not working) is used in wxPython 2.8.11+,
fixed in r42554.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1085#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#1085: grass64 svn:42488; TypeError: __init__() got an unexpected keyword argument
'ctstyle'
---------------------+------------------------------------------------------
Reporter: zarch | Owner: martinl
     Type: defect | Status: assigned
Priority: blocker | Milestone: 7.0.0
Component: wxGUI | Version: svn-releasebranch64
Keywords: | Platform: Linux
      Cpu: x86-64 |
---------------------+------------------------------------------------------
Changes (by cmbarton):

  * milestone: 6.4.0 => 7.0.0

Comment:

Got back yesterday and just now updated trunk from the SVN and compiled.
Still the issue with having to compile wxgui separately. But all compiled
OK. wxNVIZ loads and runs on my Mac. There are problems displaying (using
a map as color only shows up some of the terrain in a faint yellow). The
rest is white. But there are no initial errors. The interface changes are
an improvement. More compact and logically laid out. Trying out various
display controls eventually gets to the following error:

Settings: unable to get value 'nviz:settings:['light',
'color']'

Then nothing displays. Seems like autorendering is not working either. But
it's a nice improvement so far.

Michael

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1085#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#1085: grass64 svn:42488; TypeError: __init__() got an unexpected keyword argument
'ctstyle'
---------------------+------------------------------------------------------
Reporter: zarch | Owner: martinl
     Type: defect | Status: assigned
Priority: blocker | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Keywords: | Platform: Linux
      Cpu: x86-64 |
---------------------+------------------------------------------------------
Changes (by cmbarton):

  * milestone: 7.0.0 => 6.4.0

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1085#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>

#1085: grass64 svn:42488; TypeError: __init__() got an unexpected keyword argument
'ctstyle'
---------------------+------------------------------------------------------
Reporter: zarch | Owner: martinl
     Type: defect | Status: assigned
Priority: blocker | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Keywords: | Platform: Linux
      Cpu: x86-64 |
---------------------+------------------------------------------------------

Comment(by martinl):

Replying to [comment:6 cmbarton]:
> Got back yesterday and just now updated trunk from the SVN and compiled.
Still the issue with having to compile wxgui separately. But all compiled
OK. wxNVIZ loads and runs on my Mac. There are problems displaying (using
a map as color only shows up some of the terrain in a faint yellow). The
rest is white. But there are no initial errors. The interface changes are
an improvement. More compact and logically laid out. Trying out various
display controls eventually gets to the following error:
>
> Settings: unable to get value 'nviz:settings:['light',
> 'color']'
>
> Then nothing displays. Seems like autorendering is not working either.
But it's a nice improvement so far.

It's seems to me that you are responding to another ticket...

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1085#comment:8&gt;
GRASS GIS <http://grass.osgeo.org>

#1085: grass64 svn:42488; TypeError: __init__() got an unexpected keyword argument
'ctstyle'
---------------------+------------------------------------------------------
Reporter: zarch | Owner: martinl
     Type: defect | Status: assigned
Priority: blocker | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Keywords: | Platform: Linux
      Cpu: x86-64 |
---------------------+------------------------------------------------------

Comment(by cmbarton):

Sorry. Which one is about not being able to start wxNVIZ? You wanted us to
test.

Michael

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1085#comment:9&gt;
GRASS GIS <http://grass.osgeo.org>

#1085: grass64 svn:42488; TypeError: __init__() got an unexpected keyword argument
'ctstyle'
----------------------+-----------------------------------------------------
  Reporter: zarch | Owner: martinl
      Type: defect | Status: closed
  Priority: blocker | Milestone: 6.4.0
Component: wxGUI | Version: svn-releasebranch64
Resolution: fixed | Keywords:
  Platform: Linux | Cpu: x86-64
----------------------+-----------------------------------------------------
Changes (by martinl):

  * status: assigned => closed
  * resolution: => fixed

Comment:

Replying to [comment:5 martinl]:
> > There are more problems related to wxPython 2.8.11 - hopefully fixed
in r42549 (7.0), backported as r42550 (6.5) and r42551 (6.4).
>
> Not really, awgStyle (style is not working) is used in wxPython 2.8.11+,
fixed in r42554.

Fell free to reopen, if needed. Closing ticket for now as fixed.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1085#comment:10&gt;
GRASS GIS <http://grass.osgeo.org>