[accerciser] Fix for bug #675989 - Use python object attributes instead of gobject ones
- From: Javier HernÃndez AntÃnez <jhernandez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [accerciser] Fix for bug #675989 - Use python object attributes instead of gobject ones
- Date: Sun, 13 May 2012 21:58:51 +0000 (UTC)
commit 036689e70304a9e98ce31238dfad2432ad4c78ea
Author: Javier HernÃndez <jhernandez emergya com>
Date: Sun May 13 23:58:09 2012 +0200
Fix for bug #675989 - Use python object attributes instead of gobject ones
plugins/event_monitor.py | 10 +++++-----
plugins/interface_view.py | 4 ++--
src/lib/accerciser/main_window.py | 8 ++++----
3 files changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/plugins/event_monitor.py b/plugins/event_monitor.py
index 16ca1ff..73e071b 100644
--- a/plugins/event_monitor.py
+++ b/plugins/event_monitor.py
@@ -366,8 +366,8 @@ class EventMonitor(ViewportPlugin):
foreground='blue',
underline=Pango.Underline.SINGLE)
hyperlink.connect('event', self._onLinkClicked)
- hyperlink.set_data('acc', acc)
- hyperlink.set_data('islink', True)
+ setattr(hyperlink, 'acc', acc)
+ setattr(hyperlink, 'islink', True)
return hyperlink
def _onLinkClicked(self, tag, widget, event, iter):
@@ -385,7 +385,7 @@ class EventMonitor(ViewportPlugin):
'''
if event.type == gdk.EventType.BUTTON_RELEASE and \
event.button == 1 and not self.monitor_buffer.get_has_selection():
- self.node.update(tag.get_data('acc'))
+ self.node.update(getattr(tag, 'acc'))
def _onLinkKeyPress(self, textview, event):
'''
@@ -404,7 +404,7 @@ class EventMonitor(ViewportPlugin):
iter = buffer.get_iter_at_mark(buffer.get_insert())
acc = None
for tag in iter.get_tags():
- acc = tag.get_data('acc')
+ acc = getattr(tag, 'acc')
if acc:
self.node.update(acc)
break
@@ -426,7 +426,7 @@ class EventMonitor(ViewportPlugin):
iter = textview.get_iter_at_location(x, y)
cursor = gdk.Cursor(gdk.CursorType.XTERM)
for tag in iter.get_tags():
- if tag.get_data('islink'):
+ if getattr(tag, 'islink'):
cursor = gdk.Cursor(gdk.CursorType.HAND2)
break
window = textview.get_window(gtk.TextWindowType.TEXT)
diff --git a/plugins/interface_view.py b/plugins/interface_view.py
index edab7ac..53fff59 100644
--- a/plugins/interface_view.py
+++ b/plugins/interface_view.py
@@ -1128,7 +1128,7 @@ class _SectionTable(_InterfaceSection):
self.cell_button)]:
button.set_label(str(desc or '<no description>'))
button.set_sensitive(bool(acc))
- button.set_data('acc', acc)
+ setattr(button, 'acc', acc)
def _onTableButtonClicked(self, button):
'''
@@ -1138,7 +1138,7 @@ class _SectionTable(_InterfaceSection):
@param button: Button that triggered event.
@type button: gtk.Button
'''
- self.node.update(button.get_data('acc'))
+ self.node.update(getattr(button, 'acc'))
class _SectionText(_InterfaceSection):
'''
diff --git a/src/lib/accerciser/main_window.py b/src/lib/accerciser/main_window.py
index 39e2c4c..43f5053 100644
--- a/src/lib/accerciser/main_window.py
+++ b/src/lib/accerciser/main_window.py
@@ -107,7 +107,7 @@ class AccerciserMainWindow(gtk.Window):
if not self.gsettings.get_int(paned.get_name()): continue
paned_position = self.gsettings.get_int(paned.get_name())
paned.set_position(paned_position)
- paned.set_data('last_position', paned.get_position())
+ setattr(paned, 'last_position', paned.get_position())
self.add(main_vbox)
@@ -126,10 +126,10 @@ class AccerciserMainWindow(gtk.Window):
@type action: string
'''
if pluginview.get_n_pages() == 1 and action == 'added':
- last_pos = self._vpaned.get_data('last_position')
+ last_pos = getattr(self._vpaned, 'last_position')
self._vpaned.set_position(last_pos or 350)
elif pluginview.get_n_pages() == 0:
- self._vpaned.set_data('last_position', self._vpaned.get_position())
+ setattr(self._vpaned, 'last_position', self._vpaned.get_position())
self._vpaned.set_position(self._vpaned.get_allocated_height() - 30)
def _onBottomPanelRealize(self, pluginview):
@@ -169,7 +169,7 @@ class AccerciserMainWindow(gtk.Window):
if self.pluginview2.get_n_pages():
position = self._vpaned.get_position()
else:
- position = self._vpaned.get_data('last_position')
+ position = getattr(self._vpaned, 'last_position')
if position is not None:
self.gsettings.set_int('vpaned', position)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]