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

GRASS GIS trac at osgeo.org
Tue Jun 8 06:34:12 EDT 2010


#1085: grass64 svn:42488; TypeError: __init__() got an unexpected keyword argument
'ctstyle'
----------------------+-----------------------------------------------------
 Reporter:  zarch     |       Owner:  grass-dev at 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!). :-(

 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>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list