def add_service(service, name, password, note): serv = Service() serv.service = service serv.name = name serv.password = password serv.note = note if serv.valid(): serv.create() return True else: return False
def create_user(username, password): user = Service() user.name = username user.password = password user.service = 'UniPass' user.note = 'Entry for UniPass' user.admin = True if user.valid(): user.create() return True else: return False