diff --git a/mock/local_test.py b/mock/local_test.py index b1ebca7..e11f7d6 100644 --- a/mock/local_test.py +++ b/mock/local_test.py @@ -1,11 +1,17 @@ -import re +import readline +def startup_hook(): + readline.insert_text('from startup_hook') -def set_description_message_pattern(pattern: str) -> None: - first_check = re.match(r'.*command.*', pattern) - second_check = re.match(r'.*{description}.*', pattern) - if bool(first_check) and bool(second_check): - print('Success') +def pre_input_hook(): + readline.insert_text('from pre_input_hook') + readline.redisplay() +readline.set_startup_hook(startup_hook) +readline.set_pre_input_hook(pre_input_hook) +readline.parse_and_bind('tab: complete') -set_description_message_pattern('Invalid des{ommand}cription pattern') \ No newline at end of file +line = '' +while line != 'stop': + line = input('!("stop" to quit) Ввод текста: => ') + print (f'Отправка: {line}') \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 2d03c7a..016b9b1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,4 +33,5 @@ numpy = "^2.2.2" word2number = "^1.1" numexpr = "^2.10.2" requests = "^2.32.3" +pyreadline3 = "^3.5.4"