Commit b582cfc8 authored by Dan Pascu's avatar Dan Pascu

Added __str__ and __repr__ methods to Contact

parent 76c0d74a
...@@ -81,6 +81,12 @@ class Contact(object): ...@@ -81,6 +81,12 @@ class Contact(object):
self.icon = self.default_user_icon if image is None else ContactIconDescriptor(image).__get__(self, self.__class__) self.icon = self.default_user_icon if image is None else ContactIconDescriptor(image).__get__(self, self.__class__)
self.status = 'unknown' self.status = 'unknown'
def __repr__(self):
return '%s(%r, %r, %r, %r)' % (self.__class__.__name__, self.group, self.name, self.uri, self.image)
def __str__(self):
return '%s <%s>' % (self.name, self.uri) if self.name else self.uri
class ContactDelegate(QStyledItemDelegate): class ContactDelegate(QStyledItemDelegate):
item_size_hints = {Contact: QSize(200, 36), ContactGroup: QSize(200, 18)} item_size_hints = {Contact: QSize(200, 36), ContactGroup: QSize(200, 18)}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment