wizlib 1.1.2__tar.gz → 1.1.5__tar.gz
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-1.1.2 → wizlib-1.1.5}/PKG-INFO +4 -3
- {wizlib-1.1.2 → wizlib-1.1.5}/README.md +1 -1
- {wizlib-1.1.2 → wizlib-1.1.5}/pyproject.toml +3 -3
- {wizlib-1.1.2 → wizlib-1.1.5}/wizlib/command_handler.py +9 -12
- {wizlib-1.1.2 → wizlib-1.1.5}/wizlib/__init__.py +0 -0
- {wizlib-1.1.2 → wizlib-1.1.5}/wizlib/class_family.py +0 -0
- {wizlib-1.1.2 → wizlib-1.1.5}/wizlib/config_machine.py +0 -0
- {wizlib-1.1.2 → wizlib-1.1.5}/wizlib/rlinput.py +0 -0
- {wizlib-1.1.2 → wizlib-1.1.5}/wizlib/super_wrapper.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: wizlib
|
|
3
|
-
Version: 1.1.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 1.1.5
|
|
4
|
+
Summary: Framework for flexible and powerful command-line applications
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Steampunk Wizard
|
|
7
7
|
Author-email: wizlib@steampunkwizard.ca
|
|
@@ -10,12 +10,13 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
10
10
|
Classifier: Programming Language :: Python :: 3
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
12
12
|
Requires-Dist: PyYAML (>=6.0.1,<7.0.0)
|
|
13
|
+
Requires-Dist: gnureadline (>=8.1.2,<9.0.0) ; sys_platform == "darwin"
|
|
13
14
|
Requires-Dist: pyreadline3 (>=3.4.1,<4.0.0) ; sys_platform == "win32"
|
|
14
15
|
Description-Content-Type: text/markdown
|
|
15
16
|
|
|
16
17
|
# WizLib
|
|
17
18
|
|
|
18
|
-
|
|
19
|
+
Framework for flexible and powerful command-line applications
|
|
19
20
|
|
|
20
21
|
## ClassFamily
|
|
21
22
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "wizlib"
|
|
3
|
-
version = "1.1.
|
|
4
|
-
description = "
|
|
3
|
+
version = "1.1.5"
|
|
4
|
+
description = "Framework for flexible and powerful command-line applications"
|
|
5
5
|
authors = ["Steampunk Wizard <wizlib@steampunkwizard.ca>"]
|
|
6
6
|
license = "MIT"
|
|
7
7
|
readme = "README.md"
|
|
@@ -10,7 +10,7 @@ readme = "README.md"
|
|
|
10
10
|
python = ">=3.11,<3.12"
|
|
11
11
|
PyYAML = "^6.0.1"
|
|
12
12
|
pyreadline3 = { version="^3.4.1", markers="sys_platform=='win32'" }
|
|
13
|
-
|
|
13
|
+
gnureadline = { version="^8.1.2", markers="sys_platform=='darwin'" }
|
|
14
14
|
|
|
15
15
|
[tool.poetry.group.dev.dependencies]
|
|
16
16
|
coverage = "^7.3.1"
|
|
@@ -2,6 +2,7 @@ import sys
|
|
|
2
2
|
from argparse import ArgumentError, ArgumentParser
|
|
3
3
|
from dataclasses import dataclass
|
|
4
4
|
import os
|
|
5
|
+
from pathlib import Path
|
|
5
6
|
|
|
6
7
|
from wizlib.class_family import ClassFamily
|
|
7
8
|
from wizlib.super_wrapper import SuperWrapper
|
|
@@ -31,13 +32,7 @@ class CommandHandler:
|
|
|
31
32
|
|
|
32
33
|
def get_command(self, args=None):
|
|
33
34
|
args = args if args else [self.atriarch.default]
|
|
34
|
-
|
|
35
|
-
values = vars(self.parser.parse_args(args))
|
|
36
|
-
except ArgumentError as error:
|
|
37
|
-
print(error.message)
|
|
38
|
-
return
|
|
39
|
-
except SystemExit:
|
|
40
|
-
return
|
|
35
|
+
values = vars(self.parser.parse_args(args))
|
|
41
36
|
command = values.pop('command')
|
|
42
37
|
command_class = self.atriarch.family_member('name', command)
|
|
43
38
|
if not command_class:
|
|
@@ -79,20 +74,22 @@ class Command(ClassFamily, SuperWrapper):
|
|
|
79
74
|
@classmethod
|
|
80
75
|
def add_app_args(self, parser):
|
|
81
76
|
"""Add pre-subcommand arguments via argparse by optionally overriding -
|
|
82
|
-
only works in the atricarch.
|
|
77
|
+
only works in the atricarch. Default is an optional 'input' argument to
|
|
78
|
+
take the place of stdin in testing"""
|
|
79
|
+
parser.add_argument('--input', '-i', default='')
|
|
83
80
|
pass
|
|
84
81
|
|
|
85
82
|
@classmethod
|
|
86
83
|
def add_args(self, parser):
|
|
87
84
|
"""Add arguments to the command's parser - override this.
|
|
88
|
-
Add global arguments in the base class. Not wrapped.
|
|
89
|
-
optional 'input' argument to take the place of stdin in testing"""
|
|
90
|
-
parser.add_argument('--input', '-i', default='')
|
|
85
|
+
Add global arguments in the base class. Not wrapped."""
|
|
91
86
|
|
|
92
87
|
def handle_args(self):
|
|
93
88
|
"""Clean up args, calculate any, ask through UI, etc. - override
|
|
94
89
|
this. For input, default is to grab stdin in non-tty cases."""
|
|
95
|
-
if
|
|
90
|
+
if self.input:
|
|
91
|
+
self.input = Path(self.input).read_text()
|
|
92
|
+
elif not sys.stdin.isatty():
|
|
96
93
|
self.input = sys.stdin.read()
|
|
97
94
|
|
|
98
95
|
def execute(self, method, *args, **kwargs):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|