Beispiel #1
0
 def display_user_already_exist():
     """
     Method display information about user already exist.
     """
     exist_info = ColorfulView.format_string_to_red(
         'This user already exist as stundet!')
     print(exist_info)
    def display_main_menu():
        """
        Param: none
        Return: none

        Method display main menu options.
        """
        welcome_information = '\nWelcome in Canvas, patch 0.-2XYZ.4C version.'
        exit_program = '0. Exit'
        menu_options = ['Sign in', 'Sign up', 'Restore password']
        number_option = 1
        welcome_information = ColorfulView.format_string_to_yellow(
            welcome_information)
        exit_program = ColorfulView.format_string_to_red(exit_program)

        print(welcome_information)

        for option in menu_options:
            option = str(number_option) + '. ' + option
            option = ColorfulView.format_string_to_green(option)
            print(option)
            number_option = int(number_option)
            number_option += 1

        print(exit_program)
    def show_invalid_input():
        """
        Prints out input error

        :return: None
        """
        print(ColorfulView.format_string_to_red('Invalid input!'))
        input('Press enter to return')
    def display_date_error():
        """
        Prints out date error

        :return: None
        """
        print(ColorfulView.format_string_to_red('Wrong date format!'))
        input('Press enter to return')
 def display_empty_list_message():
     """
     Display message about empty list
     :return:
     """
     print('')
     print(ColorfulView.format_string_to_red('List is empty!'))
     input('\nPress ENTER to continue')
Beispiel #6
0
 def display_emails_input_error():
     """
     Method display input error message.
     """
     print(
         ColorfulView.format_string_to_red(
             'You type wrong input! Why you dont spam students by emails!'))
     input()
    def display_index_error():
        """
        Prints out display error

        :return: None
        """
        print(ColorfulView.format_string_to_red('Wrong index!'))
        input('Press enter to return')
 def display_user_not_found():
     """
     Display information that user is not found
     :return:
     """
     print(
         ColorfulView.format_string_to_red(
             'User with that name not found!'))
     input('\nPress ENTER to continue ')
 def display_wrong_attribute():
     """
     Display message about wrong attribute typed
     :return:
     """
     print(
         ColorfulView.format_string_to_red(
             'There is no such attribute to change!'))
     input('\nPress ENTER to continue')
    def display_not_enough_data():
        """
        Prints out not enough data error message

        :return: None
        """
        print(
            ColorfulView.format_string_to_red(
                'You have no students/groups/assignments added'))
Beispiel #11
0
 def display_error_message(error_msg: str):
     """
     Method displays error message
     :param error_msg: str -> An error message.
     :return: None
     """
     os.system('clear')
     print(ColorfulView.format_string_to_red(error_msg))
     input(ColorfulView.format_string_to_green(CONFIRM_MESSAGE))
 def display_user_deleted(user):
     """
     Display information about deleted user
     :param user: User object
     :return:
     """
     print(
         ColorfulView.format_string_to_red(
             'User: {} has been deleted'.format(user.get_login())))
     input('\nPress ENTER to continue')
    def display_user_not_exist():
        """
        Param: none
        Return: none

        Method display information about not existing user account
        if someone try to singin with not exist login in database.
        """
        os.system('clear')
        print(ColorfulView.format_string_to_red('User not exists!'))
        time.sleep(0.5)
    def display_user_already_exists():
        """
        Param: none
        Return: none

        Method display information if user already exist.
        """
        os.system('clear')
        print(
            ColorfulView.format_string_to_red('Entered user already exists!'))
        time.sleep(0.5)
    def get_presence(student):
        """
        Checks students presence

        :param student: Student() ->  Object for grading
        :return: bool -> True if student present, False otherwise
        """
        os.system('clear')
        presence = None
        while presence != 'y' or presence != 'n':
            presence = input('Is ' + student.name + ' present? (y/n)')
            if presence == 'y':
                return True
            if presence == 'n':
                return False
            else:
                print(ColorfulView.format_string_to_red('Invalid input!'))
    def display_students_list(students_list):
        """
        Prints out current students from list

        :param students_list: list -> list of current students
        :return: None
        """
        if not students_list:
            print(ColorfulView.format_string_to_red('No students found!'))
            return
        os.system('clear')
        for student in students_list:
            group_str = GroupContainer.get_instance().get_student_group_name(
                student)
            if not group_str:
                group_str = "Not assigned"
            print('Index: ' + str(students_list.index(student)) + ' Name: ' +
                  student.name + ' Group: ' + group_str)
        input('Press enter to return')
 def print_wrong_assignment_id_error():
     os.system('clear')
     print(
         ColorfulView.format_string_to_red(
             'Assignment with this ID does not exist !'))
     input('\nPress ENTER to continue')
Beispiel #18
0
 def display_input_error():
     """
     Method display wrong input message.
     """
     print(ColorfulView.format_string_to_red('Wrong input!'))