mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-07 17:08:42 +00:00
Fix compatibility for Python2.5 and Debian Lenny
Recent commit to handle warnings were >=Py2.6 and glib binding is unavailable on Debian Lenny.
This commit is contained in:
parent
b396b11611
commit
74181469bc
2 changed files with 14 additions and 7 deletions
|
@ -37,7 +37,6 @@
|
||||||
import os
|
import os
|
||||||
import gtk
|
import gtk
|
||||||
import logging
|
import logging
|
||||||
import glib
|
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
import deluge.component as component
|
import deluge.component as component
|
||||||
|
@ -262,9 +261,12 @@ class FilterTreeView(component.Component):
|
||||||
count = model.get_value(row, 3)
|
count = model.get_value(row, 3)
|
||||||
|
|
||||||
#Supress Warning: g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed
|
#Supress Warning: g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed
|
||||||
with warnings.catch_warnings():
|
original_filters = warnings.filters[:]
|
||||||
warnings.simplefilter("ignore")
|
warnings.simplefilter("ignore")
|
||||||
|
try:
|
||||||
pix = model.get_value(row, 4)
|
pix = model.get_value(row, 4)
|
||||||
|
finally:
|
||||||
|
warnings.filters = original_filters
|
||||||
|
|
||||||
if pix:
|
if pix:
|
||||||
self.renderpix.set_property("visible", True)
|
self.renderpix.set_property("visible", True)
|
||||||
|
@ -292,7 +294,7 @@ class FilterTreeView(component.Component):
|
||||||
if pix:
|
if pix:
|
||||||
try:
|
try:
|
||||||
return gtk.gdk.pixbuf_new_from_file(deluge.common.get_pixmap("%s16.png" % pix))
|
return gtk.gdk.pixbuf_new_from_file(deluge.common.get_pixmap("%s16.png" % pix))
|
||||||
except glib.GError as e:
|
except Exception, e:
|
||||||
log.warning(e)
|
log.warning(e)
|
||||||
return self.get_transparent_pix(16, 16)
|
return self.get_transparent_pix(16, 16)
|
||||||
|
|
||||||
|
|
|
@ -78,11 +78,16 @@ def cell_data_statusicon(column, cell, model, row, data):
|
||||||
"""Display text with an icon"""
|
"""Display text with an icon"""
|
||||||
try:
|
try:
|
||||||
icon = ICON_STATE[model.get_value(row, data)]
|
icon = ICON_STATE[model.get_value(row, data)]
|
||||||
#Suppress Warning: g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed
|
|
||||||
with warnings.catch_warnings():
|
#Supress Warning: g_object_set_qdata: assertion `G_IS_OBJECT (object)' failed
|
||||||
|
original_filters = warnings.filters[:]
|
||||||
warnings.simplefilter("ignore")
|
warnings.simplefilter("ignore")
|
||||||
|
try:
|
||||||
if cell.get_property("pixbuf") != icon:
|
if cell.get_property("pixbuf") != icon:
|
||||||
cell.set_property("pixbuf", icon)
|
cell.set_property("pixbuf", icon)
|
||||||
|
finally:
|
||||||
|
warnings.filters = original_filters
|
||||||
|
|
||||||
except KeyError:
|
except KeyError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue