def __init__(self, name, handle, status): slots = {SKYPE_KEY: handle, NAME_KEY: name} ContactLeaf.__init__(self, slots, name) self.kupfer_add_alias(handle) self._description = _("[%(status)s] %(userid)s") % \ dict(status=status, userid=handle)
def __init__(self, jid, name, account, icon, protocol, available, status_message): slots = { EMAIL_KEY: jid, NAME_KEY: name or jid, PIDGIN_ACCOUNT: account, PIDGIN_JID: jid, } if not is_valid_email(jid): slots[EMAIL_KEY] = None ContactLeaf.__init__(self, slots, name or jid) self.kupfer_add_alias(jid) self._description = _("[%(status)s] %(userid)s/%(service)s") % \ { "status": _("Available") if available else _("Away"), "userid": jid, "service": protocol, } if status_message: self._description += u"\n%s" % status_message self.account = account self.jid = jid self.icon = icon self.protocol = protocol
def get_thumbnail(self, width, height): if self.image: return icons.get_pixbuf_from_data(self.image, width, height) return ContactLeaf.get_thumbnail(self, width, height)
def content_source(self, alternate=False): if ContactLeaf.has_content(self): return ContactLeaf.content_source(self, alternate=alternate) if self.tweets: return FriendStatusesSource(self)
def has_content(self): return bool(self.tweets) or ContactLeaf.has_content(self)
def __init__(self, username, name, image=None): slots = {TWITTER_USERNAME_KEY: username, NAME_KEY: name} ContactLeaf.__init__(self, slots, name) self.kupfer_add_alias(username) self.image = image self.tweets = None