Exemplo n.º 1
0
 def __init__(self, name, protocol, id, *children):
     BuddyListElement.__init__(self)
     ObservableList.__init__(self, *children)
     self.name = name
     self.protocol = protocol
     self.id = id
     self.watching = set()
Exemplo n.º 2
0
 def __init__(self, name, protocol, id, *children):
     BuddyListElement.__init__(self)
     ObservableList.__init__(self, *children)
     self.name = name
     self.protocol = protocol
     self.id = id
     self.watching = set()
Exemplo n.º 3
0
    def __init__(self, name, protocols = [], ids = [], *children):

        if not isinstance(name, basestring):
            raise TypeError('name must be a string, it was %s' %type(name))
        if len(protocols) != len(ids):
            raise AssertionError('protocols and ids must have same length: '
                                 '%d %d' % (len(protocols), len(ids)))

        BuddyListElement.__init__(self)
        ObservableList.__init__(self, *children)

        # assert that the incoming name string is a unicode object, or can
        # be converted to one trivially
        self.name = unicode(name)

        self.protocols = protocols
        self.ids = ids
        self.id_lookup = dict(izip(protocols, ids)) # stores {protocol: id}

        # This will store the number of buddies moved out of this group during
        # the filter process so __str__ can still return an accurate offline
        # count.
        self._offline_moved = 0

        # Whether or not to show the offline count, i.e. the 6 in Buddies (5/6)
        self._show_offline_count = True
Exemplo n.º 4
0
    def __init__(self, name, protocols=[], ids=[], *children):

        if not isinstance(name, basestring):
            raise TypeError('name must be a string, it was %s' % type(name))
        if len(protocols) != len(ids):
            raise AssertionError('protocols and ids must have same length: '
                                 '%d %d' % (len(protocols), len(ids)))

        BuddyListElement.__init__(self)
        ObservableList.__init__(self, *children)

        # assert that the incoming name string is a unicode object, or can
        # be converted to one trivially
        self.name = unicode(name)

        self.protocols = protocols
        self.ids = ids
        self.id_lookup = dict(izip(protocols, ids))  # stores {protocol: id}

        # This will store the number of buddies moved out of this group during
        # the filter process so __str__ can still return an accurate offline
        # count.
        self._offline_moved = 0

        # Whether or not to show the offline count, i.e. the 6 in Buddies (5/6)
        self._show_offline_count = True