Opened 9 years ago

Closed 9 years ago

#1085 closed defect (fixed)

grass64 svn:42488; TypeError: __init__() got an unexpected keyword argument 'ctstyle'

Reported by: zarch Owned by: martinl
Priority: blocker Milestone: 6.4.0
Component: wxGUI Version: svn-releasebranch64
Keywords: Cc: grass-dev@…
CPU: x86-64 Platform: Linux

Description

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 )

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

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

Attachments (1)

ctstyle.diff (741 bytes) - added by martinl 9 years ago.
patch for grass64

Download all attachments as: .zip

Change History (11)

comment:2 Changed 9 years ago by martinl

Cc: grass-dev@… added
Component: PythonwxGUI
Keywords: wxpython removed
Owner: changed from grass-dev@… to martinl
Priority: normalblocker
Status: newassigned

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

Changed 9 years ago by martinl

Attachment: ctstyle.diff added

patch for grass64

comment:3 in reply to:  2 ; Changed 9 years ago by martinl

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

comment:4 in reply to:  3 ; Changed 9 years ago by martinl

Replying to martinl:

Replying to 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).

comment:5 in reply to:  4 ; Changed 9 years ago by martinl

Replying to martinl:

Replying to martinl:

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

comment:6 Changed 9 years ago by cmbarton

Milestone: 6.4.07.0.0

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

comment:7 Changed 9 years ago by cmbarton

Milestone: 7.0.06.4.0

comment:8 in reply to:  6 Changed 9 years ago by martinl

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

comment:9 Changed 9 years ago by cmbarton

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

Michael

comment:10 in reply to:  5 Changed 9 years ago by martinl

Resolution: fixed
Status: assignedclosed

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

Note: See TracTickets for help on using tickets.