k3shell 0.1.4__tar.gz → 0.1.6__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.4 → k3shell-0.1.6}/PKG-INFO +28 -26
- {k3shell-0.1.4 → k3shell-0.1.6}/README.md +24 -21
- {k3shell-0.1.4 → k3shell-0.1.6}/command.py +3 -6
- {k3shell-0.1.4 → k3shell-0.1.6}/k3shell.egg-info/PKG-INFO +28 -26
- {k3shell-0.1.4 → k3shell-0.1.6}/pyproject.toml +5 -6
- {k3shell-0.1.4 → k3shell-0.1.6}/synopsis.py +2 -1
- {k3shell-0.1.4 → k3shell-0.1.6}/test/test_k3shell.py +4 -4
- {k3shell-0.1.4 → k3shell-0.1.6}/LICENSE +0 -0
- {k3shell-0.1.4 → k3shell-0.1.6}/__init__.py +0 -0
- {k3shell-0.1.4 → k3shell-0.1.6}/k3shell.egg-info/SOURCES.txt +0 -0
- {k3shell-0.1.4 → k3shell-0.1.6}/k3shell.egg-info/dependency_links.txt +0 -0
- {k3shell-0.1.4 → k3shell-0.1.6}/k3shell.egg-info/requires.txt +0 -0
- {k3shell-0.1.4 → k3shell-0.1.6}/k3shell.egg-info/top_level.txt +0 -0
- {k3shell-0.1.4 → k3shell-0.1.6}/setup.cfg +0 -0
- {k3shell-0.1.4 → k3shell-0.1.6}/test/test_doctest.py +0 -0
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: k3shell
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.6
|
|
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
|
+
Requires-Python: >=3.10
|
|
20
19
|
Description-Content-Type: text/markdown
|
|
21
20
|
License-File: LICENSE
|
|
22
21
|
Requires-Dist: k3dict
|
|
@@ -38,7 +37,6 @@ Dynamic: license-file
|
|
|
38
37
|
# k3shell
|
|
39
38
|
|
|
40
39
|
[](https://github.com/pykit3/k3shell/actions/workflows/python-package.yml)
|
|
41
|
-
[](https://travis-ci.com/pykit3/k3shell)
|
|
42
40
|
[](https://k3shell.readthedocs.io/en/stable/?badge=stable)
|
|
43
41
|
[](https://pypi.org/project/k3shell)
|
|
44
42
|
|
|
@@ -67,34 +65,38 @@ pip install k3shell
|
|
|
67
65
|
# Synopsis
|
|
68
66
|
|
|
69
67
|
```python
|
|
68
|
+
import sys
|
|
70
69
|
|
|
71
70
|
import k3shell
|
|
72
|
-
|
|
71
|
+
|
|
73
72
|
arguments = {
|
|
74
|
-
|
|
73
|
+
"echo_repr": (
|
|
75
74
|
lambda x: sys.stdout.write(repr(x)),
|
|
76
|
-
(
|
|
75
|
+
("x", {"nargs": "+", "help": "just an input message"}),
|
|
77
76
|
),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
'bob': {
|
|
83
|
-
'plus': (
|
|
77
|
+
"foo": {
|
|
78
|
+
"bar": lambda: sys.stdout.write("bar"),
|
|
79
|
+
"bob": {
|
|
80
|
+
"plus": (
|
|
84
81
|
lambda x, y: sys.stdout.write(str(x + y)),
|
|
85
|
-
(
|
|
86
|
-
(
|
|
82
|
+
("x", {"type": int, help: "an int is needed"}),
|
|
83
|
+
("y", {"type": int, help: "an int is needed"}),
|
|
87
84
|
),
|
|
88
85
|
},
|
|
89
86
|
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
(
|
|
93
|
-
|
|
94
|
-
|
|
87
|
+
"__add_help__": {
|
|
88
|
+
("echo_repr",): "output what is input.",
|
|
89
|
+
(
|
|
90
|
+
"foo",
|
|
91
|
+
"bar",
|
|
92
|
+
): 'print a "bar".',
|
|
93
|
+
(
|
|
94
|
+
"foo",
|
|
95
|
+
"bob",
|
|
96
|
+
"plus",
|
|
97
|
+
): "do addition operation with 2 numbers.",
|
|
95
98
|
},
|
|
96
|
-
|
|
97
|
-
'__description__': 'this is an example command.',
|
|
99
|
+
"__description__": "this is an example command.",
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
k3shell.command(**arguments)
|
|
@@ -146,13 +148,13 @@ optional arguments:
|
|
|
146
148
|
|
|
147
149
|
# Author
|
|
148
150
|
|
|
149
|
-
|
|
151
|
+
Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>
|
|
150
152
|
|
|
151
153
|
# Copyright and License
|
|
152
154
|
|
|
153
155
|
The MIT License (MIT)
|
|
154
156
|
|
|
155
|
-
Copyright (c)
|
|
157
|
+
Copyright (c) 2015 Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>
|
|
156
158
|
|
|
157
159
|
|
|
158
160
|
[pykit3]: https://github.com/pykit3
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
# k3shell
|
|
2
2
|
|
|
3
3
|
[](https://github.com/pykit3/k3shell/actions/workflows/python-package.yml)
|
|
4
|
-
[](https://travis-ci.com/pykit3/k3shell)
|
|
5
4
|
[](https://k3shell.readthedocs.io/en/stable/?badge=stable)
|
|
6
5
|
[](https://pypi.org/project/k3shell)
|
|
7
6
|
|
|
@@ -30,34 +29,38 @@ pip install k3shell
|
|
|
30
29
|
# Synopsis
|
|
31
30
|
|
|
32
31
|
```python
|
|
32
|
+
import sys
|
|
33
33
|
|
|
34
34
|
import k3shell
|
|
35
|
-
|
|
35
|
+
|
|
36
36
|
arguments = {
|
|
37
|
-
|
|
37
|
+
"echo_repr": (
|
|
38
38
|
lambda x: sys.stdout.write(repr(x)),
|
|
39
|
-
(
|
|
39
|
+
("x", {"nargs": "+", "help": "just an input message"}),
|
|
40
40
|
),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
'bob': {
|
|
46
|
-
'plus': (
|
|
41
|
+
"foo": {
|
|
42
|
+
"bar": lambda: sys.stdout.write("bar"),
|
|
43
|
+
"bob": {
|
|
44
|
+
"plus": (
|
|
47
45
|
lambda x, y: sys.stdout.write(str(x + y)),
|
|
48
|
-
(
|
|
49
|
-
(
|
|
46
|
+
("x", {"type": int, help: "an int is needed"}),
|
|
47
|
+
("y", {"type": int, help: "an int is needed"}),
|
|
50
48
|
),
|
|
51
49
|
},
|
|
52
50
|
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
(
|
|
56
|
-
|
|
57
|
-
|
|
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.",
|
|
58
62
|
},
|
|
59
|
-
|
|
60
|
-
'__description__': 'this is an example command.',
|
|
63
|
+
"__description__": "this is an example command.",
|
|
61
64
|
}
|
|
62
65
|
|
|
63
66
|
k3shell.command(**arguments)
|
|
@@ -109,13 +112,13 @@ optional arguments:
|
|
|
109
112
|
|
|
110
113
|
# Author
|
|
111
114
|
|
|
112
|
-
|
|
115
|
+
Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>
|
|
113
116
|
|
|
114
117
|
# Copyright and License
|
|
115
118
|
|
|
116
119
|
The MIT License (MIT)
|
|
117
120
|
|
|
118
|
-
Copyright (c)
|
|
121
|
+
Copyright (c) 2015 Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>
|
|
119
122
|
|
|
120
123
|
|
|
121
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,21 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: k3shell
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.6
|
|
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
|
+
Requires-Python: >=3.10
|
|
20
19
|
Description-Content-Type: text/markdown
|
|
21
20
|
License-File: LICENSE
|
|
22
21
|
Requires-Dist: k3dict
|
|
@@ -38,7 +37,6 @@ Dynamic: license-file
|
|
|
38
37
|
# k3shell
|
|
39
38
|
|
|
40
39
|
[](https://github.com/pykit3/k3shell/actions/workflows/python-package.yml)
|
|
41
|
-
[](https://travis-ci.com/pykit3/k3shell)
|
|
42
40
|
[](https://k3shell.readthedocs.io/en/stable/?badge=stable)
|
|
43
41
|
[](https://pypi.org/project/k3shell)
|
|
44
42
|
|
|
@@ -67,34 +65,38 @@ pip install k3shell
|
|
|
67
65
|
# Synopsis
|
|
68
66
|
|
|
69
67
|
```python
|
|
68
|
+
import sys
|
|
70
69
|
|
|
71
70
|
import k3shell
|
|
72
|
-
|
|
71
|
+
|
|
73
72
|
arguments = {
|
|
74
|
-
|
|
73
|
+
"echo_repr": (
|
|
75
74
|
lambda x: sys.stdout.write(repr(x)),
|
|
76
|
-
(
|
|
75
|
+
("x", {"nargs": "+", "help": "just an input message"}),
|
|
77
76
|
),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
'bob': {
|
|
83
|
-
'plus': (
|
|
77
|
+
"foo": {
|
|
78
|
+
"bar": lambda: sys.stdout.write("bar"),
|
|
79
|
+
"bob": {
|
|
80
|
+
"plus": (
|
|
84
81
|
lambda x, y: sys.stdout.write(str(x + y)),
|
|
85
|
-
(
|
|
86
|
-
(
|
|
82
|
+
("x", {"type": int, help: "an int is needed"}),
|
|
83
|
+
("y", {"type": int, help: "an int is needed"}),
|
|
87
84
|
),
|
|
88
85
|
},
|
|
89
86
|
},
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
(
|
|
93
|
-
|
|
94
|
-
|
|
87
|
+
"__add_help__": {
|
|
88
|
+
("echo_repr",): "output what is input.",
|
|
89
|
+
(
|
|
90
|
+
"foo",
|
|
91
|
+
"bar",
|
|
92
|
+
): 'print a "bar".',
|
|
93
|
+
(
|
|
94
|
+
"foo",
|
|
95
|
+
"bob",
|
|
96
|
+
"plus",
|
|
97
|
+
): "do addition operation with 2 numbers.",
|
|
95
98
|
},
|
|
96
|
-
|
|
97
|
-
'__description__': 'this is an example command.',
|
|
99
|
+
"__description__": "this is an example command.",
|
|
98
100
|
}
|
|
99
101
|
|
|
100
102
|
k3shell.command(**arguments)
|
|
@@ -146,13 +148,13 @@ optional arguments:
|
|
|
146
148
|
|
|
147
149
|
# Author
|
|
148
150
|
|
|
149
|
-
|
|
151
|
+
Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>
|
|
150
152
|
|
|
151
153
|
# Copyright and License
|
|
152
154
|
|
|
153
155
|
The MIT License (MIT)
|
|
154
156
|
|
|
155
|
-
Copyright (c)
|
|
157
|
+
Copyright (c) 2015 Zhang Yanpo (张炎泼) <drdr.xp@gmail.com>
|
|
156
158
|
|
|
157
159
|
|
|
158
160
|
[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.6"
|
|
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,11 @@ 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",
|
|
26
25
|
]
|
|
27
26
|
dependencies = [
|
|
28
27
|
"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
|