def get_user_login_password(): """ Param: none Return: tuple Method take users login and password and return it as a tuple. """ user_login = RootView.get_user_login() user_password = PasswordService.get_password_with_asterisks() login_password = (user_login, user_password) return login_password
def create_user_password(): """ Arguments: none Return: none Method let to create user his account password and check if it contain requirements. """ incorrect_password = True user_password = '' while incorrect_password: print( ColorfulView.format_string_to_yellow( 'Enter your password(it must contain big, small characters and ' 'digit, it must contain min 6 chars and ' 'it cant be longer than 30 characters): ')) user_password = PasswordService.get_password_with_asterisks() if re.match(r'^(?=.*?\d)(?=.*?[A-Z])(?=.*?[a-z])[A-Za-z\d]{6,30}$', user_password): incorrect_password = False return user_password