wizlib 2.0.16__py3-none-any.whl → 2.0.18__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/ui/shell_ui.py CHANGED
@@ -33,10 +33,10 @@ class ShellUI(UI):
33
33
  print(file=sys.stderr, flush=True)
34
34
  return chooser.choice_by_key(key)
35
35
 
36
- def get_text(self, prompt):
37
- """Allow the user to input an arbitrary line of text"""
36
+ def get_text(self, prompt='', choices=[], default=''):
37
+ """Allow the user to input an arbitrary line of text, with possible tab
38
+ completion"""
38
39
  sys.stderr.write(prompt)
39
40
  sys.stderr.flush()
40
- value = ShellLineEditor().edit()
41
- # value = input()
41
+ value = ShellLineEditor(choices, default).edit()
42
42
  return value
wizlib/util.py ADDED
@@ -0,0 +1,8 @@
1
+ from unittest.mock import Mock, patch
2
+
3
+
4
+ RK = 'wizlib.ui.shell_line_editor.readkey'
5
+
6
+
7
+ def mock_keys(keys: str):
8
+ return patch(RK, Mock(side_effect=keys))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wizlib
3
- Version: 2.0.16
3
+ Version: 2.0.18
4
4
  Summary: Framework for flexible and powerful command-line applications
5
5
  License: MIT
6
6
  Author: Steampunk Wizard
@@ -11,8 +11,9 @@ wizlib/rlinput.py,sha256=l00Pa3rxNeY6LJgz8Aws_rTKoEchw33fuL8yqHF9_-o,1754
11
11
  wizlib/super_wrapper.py,sha256=F834ytHqA7zegTD1ezk_uxlF9PLygh84wReuiqcI7BI,272
12
12
  wizlib/ui/__init__.py,sha256=55tzM_XphYFqm_jVxQc5vkfPLgD1Z3aqSjDl50GM44A,6139
13
13
  wizlib/ui/shell_line_editor.py,sha256=HQNMUijdf-qU2kbzU_iOrK5gT-nEMkxweld2fP8yvPo,7818
14
- wizlib/ui/shell_ui.py,sha256=phgrFFMZGY9jJB_QwoOXhI6P6VK3W740g4rkVsFbRSc,1234
14
+ wizlib/ui/shell_ui.py,sha256=UdlMzCB2zk5NHT6KFE6n7aAMrXRb9lEAuG_gEg8mscA,1289
15
15
  wizlib/ui_handler.py,sha256=nvMRuGVCwJ-_H59iZQ72--_tiiqXAsSHP7kYnd43P68,716
16
- wizlib-2.0.16.dist-info/METADATA,sha256=RfenANTrwBZ7LGRZhMLnSgMjI8Jmm4lVqtxuD1oRNfk,1781
17
- wizlib-2.0.16.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
18
- wizlib-2.0.16.dist-info/RECORD,,
16
+ wizlib/util.py,sha256=6crNn_nI5Ytx5yu4IzcmI0iCfwCWbCN5NOnPcrYKB1c,156
17
+ wizlib-2.0.18.dist-info/METADATA,sha256=U9j-7WNIWuXX54P3C665j9MquVsV__3HfU6s-YXQPu0,1781
18
+ wizlib-2.0.18.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
19
+ wizlib-2.0.18.dist-info/RECORD,,