Пример #1
0
	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)
Пример #2
0
    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
Пример #3
0
	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
Пример #4
0
	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)
Пример #5
0
	def content_source(self, alternate=False):
		if ContactLeaf.has_content(self):
			return ContactLeaf.content_source(self, alternate=alternate)
		if self.tweets:
			return FriendStatusesSource(self)
Пример #6
0
	def has_content(self):
		return bool(self.tweets) or ContactLeaf.has_content(self)
Пример #7
0
	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
Пример #8
0
 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)
Пример #9
0
 def content_source(self, alternate=False):
     if ContactLeaf.has_content(self):
         return ContactLeaf.content_source(self, alternate=alternate)
     if self.tweets:
         return FriendStatusesSource(self)
Пример #10
0
 def has_content(self):
     return bool(self.tweets) or ContactLeaf.has_content(self)
Пример #11
0
 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