Esempio n. 1
0
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()
Esempio n. 2
0
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")