def deleteUser( app, correo ): if not correo.strip(): app.key_notifications.showError( "Se debe seleccionar un correo si se desea borrar un usuario." ) else: result = messagebox.askquestion("Borrar usuario", "¿Realmente desea borrar el usuario '" + correo + "'?", icon='warning') if result == 'yes': try: KeyHandler.deleteKey( correo ) except Exception as msg: app.key_notifications.showError( msg ) app.resetApp() app.users = KeyHandler.getUsers() app.keyList.deleteList() app.keyList.insertList( app.users ) app.key_notifications.showSuccess( "Se ha borrado el usuario '" + correo + "' correctamente." )
def addEditUser( app, correo, key, current ): if not correo.strip(): app.key_notifications.showError( "El correo no puede estar vacio." ) elif not key.strip(): app.key_notifications.showError( "La clave no puede estar vacia." ) else: try: KeyHandler.setKey( correo, key, current ) except Exception as msg: app.key_notifications.showError( msg ) app.resetApp() app.users = KeyHandler.getUsers() app.keyList.deleteList() app.keyList.insertList( app.users ) app.key_notifications.showSuccess( "Se ha creado el usuario '" + correo + "' correctamente." )