wizlib 3.1.1__py3-none-any.whl → 3.1.3__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/app.py CHANGED
@@ -70,15 +70,18 @@ class WizApp:
70
70
  """Set up the parser for the app class"""
71
71
  cls.parser = WizParser(prog=cls.name)
72
72
  subparsers = cls.parser.add_subparsers(dest='command')
73
+ cls.dparser = WizParser(prog=f"{cls.name} {cls.base.default}")
73
74
  for command in cls.base.family_members('name'):
74
75
  key = command.get_member_attr('key')
75
76
  aliases = [key] if key else []
76
77
  subparser = subparsers.add_parser(command.name, aliases=aliases)
77
78
  if command.name == cls.base.default:
78
- cls.dparser = subparser
79
+ command.add_args(cls.dparser)
79
80
  command.add_args(subparser)
80
81
  for handler in cls.handlers:
81
82
  handler.add_args(cls.parser)
83
+ # Throws ArgumentError if the default command includes an optional
84
+ # argument that overlaps with one of the handlers
82
85
  handler.add_args(cls.dparser)
83
86
 
84
87
  def __init__(self, **vals):
@@ -110,3 +113,8 @@ class WizApp:
110
113
  print()
111
114
  if command.status:
112
115
  print(command.status, file=sys.stderr)
116
+
117
+ def parse_run(self, *args):
118
+ """For testing, parse just the command part and tun"""
119
+ ns = self.parser.parse_args(args)
120
+ self.run(**vars(ns))
wizlib/super_wrapper.py CHANGED
@@ -5,4 +5,5 @@ class SuperWrapper:
5
5
  def wrapper(self, *args, **kwargs):
6
6
  parent_method = getattr(parent_class, method.__name__)
7
7
  return parent_method(self, method, *args, **kwargs)
8
+ wrapper.__name__ = method.__name__
8
9
  return wrapper
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: wizlib
3
- Version: 3.1.1
3
+ Version: 3.1.3
4
4
  Summary: Framework for flexible and powerful command-line applications
5
5
  License: MIT
6
6
  Author: Steampunk Wizard
@@ -1,5 +1,5 @@
1
1
  wizlib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- wizlib/app.py,sha256=PT8iiXGes38PNKtuybTKGFdzTBgc8FuGpEytfrICNps,3795
2
+ wizlib/app.py,sha256=ke0NbaYC6ArmdtLTySl6VIGIGicxTsIuzW9wag6b7rU,4180
3
3
  wizlib/class_family.py,sha256=tORSVAaPeWTQMcz2DX-MQClj1GQR3vCmkALPXxHa_pk,4506
4
4
  wizlib/command.py,sha256=NO1558EYuXxfkpSmX6ljjzae8n8g4w6yytZKTJtigvo,1708
5
5
  wizlib/config_handler.py,sha256=hoDavSMiGM_7PAHI8XIwC8nxPWOZDk302ryyjluoLGg,2588
@@ -7,13 +7,13 @@ wizlib/error.py,sha256=ypwdMOYhtgKWd48ccfOX8idmCXmm-Skwx3gkPwqJB3c,46
7
7
  wizlib/handler.py,sha256=Oz80aPhDyeY9tdppZ1dvtN-19JU5ydEDVW6jtppVoD4,446
8
8
  wizlib/parser.py,sha256=yLHV0fENeApFomCRWa3I6sB1x4lk1ag4vKejWVsic64,1550
9
9
  wizlib/stream_handler.py,sha256=i1EgcBrDiYhFK-CI8At7JtUtMCNunJmSkJLSlili-as,663
10
- wizlib/super_wrapper.py,sha256=F834ytHqA7zegTD1ezk_uxlF9PLygh84wReuiqcI7BI,272
10
+ wizlib/super_wrapper.py,sha256=msitlfFfEwnrskzTtQBEY975sh9TQPicdLVo67imuqU,315
11
11
  wizlib/ui/__init__.py,sha256=ve_p_g4aBujh4jIJMgKkJ6cE5PT0aeY5AgRlneDswGg,4241
12
12
  wizlib/ui/shell/__init__.py,sha256=sPrYe4bG_Xf7Nwssx_dqXVk9jeyYBFUjh4oLdlSOeRY,943
13
13
  wizlib/ui/shell/line_editor.py,sha256=frpsqU5NggcvEz3XeB8YyqgmlExlyx6K1CKPzvARtPk,7419
14
14
  wizlib/ui/shell_ui.py,sha256=f2GErMJg09GPZDS4uK0q8Qq8WEssQFP1dqQyg4ycznI,2029
15
15
  wizlib/ui_handler.py,sha256=JoZadtw9DKAtGvHKP3_BJF2NaYqmcQYNdsY4PeRnOjg,634
16
16
  wizlib/util.py,sha256=x1SyL3iXot0ET2r8Jjb2ySTd_J-3Uu7J1b_CHvFgzew,156
17
- wizlib-3.1.1.dist-info/METADATA,sha256=JoxwvHVMdPueP_F-p_5H3qDuj0Jbxg01oYp1tZHMDI8,1780
18
- wizlib-3.1.1.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
19
- wizlib-3.1.1.dist-info/RECORD,,
17
+ wizlib-3.1.3.dist-info/METADATA,sha256=-_2ffHkPTtfdyobotsG2RFCTIwAeAWpfwk45WCSgAYo,1780
18
+ wizlib-3.1.3.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
19
+ wizlib-3.1.3.dist-info/RECORD,,
File without changes