Exemplo n.º 1
0
def landing(user):
    print("------------------Home------------------")
    while True:
        print(
            "Options\n1.Search Users\n2. View/Edit Profile\n3. View/Remove Connections\n"
            +
            "4. View Your Groups\n5. Search Groups\n6. Logout\n7. Delete Account"
        )
        option = raw_input("Please enter an option (e.g. 1):\n")
        if option == "1":
            search.search_users(user)
        elif option == "2":
            viewProfile.view_profile(user, user)
        elif option == "3":
            connections.main(user)
        elif option == "5":
            search.search_groups(user)
        elif option == "4":
            groups.view_groups(user)
        elif option == "6":
            print("You are now logged out of your account")
            return login.start()
        elif option == "7":
            return delete.delete_account(user)
        else:
            print("Command not recognized. Enter a number from 1-7")
Exemplo n.º 2
0
def delete_account(user):
    print("-----------------------------------------------")
    option = raw_input(
        "Are you sure you want to permanently delete your acount" +
        "and all information related to it (y/n):\n")
    while True:
        if option == 'y':
            cursor.callproc('del_user', [user])
            cnx.commit()
            print("Your account has been deleted")
            return login.start()
        elif option == 'n':
            print("Account deletion has been canceled")
            return home.landing(user)
        else:
            option = raw_input("command not recognized. Enter 'y' or 'n'\n")
Exemplo n.º 3
0
 def Logout(self):
     self.destroy()
     from login import start
     start()
Exemplo n.º 4
0
def main():
    login.start()
    print("Exiting...")
    return 0