def display_password_changed_successfully(): """ Method displays that password have been changed successfully. :return: None """ os.system('clear') print( ColorfulView.format_string_to_green( 'You password have been changed successfully')) input(ColorfulView.format_string_to_green(CONFIRM_MESSAGE))
def display_chose_user_to_promote(users): """ Method display users to promote to students. Param: list ----> object of user container Return: object of User class / None """ os.system('clear') index = 1 for person in users: print('\n' + str(index) + '. ' + ColorfulView.format_string_to_green(person.name) + ', Login: '******', Email: ' + ColorfulView.format_string_to_yellow(person.email)) index += 1 incorrect = True while incorrect: user_index = input('Enter user index to promote(or back): ') if user_index.isdigit(): user = EmployeeView.get_user_by_index(user_index, users) return user elif user_index == 'back': incorrect = False
def display_mentor_information(mentor_data): """ Display information about mentor :param mentor_data: mentor object :return: """ os.system('clear') print( ColorfulView.format_string_to_yellow('Login: '******'\nName: ') + mentor_data.get_name() + ColorfulView.format_string_to_green('\nPhone number: ') + mentor_data.get_phone_number() + ColorfulView.format_string_to_green('\nEmail: ') + mentor_data.get_email())
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 display_that_token_have_been_sent(): """ Method display that token has been sent. :return: None """ print( ColorfulView.format_string_to_green( "You can find the token in your e-mail or SMS box."))
def get_value_to_change(): """ Get value to change mentor data :return: """ return input( 'Enter what do you want to change(' + ColorfulView.format_string_to_green('login, phone, email, name') + '):')
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_grades(assignments: list): os.system('clear') print(ColorfulView.format_string_to_green('Your grades:')) for index, assignment in enumerate(assignments): index += INDEX_INCREMENTOR print( ColorfulView.format_string_to_blue(str(index) + '. ') + assignment) input('\nPress ENTER to continue')
def display_user_promoted(user): """ Display information that user has been promoted :param user: User object :return: """ print( ColorfulView.format_string_to_green( 'User: {} has been promoted'.format(user.get_login()))) input('\nPress ENTER to continue')
def display_is_email_sent(email): """ Method display infromation about emails is it send. Param: str Return: None """ email = ColorfulView.format_string_to_yellow(email) print(email + ColorfulView.format_string_to_green(' - email has been sent!'))
def display_user_created(login, phone_number, email, name): """ Param: str, str, str, str, str Return: none Method display information about created user account. """ os.system('clear') account_created_info1 = '\nYou have created a new account!' \ '\nName: {}\nPhone number: {},'.format(name, phone_number) account_created_info2 = '\nLogin: {}, \nEmail: {}'.format(login, email) acc_info = account_created_info1 + account_created_info2 print(ColorfulView.format_string_to_green(acc_info)) input('Press enter to back')
def display_error_user_singin(): """ Param: none Return: none Method display infromation when created user try to signing without any status of student, mentor etc. """ os.system('clear') print( ColorfulView.format_string_to_green( '\nYou are trying to sign in as random user,' ' please wait for manager or mentor to change your status!')) print( ColorfulView.format_string_to_white( '\n\nWe will inform you when it will be ready.' '\n\nThank you for patience!')) time.sleep(4)
def display_sign_menu(sign_up): """ Param: bool Return: none Method check if user want to sign in or create new account in platform and display infromation. """ os.system('clear') create_new_user_info = '\nAs new user of our platform you need to sign up with your email and unique password!' create_new_user_info = ColorfulView.format_string_to_green( create_new_user_info) sign_in_as_user_info = '\nAs a user of our platform you need to sign in with your login and password.' sign_in_as_user_info = ColorfulView.format_string_to_yellow( sign_in_as_user_info) if sign_up: print(create_new_user_info) else: print(sign_in_as_user_info)
def print_table(users): """ Method display formated table from object of UserContainer class. Param: list --> UserContainer Class Return: None """ t = Texttable() t.set_cols_dtype(['a', 'a', 'a', 'a', 'i', 'a']) tittles = ['Index', 'Login', 'Name', 'Group', 'Phone Number', 'E-mail'] tittles = [ColorfulView.format_string_to_green(i) for i in tittles] t.add_rows([tittles] + [[ i + STARTING_INDEX, ColorfulView.format_string_to_yellow(u.get_login()), u.get_name(), 'Not assigned' if not u.group else u.group, u.get_phone_number(), u.get_email() ] for i, u in enumerate(users)]) print(t.draw())
def print_user_assignments_list_empty_error(): os.system('clear') print( ColorfulView.format_string_to_green( 'Your assignments list is empty !')) input('\nPress ENTER to continue')
def display_submission_result(): print( ColorfulView.format_string_to_green( 'You successfully added new submission !'))
def display_user_token_is_correct_msg(): """ Method displays that token is correct :return: None """ print(ColorfulView.format_string_to_green('\nYour token is correct !'))