def add_contact(self, contact): """Adds C{contact} to the store""" if not is_sim_contact(contact): if contact.group in self.groupIters: groupIter = self.groupIters[contact.group] else: groupIter = self.append(None, [None, contact.group, '', '', None]) self.groupIters[contact.group] = groupIter img = is_sim_contact(contact) and MOBILE_IMG or COMPUTER_IMG self.append(groupIter, [img, contact.group, contact.name, contact.number, contact])
def add_contact(self, contact): """Adds C{contact} to the store""" if contact.group not in self.groupIters: self.groupIters[contact.group] = self.append( None, [None, contact.group, '', '', None]) img = is_sim_contact(contact) and MOBILE_IMG or COMPUTER_IMG self.append( self.groupIters[contact.group], [img, contact.group, contact.name, contact.number, contact])
def add_contacts(self, contacts): """Adds C{contacts} to the store""" contacts = [c for c in contacts if not is_sim_contact(c)] for contact in contacts: self.add_contact(contact)