Пример #1
0
        def deleteAll():
            response = Connection.notificationRequest("delete-all", {})
            successful = response.get("successful")
            message = response.get("message")

            if successful:
                Common.printPositiveText(message)
            else:
                Common.printNegativeText(message)
Пример #2
0
        def resetUsername():
            username = input("Username -> ")

            response = Connection.profileRequest("reset-username",
                                                 {"username": username})
            successful = response.get("successful")
            message = response.get("message")

            if successful:
                Common.printPositiveText(message)
            else:
                Common.printNegativeText(message)
Пример #3
0
        def deleteStream():
            chatWith = input("Username -> ")

            response = Connection.chatRequest("delete-stream",
                                              {"chatWith": chatWith})
            successful = response.get("successful")
            message = response.get("message")

            if successful:
                Common.printPositiveText(message)
            else:
                Common.printNegativeText(message)
Пример #4
0
        def ignore():
            username = input("Username -> ")

            response = Connection.friendshipRequest("ignore",
                                                    {"username": username})
            successful = response.get("successful")
            message = response.get("message")

            if successful:
                Common.printPositiveText(message)
            else:
                Common.printNegativeText(message)
Пример #5
0
        def resetEmail():
            email = input("Email -> ")

            response = Connection.profileRequest("reset-email",
                                                 {"email": email})
            successful = response.get("successful")
            message = response.get("message")

            if successful:
                Common.printPositiveText(message)
            else:
                Common.printNegativeText(message)
Пример #6
0
        def resetPassword():
            password = getpass("Password -> ")

            response = Connection.profileRequest("reset-password",
                                                 {"password": password})
            successful = response.get("successful")
            message = response.get("message")

            if successful:
                Common.printPositiveText(message)
            else:
                Common.printNegativeText(message)
Пример #7
0
        def deleteOne():
            try:
                notificationId = int(input("Notification Id -> "))
            except ValueError:
                Common.printNegativeText("Notification id must be integer")

                return

            response = Connection.notificationRequest("delete-one",
                                                      {"id": notificationId})
            successful = response.get("successful")
            message = response.get("message")

            if successful:
                Common.printPositiveText(message)
            else:
                Common.printNegativeText(message)
Пример #8
0
    def registerForm():
        form = RegisterForm()
        form.fillTheForm()

        Common.clearTerminal()

        if form.validation():
            response = Connection.registerRequest(form.getData())
            successful = response.get("successful")
            message = response.get("message")

            if successful:
                Common.printPositiveText(message)
            else:
                Common.printNegativeText(message)
        else:
            Common.printNegativeText(form.getValidationMessage())

        Common.programSleep()
Пример #9
0
    def loginForm():
        form = LoginForm()
        form.fillTheForm()

        Common.clearTerminal()

        if form.validation():
            response = Connection.loginRequest(form.getData())
            successful = response.get("successful")
            message = response.get("message")

            if successful:
                Common.printPositiveText(message)
                Common.programSleep()

                LobbyView.view()
            else:
                Common.printNegativeText(message)
        else:
            Common.printNegativeText(form.getValidationMessage())

        Common.programSleep()