AttributeError: 'gtk.Window' object has no attribute 'get_window_type'
not actually in the position to be able to update pygtk, I get the following
when launching the client:
richard@x3200:~/src/tryton$ bin/tryton
ERROR:common.message: File "bin/tryton", line 60, in <module>
tryton.client.TrytonClient().run()
File "/home/richard/src/tryton/tryton/client.py", line 118, in run
main.sig_login()
File "/home/richard/src/tryton/tryton/gui/main.py", line 911, in sig_login
res = DBLogin().run()
File "/home/richard/src/tryton/tryton/gui/window/dblogin.py", line 372, in
__init__
self.parent = common.get_toplevel_window()
File "/home/richard/src/tryton/tryton/common/common.py", line 295, in
get_toplevel_window
and x.get_window_type() == gtk.WINDOW_TOPLEVEL]
'gtk.Window' object has no attribute 'get_window_type'
Error in sys.excepthook:
Traceback (most recent call last):
File "/home/richard/src/tryton/tryton/client.py", line 112, in excepthook
common.process_exception(exception, tb=tb)
File "/home/richard/src/tryton/tryton/common/common.py", line 1084, in
process_exception
error(error_title, error_detail)
File "/home/richard/src/tryton/tryton/common/common.py", line 870, in __call__
response = super(ErrorDialog, self).__call__(title, details)
File "/home/richard/src/tryton/tryton/common/common.py", line 558, in __call__
parent = get_toplevel_window()
File "/home/richard/src/tryton/tryton/common/common.py", line 295, in
get_toplevel_window
and x.get_window_type() == gtk.WINDOW_TOPLEVEL]
AttributeError: 'gtk.Window' object has no attribute 'get_window_type'
Original exception was:
Traceback (most recent call last):
File "bin/tryton", line 60, in <module>
tryton.client.TrytonClient().run()
File "/home/richard/src/tryton/tryton/client.py", line 118, in run
main.sig_login()
File "/home/richard/src/tryton/tryton/gui/main.py", line 911, in sig_login
res = DBLogin().run()
File "/home/richard/src/tryton/tryton/gui/window/dblogin.py", line 372, in
__init__
self.parent = common.get_toplevel_window()
File "/home/richard/src/tryton/tryton/common/common.py", line 295, in
get_toplevel_window
and x.get_window_type() == gtk.WINDOW_TOPLEVEL]
AttributeError: 'gtk.Window' object has no attribute 'get_window_type'
from
http://www.pygtk.org/docs/pygtk/class-gtkwindow.html#method-gtkwindow--get-window-type:
"This method is available in PyGTK 2.22 and above."
So I tried the following as a quick workaround:
richard@x3200:~/src/tryton$ hg diff
diff -r b2cc6f966070 tryton/common/common.py
--- a/tryton/common/common.py Mon Jul 30 23:34:31 2012 +0200
+++ b/tryton/common/common.py Wed Aug 08 14:18:16 2012 +0200
@@ -291,8 +291,8 @@
def get_toplevel_window():
windows = [x for x in gtk.window_list_toplevels()
- if x.window and x.props.visible
- and x.get_window_type() == gtk.WINDOW_TOPLEVEL]
+ if x.window and x.props.visible]
+# and x.get_window_type() == gtk.WINDOW_TOPLEVEL]
trans2windows = dict((x.get_transient_for(), x) for x in windows)
for window in set(windows) - set(trans2windows.iterkeys()):
return window
Perhaps a check could be made to see if the new version is installed or that the
feature is supported could be made in trunk (that is, if this is the only depency)
Files
Download | Creator | Timestamp | Type |
---|---|---|---|
gmane.comp.python.tryton.devel: Authorization required.eml | @risto42 | 2012-09-06 12:20:19.780000 UTC | message/rfc822 |
Richard_PALO.vcf | @risto42 | 2012-09-06 12:20:19.823000 UTC | text/x-vcard |