Browse Source

Python 2.5 don't have 'setter' decoration, so we change this to property()

master
Julio Biason 14 years ago
parent
commit
618086eb3d
  1. 7
      mitterlib/ui/helpers/gtk_messagegrid.py
  2. 8
      mitterlib/ui/helpers/gtk_updatebox.py

7
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):

8
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)

Loading…
Cancel
Save