From 618086eb3df317fec118b12ac80af2a69cc0cda4 Mon Sep 17 00:00:00 2001 From: Julio Biason Date: Thu, 22 Apr 2010 14:04:06 -0300 Subject: [PATCH] Python 2.5 don't have 'setter' decoration, so we change this to property() --- mitterlib/ui/helpers/gtk_messagegrid.py | 7 +++---- mitterlib/ui/helpers/gtk_updatebox.py | 8 ++++---- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/mitterlib/ui/helpers/gtk_messagegrid.py b/mitterlib/ui/helpers/gtk_messagegrid.py index 050be62..bf110fe 100644 --- a/mitterlib/ui/helpers/gtk_messagegrid.py +++ b/mitterlib/ui/helpers/gtk_messagegrid.py @@ -74,17 +74,16 @@ class MessageGrid(gtk.ScrolledWindow, gobject.GObject): gobject.TYPE_NONE, (gobject.TYPE_PYOBJECT, ))} - @property - def count(self): + def _get_count(self): """Number of unread messages.""" return self._message_count - @count.setter - def count(self, messages): + def _set_count(self, messages): """Update the number of unread messages.""" self._message_count = messages self.emit('count-changed', messages) return + count = property(_get_count, _set_count) @property def selected(self): diff --git a/mitterlib/ui/helpers/gtk_updatebox.py b/mitterlib/ui/helpers/gtk_updatebox.py index cc40b41..3aca61a 100644 --- a/mitterlib/ui/helpers/gtk_updatebox.py +++ b/mitterlib/ui/helpers/gtk_updatebox.py @@ -130,8 +130,7 @@ class UpdateBox(gtk.VBox): self._update_status.set_text(text) return True - @property - def text(self): + def _get_text(self): """Return the text in the update box.""" text_buffer = self._text.get_buffer() @@ -140,14 +139,15 @@ class UpdateBox(gtk.VBox): return text_buffer.get_text(start, end, include_hidden_chars=False) - @text.setter - def text(self, text): + def _set_text(self, text): """Set the textarea text.""" self._text.get_buffer().set_text(text) return + text = property(_get_text, _set_text) def _set_pixbuf(self, pixbuf): """Update the avatar pixbuf.""" + _log.debug('Avatar set') self.avatar.set_from_pixbuf(pixbuf) # pixbuf can only be set, not get. pixbuf = property(None, _set_pixbuf)