def exit_program(): """ Save the list before exit the program. """ os.system("rm -f *.data") if client_conn.is_login(): filelist.save(password, "salt", mylist) client_conn.upload(mylist) client_conn.logout() print("Bye") sys.exit()
def ui_logout(): """ Handle the logout events. """ if client_conn.is_login(): filelist.save(password, "salt", mylist) client_conn.upload(mylist) status = client_conn.logout() filelist.mylist = {} if status: print("Logout success") else: print("Logout failure")