mirror of
https://github.com/koloideal/Argenta.git
synced 2026-06-10 10:05:28 +03:00
first step
This commit is contained in:
+13
-7
@@ -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:
|
def pre_input_hook():
|
||||||
first_check = re.match(r'.*command.*', pattern)
|
readline.insert_text('from pre_input_hook')
|
||||||
second_check = re.match(r'.*{description}.*', pattern)
|
readline.redisplay()
|
||||||
if bool(first_check) and bool(second_check):
|
|
||||||
print('Success')
|
|
||||||
|
|
||||||
|
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')
|
line = ''
|
||||||
|
while line != 'stop':
|
||||||
|
line = input('!("stop" to quit) Ввод текста: => ')
|
||||||
|
print (f'Отправка: {line}')
|
||||||
@@ -33,4 +33,5 @@ numpy = "^2.2.2"
|
|||||||
word2number = "^1.1"
|
word2number = "^1.1"
|
||||||
numexpr = "^2.10.2"
|
numexpr = "^2.10.2"
|
||||||
requests = "^2.32.3"
|
requests = "^2.32.3"
|
||||||
|
pyreadline3 = "^3.5.4"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user