1
0

doc: add some infos

- add some infos in doc
- add count limit prompt in query step
This commit is contained in:
2026-06-17 12:39:12 +08:00
parent cfa02e7d85
commit 96fa6263a8
4 changed files with 90 additions and 5 deletions

View File

@@ -149,8 +149,13 @@ class App:
App.QuerySortPriority
).to_response_priority()
print("How may result are you expected?")
count_limit = self.__accept_count_value()
# build request and ask resolver
request = Request(device_kind, target_value, tolerance, response_priority, 100)
request = Request(
device_kind, target_value, tolerance, response_priority, count_limit
)
response = self.__resolver.resolve(request)
# use page viewer to show result
@@ -217,10 +222,33 @@ class App:
except ValueError:
print("Unknown command, please try again.")
def __accept_count_value(self) -> int:
MAX_COUNT: int = 50
while True:
self.__show_prompt_arrow()
words = input()
if words == "":
continue
try:
value = int(words)
except ValueError:
print("Wrong value, please try again.")
continue
if value > MAX_COUNT or value <= 0:
print("Wrong value, please try again.")
else:
return value
def __accept_device_value(self) -> float:
while True:
self.__show_prompt_arrow()
words = input()
if words == "":
continue
value = self.__parse_human_readable_value(words)
if value is None:
print("Wrong value, please try again.")
@@ -231,6 +259,8 @@ class App:
while True:
self.__show_prompt_arrow()
words = input()
if words == "":
continue
if words.endswith("%"):
value = self.__parse_plain_float(