k3shell 0.1.5__tar.gz → 0.1.7__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.
- {k3shell-0.1.5 → k3shell-0.1.7}/PKG-INFO +29 -25
- {k3shell-0.1.5 → k3shell-0.1.7}/README.md +24 -20
- {k3shell-0.1.5 → k3shell-0.1.7}/command.py +3 -6
- {k3shell-0.1.5 → k3shell-0.1.7}/k3shell.egg-info/PKG-INFO +29 -25
- {k3shell-0.1.5 → k3shell-0.1.7}/pyproject.toml +6 -6
- {k3shell-0.1.5 → k3shell-0.1.7}/synopsis.py +2 -1
- {k3shell-0.1.5 → k3shell-0.1.7}/test/test_k3shell.py +4 -4
- {k3shell-0.1.5 → k3shell-0.1.7}/LICENSE +0 -0
- {k3shell-0.1.5 → k3shell-0.1.7}/__init__.py +0 -0
- {k3shell-0.1.5 → k3shell-0.1.7}/k3shell.egg-info/SOURCES.txt +0 -0
- {k3shell-0.1.5 → k3shell-0.1.7}/k3shell.egg-info/dependency_links.txt +0 -0
- {k3shell-0.1.5 → k3shell-0.1.7}/k3shell.egg-info/requires.txt +0 -0
- {k3shell-0.1.5 → k3shell-0.1.7}/k3shell.egg-info/top_level.txt +0 -0
- {k3shell-0.1.5 → k3shell-0.1.7}/setup.cfg +0 -0
- {k3shell-0.1.5 → k3shell-0.1.7}/test/test_doctest.py +0 -0
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: k3shell
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.7
|
|
4
4
|
Summary: Shell command dispatcher with nested subcommand support
|
|
5
5
|
Author-email: Zhang Yanpo <drdr.xp@gmail.com>
|
|
6
|
-
License: MIT
|
|
6
|
+
License-Expression: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/pykit3/k3shell
|
|
8
8
|
Project-URL: Documentation, https://k3shell.readthedocs.io
|
|
9
9
|
Keywords: shell,command,cli,subcommand,argparse
|
|
10
10
|
Classifier: Development Status :: 4 - Beta
|
|
11
11
|
Classifier: Intended Audience :: Developers
|
|
12
12
|
Classifier: Topic :: Software Development :: Libraries
|
|
13
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
14
13
|
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
16
14
|
Classifier: Programming Language :: Python :: 3.10
|
|
17
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
-
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
21
|
License-File: LICENSE
|
|
22
22
|
Requires-Dist: k3dict
|
|
@@ -66,34 +66,38 @@ pip install k3shell
|
|
|
66
66
|
# Synopsis
|
|
67
67
|
|
|
68
68
|
```python
|
|
69
|
+
import sys
|
|
69
70
|
|
|
70
71
|
import k3shell
|
|
71
|
-
|
|
72
|
+
|
|
72
73
|
arguments = {
|
|
73
|
-
|
|
74
|
+
"echo_repr": (
|
|
74
75
|
lambda x: sys.stdout.write(repr(x)),
|
|
75
|
-
(
|
|
76
|
+
("x", {"nargs": "+", "help": "just an input message"}),
|
|
76
77
|
),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
'bob': {
|
|
82
|
-
'plus': (
|
|
78
|
+
"foo": {
|
|
79
|
+
"bar": lambda: sys.stdout.write("bar"),
|
|
80
|
+
"bob": {
|
|
81
|
+
"plus": (
|
|
83
82
|
lambda x, y: sys.stdout.write(str(x + y)),
|
|
84
|
-
(
|
|
85
|
-
(
|
|
83
|
+
("x", {"type": int, help: "an int is needed"}),
|
|
84
|
+
("y", {"type": int, help: "an int is needed"}),
|
|
86
85
|
),
|
|
87
86
|
},
|
|
88
87
|
},
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
(
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
"__add_help__": {
|
|
89
|
+
("echo_repr",): "output what is input.",
|
|
90
|
+
(
|
|
91
|
+
"foo",
|
|
92
|
+
"bar",
|
|
93
|
+
): 'print a "bar".',
|
|
94
|
+
(
|
|
95
|
+
"foo",
|
|
96
|
+
"bob",
|
|
97
|
+
"plus",
|
|
98
|
+
): "do addition operation with 2 numbers.",
|
|
94
99
|
},
|
|
95
|
-
|
|
96
|
-
'__description__': 'this is an example command.',
|
|
100
|
+
"__description__": "this is an example command.",
|
|
97
101
|
}
|
|
98
102
|
|
|
99
103
|
k3shell.command(**arguments)
|
|
@@ -145,13 +149,13 @@ optional arguments:
|
|
|
145
149
|
|
|
146
150
|
# Author
|
|
147
151
|
|
|
148
|
-
|
|
152
|
+
Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>
|
|
149
153
|
|
|
150
154
|
# Copyright and License
|
|
151
155
|
|
|
152
156
|
The MIT License (MIT)
|
|
153
157
|
|
|
154
|
-
Copyright (c)
|
|
158
|
+
Copyright (c) 2015 Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>
|
|
155
159
|
|
|
156
160
|
|
|
157
161
|
[pykit3]: https://github.com/pykit3
|
|
@@ -29,34 +29,38 @@ pip install k3shell
|
|
|
29
29
|
# Synopsis
|
|
30
30
|
|
|
31
31
|
```python
|
|
32
|
+
import sys
|
|
32
33
|
|
|
33
34
|
import k3shell
|
|
34
|
-
|
|
35
|
+
|
|
35
36
|
arguments = {
|
|
36
|
-
|
|
37
|
+
"echo_repr": (
|
|
37
38
|
lambda x: sys.stdout.write(repr(x)),
|
|
38
|
-
(
|
|
39
|
+
("x", {"nargs": "+", "help": "just an input message"}),
|
|
39
40
|
),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
'bob': {
|
|
45
|
-
'plus': (
|
|
41
|
+
"foo": {
|
|
42
|
+
"bar": lambda: sys.stdout.write("bar"),
|
|
43
|
+
"bob": {
|
|
44
|
+
"plus": (
|
|
46
45
|
lambda x, y: sys.stdout.write(str(x + y)),
|
|
47
|
-
(
|
|
48
|
-
(
|
|
46
|
+
("x", {"type": int, help: "an int is needed"}),
|
|
47
|
+
("y", {"type": int, help: "an int is needed"}),
|
|
49
48
|
),
|
|
50
49
|
},
|
|
51
50
|
},
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
(
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
"__add_help__": {
|
|
52
|
+
("echo_repr",): "output what is input.",
|
|
53
|
+
(
|
|
54
|
+
"foo",
|
|
55
|
+
"bar",
|
|
56
|
+
): 'print a "bar".',
|
|
57
|
+
(
|
|
58
|
+
"foo",
|
|
59
|
+
"bob",
|
|
60
|
+
"plus",
|
|
61
|
+
): "do addition operation with 2 numbers.",
|
|
57
62
|
},
|
|
58
|
-
|
|
59
|
-
'__description__': 'this is an example command.',
|
|
63
|
+
"__description__": "this is an example command.",
|
|
60
64
|
}
|
|
61
65
|
|
|
62
66
|
k3shell.command(**arguments)
|
|
@@ -108,13 +112,13 @@ optional arguments:
|
|
|
108
112
|
|
|
109
113
|
# Author
|
|
110
114
|
|
|
111
|
-
|
|
115
|
+
Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>
|
|
112
116
|
|
|
113
117
|
# Copyright and License
|
|
114
118
|
|
|
115
119
|
The MIT License (MIT)
|
|
116
120
|
|
|
117
|
-
Copyright (c)
|
|
121
|
+
Copyright (c) 2015 Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>
|
|
118
122
|
|
|
119
123
|
|
|
120
124
|
[pykit3]: https://github.com/pykit3
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
#!/usr/bin/env python2
|
|
2
|
-
# coding: utf-8
|
|
3
|
-
|
|
4
1
|
import argparse
|
|
5
2
|
import copy
|
|
6
|
-
import sys
|
|
7
3
|
import logging
|
|
8
4
|
import os
|
|
5
|
+
import sys
|
|
9
6
|
|
|
10
7
|
import k3dict
|
|
11
8
|
|
|
@@ -61,7 +58,7 @@ def command(**kwargs):
|
|
|
61
58
|
sys.exit(1)
|
|
62
59
|
|
|
63
60
|
except Exception as e:
|
|
64
|
-
logger.exception(
|
|
61
|
+
logger.exception(f"command {cmds!r} failed")
|
|
65
62
|
sys.stderr.write(repr(e))
|
|
66
63
|
sys.exit(1)
|
|
67
64
|
|
|
@@ -81,7 +78,7 @@ def command(**kwargs):
|
|
|
81
78
|
sys.exit(2)
|
|
82
79
|
|
|
83
80
|
except Exception as e:
|
|
84
|
-
logger.exception(
|
|
81
|
+
logger.exception(f"failed to handle arguments {sys.argv[1:]!r}")
|
|
85
82
|
sys.stderr.write(repr(e))
|
|
86
83
|
sys.exit(1)
|
|
87
84
|
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: k3shell
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.7
|
|
4
4
|
Summary: Shell command dispatcher with nested subcommand support
|
|
5
5
|
Author-email: Zhang Yanpo <drdr.xp@gmail.com>
|
|
6
|
-
License: MIT
|
|
6
|
+
License-Expression: MIT
|
|
7
7
|
Project-URL: Homepage, https://github.com/pykit3/k3shell
|
|
8
8
|
Project-URL: Documentation, https://k3shell.readthedocs.io
|
|
9
9
|
Keywords: shell,command,cli,subcommand,argparse
|
|
10
10
|
Classifier: Development Status :: 4 - Beta
|
|
11
11
|
Classifier: Intended Audience :: Developers
|
|
12
12
|
Classifier: Topic :: Software Development :: Libraries
|
|
13
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
14
13
|
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
16
14
|
Classifier: Programming Language :: Python :: 3.10
|
|
17
15
|
Classifier: Programming Language :: Python :: 3.11
|
|
18
16
|
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
-
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
19
|
+
Requires-Python: >=3.10
|
|
20
20
|
Description-Content-Type: text/markdown
|
|
21
21
|
License-File: LICENSE
|
|
22
22
|
Requires-Dist: k3dict
|
|
@@ -66,34 +66,38 @@ pip install k3shell
|
|
|
66
66
|
# Synopsis
|
|
67
67
|
|
|
68
68
|
```python
|
|
69
|
+
import sys
|
|
69
70
|
|
|
70
71
|
import k3shell
|
|
71
|
-
|
|
72
|
+
|
|
72
73
|
arguments = {
|
|
73
|
-
|
|
74
|
+
"echo_repr": (
|
|
74
75
|
lambda x: sys.stdout.write(repr(x)),
|
|
75
|
-
(
|
|
76
|
+
("x", {"nargs": "+", "help": "just an input message"}),
|
|
76
77
|
),
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
'bob': {
|
|
82
|
-
'plus': (
|
|
78
|
+
"foo": {
|
|
79
|
+
"bar": lambda: sys.stdout.write("bar"),
|
|
80
|
+
"bob": {
|
|
81
|
+
"plus": (
|
|
83
82
|
lambda x, y: sys.stdout.write(str(x + y)),
|
|
84
|
-
(
|
|
85
|
-
(
|
|
83
|
+
("x", {"type": int, help: "an int is needed"}),
|
|
84
|
+
("y", {"type": int, help: "an int is needed"}),
|
|
86
85
|
),
|
|
87
86
|
},
|
|
88
87
|
},
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
(
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
"__add_help__": {
|
|
89
|
+
("echo_repr",): "output what is input.",
|
|
90
|
+
(
|
|
91
|
+
"foo",
|
|
92
|
+
"bar",
|
|
93
|
+
): 'print a "bar".',
|
|
94
|
+
(
|
|
95
|
+
"foo",
|
|
96
|
+
"bob",
|
|
97
|
+
"plus",
|
|
98
|
+
): "do addition operation with 2 numbers.",
|
|
94
99
|
},
|
|
95
|
-
|
|
96
|
-
'__description__': 'this is an example command.',
|
|
100
|
+
"__description__": "this is an example command.",
|
|
97
101
|
}
|
|
98
102
|
|
|
99
103
|
k3shell.command(**arguments)
|
|
@@ -145,13 +149,13 @@ optional arguments:
|
|
|
145
149
|
|
|
146
150
|
# Author
|
|
147
151
|
|
|
148
|
-
|
|
152
|
+
Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>
|
|
149
153
|
|
|
150
154
|
# Copyright and License
|
|
151
155
|
|
|
152
156
|
The MIT License (MIT)
|
|
153
157
|
|
|
154
|
-
Copyright (c)
|
|
158
|
+
Copyright (c) 2015 Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>
|
|
155
159
|
|
|
156
160
|
|
|
157
161
|
[pykit3]: https://github.com/pykit3
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools>=
|
|
2
|
+
requires = ["setuptools>=77.0"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "k3shell"
|
|
7
|
-
version = "0.1.
|
|
7
|
+
version = "0.1.7"
|
|
8
8
|
description = "Shell command dispatcher with nested subcommand support"
|
|
9
9
|
readme = "README.md"
|
|
10
|
-
license =
|
|
11
|
-
requires-python = ">=3.
|
|
10
|
+
license = "MIT"
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
12
|
authors = [
|
|
13
13
|
{ name = "Zhang Yanpo", email = "drdr.xp@gmail.com" }
|
|
14
14
|
]
|
|
@@ -17,12 +17,12 @@ classifiers = [
|
|
|
17
17
|
"Development Status :: 4 - Beta",
|
|
18
18
|
"Intended Audience :: Developers",
|
|
19
19
|
"Topic :: Software Development :: Libraries",
|
|
20
|
-
"License :: OSI Approved :: MIT License",
|
|
21
20
|
"Programming Language :: Python :: 3",
|
|
22
|
-
"Programming Language :: Python :: 3.9",
|
|
23
21
|
"Programming Language :: Python :: 3.10",
|
|
24
22
|
"Programming Language :: Python :: 3.11",
|
|
25
23
|
"Programming Language :: Python :: 3.12",
|
|
24
|
+
"Programming Language :: Python :: 3.13",
|
|
25
|
+
"Programming Language :: Python :: 3.14",
|
|
26
26
|
]
|
|
27
27
|
dependencies = [
|
|
28
28
|
"k3dict",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
#!/usr/bin/env python2
|
|
2
1
|
# conding: utf-8
|
|
3
2
|
|
|
4
|
-
import os
|
|
5
|
-
import unittest
|
|
6
3
|
import logging
|
|
4
|
+
import os
|
|
7
5
|
import sys
|
|
6
|
+
import unittest
|
|
7
|
+
|
|
8
8
|
import k3shell
|
|
9
9
|
|
|
10
10
|
# Python 3.10+ changed argparse help text from "optional arguments:" to "options:"
|
|
@@ -23,7 +23,7 @@ class TestCommand(unittest.TestCase):
|
|
|
23
23
|
sys.argv = self.backup_argv
|
|
24
24
|
try:
|
|
25
25
|
os.remove(self.out_buf)
|
|
26
|
-
except
|
|
26
|
+
except OSError as e:
|
|
27
27
|
sys.stderr.write(repr(e))
|
|
28
28
|
|
|
29
29
|
def execute_test(self, arguments, argv, out_str, exit_code):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|