wizlib 3.0.0__py3-none-any.whl → 3.0.1__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.
Potentially problematic release.
This version of wizlib might be problematic. Click here for more details.
wizlib/command.py
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# Note that commands once used dataclass, but no longer.
|
|
2
|
+
|
|
1
3
|
from argparse import ArgumentParser
|
|
2
4
|
from pathlib import Path
|
|
3
5
|
|
|
@@ -16,8 +18,7 @@ class WizCommand(ClassFamily, SuperWrapper):
|
|
|
16
18
|
"""Define all the args you want, but stdin always works."""
|
|
17
19
|
|
|
18
20
|
status = ''
|
|
19
|
-
handlers = []
|
|
20
|
-
ui: UI = None
|
|
21
|
+
handlers = [] # TODO: Move to app
|
|
21
22
|
|
|
22
23
|
@classmethod
|
|
23
24
|
def add_args(self, parser):
|
wizlib/ui/__init__.py
CHANGED
|
@@ -127,12 +127,12 @@ class Chooser(Prompt):
|
|
|
127
127
|
self.choices.append(choice)
|
|
128
128
|
|
|
129
129
|
def choice_by_key(self, key):
|
|
130
|
-
if key == '\n':
|
|
131
|
-
choice = self.
|
|
130
|
+
if key == '\n' and self.default:
|
|
131
|
+
choice = self.choices[0].value
|
|
132
132
|
else:
|
|
133
133
|
choice = next(
|
|
134
134
|
(o.value for o in self.choices if key in o.keys), None)
|
|
135
|
-
return choice
|
|
135
|
+
return choice
|
|
136
136
|
|
|
137
137
|
def choices_by_text(self, text):
|
|
138
138
|
return [o.value for o in self.choices if o.hit_text(text)]
|
wizlib/ui/shell_ui.py
CHANGED
|
@@ -54,7 +54,7 @@ class ShellUI(UI):
|
|
|
54
54
|
self.send(out, emphasis=emphasis)
|
|
55
55
|
if choice is not None:
|
|
56
56
|
break
|
|
57
|
-
return choice
|
|
57
|
+
return choice() if callable(choice) else choice
|
|
58
58
|
|
|
59
59
|
def get_text(self, prompt='', choices=[], default=''):
|
|
60
60
|
"""Allow the user to input an arbitrary line of text, with possible tab
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
wizlib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
2
|
wizlib/app.py,sha256=O5126FXF2_JSGlHycMv3-ec7EfYI875wzuYsDrxq5ZI,3263
|
|
3
3
|
wizlib/class_family.py,sha256=tORSVAaPeWTQMcz2DX-MQClj1GQR3vCmkALPXxHa_pk,4506
|
|
4
|
-
wizlib/command.py,sha256=
|
|
4
|
+
wizlib/command.py,sha256=3KNM146gLLAFDDPWaozREhSaUK5FBd2rtPuEXn4b9Hw,1747
|
|
5
5
|
wizlib/config_handler.py,sha256=hoDavSMiGM_7PAHI8XIwC8nxPWOZDk302ryyjluoLGg,2588
|
|
6
6
|
wizlib/error.py,sha256=ypwdMOYhtgKWd48ccfOX8idmCXmm-Skwx3gkPwqJB3c,46
|
|
7
7
|
wizlib/handler.py,sha256=Oz80aPhDyeY9tdppZ1dvtN-19JU5ydEDVW6jtppVoD4,446
|
|
@@ -9,12 +9,12 @@ wizlib/parser.py,sha256=O34azN4ttVfwwAsza0hujxGxDpzc4xUEVAf26DXJS5g,1505
|
|
|
9
9
|
wizlib/rlinput.py,sha256=l00Pa3rxNeY6LJgz8Aws_rTKoEchw33fuL8yqHF9_-o,1754
|
|
10
10
|
wizlib/stream_handler.py,sha256=i1EgcBrDiYhFK-CI8At7JtUtMCNunJmSkJLSlili-as,663
|
|
11
11
|
wizlib/super_wrapper.py,sha256=F834ytHqA7zegTD1ezk_uxlF9PLygh84wReuiqcI7BI,272
|
|
12
|
-
wizlib/ui/__init__.py,sha256=
|
|
12
|
+
wizlib/ui/__init__.py,sha256=ve_p_g4aBujh4jIJMgKkJ6cE5PT0aeY5AgRlneDswGg,4241
|
|
13
13
|
wizlib/ui/shell/__init__.py,sha256=sPrYe4bG_Xf7Nwssx_dqXVk9jeyYBFUjh4oLdlSOeRY,943
|
|
14
14
|
wizlib/ui/shell/line_editor.py,sha256=frpsqU5NggcvEz3XeB8YyqgmlExlyx6K1CKPzvARtPk,7419
|
|
15
|
-
wizlib/ui/shell_ui.py,sha256=
|
|
15
|
+
wizlib/ui/shell_ui.py,sha256=Fg1N-RErxQVPzr3wpcUCYa8Hz5QwVem0wE473pqI9dE,2064
|
|
16
16
|
wizlib/ui_handler.py,sha256=JoZadtw9DKAtGvHKP3_BJF2NaYqmcQYNdsY4PeRnOjg,634
|
|
17
17
|
wizlib/util.py,sha256=x1SyL3iXot0ET2r8Jjb2ySTd_J-3Uu7J1b_CHvFgzew,156
|
|
18
|
-
wizlib-3.0.
|
|
19
|
-
wizlib-3.0.
|
|
20
|
-
wizlib-3.0.
|
|
18
|
+
wizlib-3.0.1.dist-info/METADATA,sha256=4oI4tOQ8XPg32LQrKE0FW-j1trAl8qZW-ddtOk4tK9w,1780
|
|
19
|
+
wizlib-3.0.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
20
|
+
wizlib-3.0.1.dist-info/RECORD,,
|
|
File without changes
|