예제 #1
0
파일: Group.py 프로젝트: AlexUlrich/digsby
 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()
예제 #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()
예제 #3
0
파일: Group.py 프로젝트: AlexUlrich/digsby
    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
예제 #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