def _init_order(self): groups = [] # Initialize a "group by status" order from contacts.buddylistsort import STATUS_ORDER for status in STATUS_ORDER: groups.append(SpecialGroup(status).groupkey()) self.order = dict(groups = groups, contacts = defaultdict(list), info = {})
def _newsortgroups_to_dgroups(g): ''' While we transition to C++ sorting, we still need to make DGroups to keep the rest of Digsby happy. ''' protocol_ids = g._protocol_ids if protocol_ids is not None: protos, ids = g._protocol_ids else: protos, ids = [], [] children = [] for elem in g: if isinstance(elem, blist.Group): elem = _newsortgroups_to_dgroups(elem) children.append(elem) groupkey = g.groupkey() if groupkey == FAKE_ROOT_GROUP_KEY: group = SpecialGroup(g.name, [None] + protos, ['__fakerootgroup__'] + ids, children) group.__class__ = FakeRootGroup assert group.groupkey() == groupkey else: group = SortGroup(g.name, protos, ids, groupkey, children) group._new_display_string = g.display_string return group
def _rename(self, new_name, callback): self.name = new_name return SpecialGroup._rename(self, new_name, callback)