def add(self): """ Add a new contact to the database """ ac=AgendaController() name=raw_input(' Name:').strip() ok=False while ok==False: ok=True try: id=int(raw_input(' ID:')) except ValueError: print "Give a numerical ID" ok=False nr=raw_input(' Phone Number:').strip() group=raw_input(' Group:').strip() i=ac.addContact(id,name,nr,group) if i==False: print "INVALID CONTACT!!!" self.add()