pyntcli 0.1.95__py3-none-any.whl → 0.1.96__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyntcli/__init__.py +1 -1
- pyntcli/ui/prompt.py +12 -21
- {pyntcli-0.1.95.dist-info → pyntcli-0.1.96.dist-info}/METADATA +1 -1
- {pyntcli-0.1.95.dist-info → pyntcli-0.1.96.dist-info}/RECORD +7 -7
- {pyntcli-0.1.95.dist-info → pyntcli-0.1.96.dist-info}/WHEEL +0 -0
- {pyntcli-0.1.95.dist-info → pyntcli-0.1.96.dist-info}/entry_points.txt +0 -0
- {pyntcli-0.1.95.dist-info → pyntcli-0.1.96.dist-info}/top_level.txt +0 -0
pyntcli/__init__.py
CHANGED
pyntcli/ui/prompt.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import signal
|
|
2
1
|
from sys import stdin
|
|
3
2
|
from pyntcli.ui import ui_thread
|
|
3
|
+
from timedinput import timedinput
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
class TimeoutExpired(Exception):
|
|
@@ -27,7 +27,7 @@ def confirmation_prompt_with_timeout(question, default, timeout=10):
|
|
|
27
27
|
# If stdin isn't a tty, we can't prompt the user
|
|
28
28
|
if not stdin.isatty():
|
|
29
29
|
return valid[default]
|
|
30
|
-
|
|
30
|
+
|
|
31
31
|
if default is None:
|
|
32
32
|
prompt = " [y/n] "
|
|
33
33
|
elif default == "yes":
|
|
@@ -37,22 +37,13 @@ def confirmation_prompt_with_timeout(question, default, timeout=10):
|
|
|
37
37
|
else:
|
|
38
38
|
raise ValueError(f"Invalid default answer: '{default}'")
|
|
39
39
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return valid[choice]
|
|
51
|
-
else:
|
|
52
|
-
ui_thread.print("Please respond with 'yes' or 'no' (or 'y' or 'n').")
|
|
53
|
-
except TimeoutExpired:
|
|
54
|
-
ui_thread.print(ui_thread.PrinterText(f"\nNo response within {timeout} seconds, defaulting to {'Yes' if default == 'yes' else 'No'}.\n" +
|
|
55
|
-
"You can use '--yes' flag for auto-confirm", ui_thread.PrinterText.WARNING))
|
|
56
|
-
return valid[default]
|
|
57
|
-
finally:
|
|
58
|
-
signal.alarm(0)
|
|
40
|
+
while True:
|
|
41
|
+
choice = timedinput(question + prompt, timeout=timeout, default=default).strip().lower()
|
|
42
|
+
|
|
43
|
+
if choice == "" and default: # Only 'Enter' with default will continue
|
|
44
|
+
return valid[default]
|
|
45
|
+
elif choice in valid:
|
|
46
|
+
return valid[choice]
|
|
47
|
+
else:
|
|
48
|
+
ui_thread.print("Please respond with 'yes' or 'no' (or 'y' or 'n').")
|
|
49
|
+
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
ignoreTests/conftest.py,sha256=gToq5K74GtgeGQXjFvXSzMaE6axBYxAzcFG5XJPOXjI,427
|
|
2
2
|
ignoreTests/auth/login.py,sha256=KFlzWhXBAuwdi7GXf16gCB3ya94LQG2wjcSChE149rQ,3798
|
|
3
3
|
ignoreTests/store/cred_store.py,sha256=_7-917EtNC9eKEumO2_lt-7KuDmCwOZFaowCm7DbA_A,254
|
|
4
|
-
pyntcli/__init__.py,sha256=
|
|
4
|
+
pyntcli/__init__.py,sha256=lmReyP8y13zMt3y7Ps1HkI4BxyBIxSf73kAHwYEzhKU,402
|
|
5
5
|
pyntcli/main.py,sha256=HORWY5AEK5xmEQybUZBW9ZEDIga8vSnqDfmAR3TY9F0,6502
|
|
6
6
|
pyntcli/analytics/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
pyntcli/analytics/send.py,sha256=9TRAEoPbv4rWOZfcNaGanrRJAFvNs39P-uKSl49GcQE,3679
|
|
@@ -33,14 +33,14 @@ pyntcli/transport/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU
|
|
|
33
33
|
pyntcli/transport/pynt_requests.py,sha256=C7OPvcKkRTcxSYuyiWKE59KgA9sRX0d6fm1wnopAmPo,1719
|
|
34
34
|
pyntcli/ui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
35
35
|
pyntcli/ui/progress.py,sha256=RrnO_jJNunoyupylakmWmHOEPw3lh99OHpKBzL6OBiE,1008
|
|
36
|
-
pyntcli/ui/prompt.py,sha256=
|
|
36
|
+
pyntcli/ui/prompt.py,sha256=tK3BFYvgT7ZgSrsN5ASkltcsbhy8tOdNfEjRyCjOk6Q,1570
|
|
37
37
|
pyntcli/ui/pynt_errors.py,sha256=00UprD4tFViREv7kuXGQ99PAKGTpXYixxi3Ndeoeiew,689
|
|
38
38
|
pyntcli/ui/report.py,sha256=W-icPSZrGLOubXgam0LpOvHLl_aZg9Zx9qIkL8Ym5PE,1930
|
|
39
39
|
pyntcli/ui/ui_thread.py,sha256=XUBgLpYQjVhrilU-ofw7VSXgTiwneSdTxm61EvC3x4Q,5091
|
|
40
40
|
tests/test_utils.py,sha256=t5fTQUk1U_Js6iMxcGYGqt4C-crzOJ0CqCKtLkRtUi0,2050
|
|
41
41
|
tests/commands/test_pynt_cmd.py,sha256=BjGFCFACcSziLrNA6_27t6TjSmvdu54wx9njwLpRSJY,8379
|
|
42
|
-
pyntcli-0.1.
|
|
43
|
-
pyntcli-0.1.
|
|
44
|
-
pyntcli-0.1.
|
|
45
|
-
pyntcli-0.1.
|
|
46
|
-
pyntcli-0.1.
|
|
42
|
+
pyntcli-0.1.96.dist-info/METADATA,sha256=WRbpsZf1J5bqR24Vmq7IUIKLVhTikFzswzPfvWhpbSE,460
|
|
43
|
+
pyntcli-0.1.96.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
|
|
44
|
+
pyntcli-0.1.96.dist-info/entry_points.txt,sha256=kcGmqAxXDttNk2EPRcqunc_LTVp61gzakz0v-GEE2SY,43
|
|
45
|
+
pyntcli-0.1.96.dist-info/top_level.txt,sha256=64XSgBzSpgwjYjEKHZE7q3JH2a816zEeyZBXfJi3AKI,42
|
|
46
|
+
pyntcli-0.1.96.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|