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.
@@ -1,22 +1,21 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: k3shell
3
- Version: 0.1.4
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
- Requires-Python: >=3.9
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
  [![Action-CI](https://github.com/pykit3/k3shell/actions/workflows/python-package.yml/badge.svg)](https://github.com/pykit3/k3shell/actions/workflows/python-package.yml)
41
- [![Build Status](https://travis-ci.com/pykit3/k3shell.svg?branch=master)](https://travis-ci.com/pykit3/k3shell)
42
40
  [![Documentation Status](https://readthedocs.org/projects/k3shell/badge/?version=stable)](https://k3shell.readthedocs.io/en/stable/?badge=stable)
43
41
  [![Package](https://img.shields.io/pypi/pyversions/k3shell)](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
- import sys
71
+
73
72
  arguments = {
74
- 'echo_repr': (
73
+ "echo_repr": (
75
74
  lambda x: sys.stdout.write(repr(x)),
76
- ('x', {'nargs': '+', 'help': 'just an input message'}),
75
+ ("x", {"nargs": "+", "help": "just an input message"}),
77
76
  ),
78
-
79
- 'foo': {
80
- 'bar': lambda: sys.stdout.write('bar'),
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
- ('x', {'type': int, help: 'an int is needed'}),
86
- ('y', {'type': int, help: 'an int is needed'}),
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
- '__add_help__': {
92
- ('echo_repr',) : 'output what is input.',
93
- ('foo', 'bar',) : 'print a "bar".',
94
- ('foo', 'bob', 'plus',) : 'do addition operation with 2 numbers.',
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
- Wenbo Li(李文博) <wenbo.li@baishancloud.com>
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) 2017 Wenbo Li(李文博) <wenbo.li@baishancloud.com>
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
  [![Action-CI](https://github.com/pykit3/k3shell/actions/workflows/python-package.yml/badge.svg)](https://github.com/pykit3/k3shell/actions/workflows/python-package.yml)
4
- [![Build Status](https://travis-ci.com/pykit3/k3shell.svg?branch=master)](https://travis-ci.com/pykit3/k3shell)
5
4
  [![Documentation Status](https://readthedocs.org/projects/k3shell/badge/?version=stable)](https://k3shell.readthedocs.io/en/stable/?badge=stable)
6
5
  [![Package](https://img.shields.io/pypi/pyversions/k3shell)](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
- import sys
35
+
36
36
  arguments = {
37
- 'echo_repr': (
37
+ "echo_repr": (
38
38
  lambda x: sys.stdout.write(repr(x)),
39
- ('x', {'nargs': '+', 'help': 'just an input message'}),
39
+ ("x", {"nargs": "+", "help": "just an input message"}),
40
40
  ),
41
-
42
- 'foo': {
43
- 'bar': lambda: sys.stdout.write('bar'),
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
- ('x', {'type': int, help: 'an int is needed'}),
49
- ('y', {'type': int, help: 'an int is needed'}),
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
- '__add_help__': {
55
- ('echo_repr',) : 'output what is input.',
56
- ('foo', 'bar',) : 'print a "bar".',
57
- ('foo', 'bob', 'plus',) : 'do addition operation with 2 numbers.',
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
- Wenbo Li(李文博) <wenbo.li@baishancloud.com>
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) 2017 Wenbo Li(李文博) <wenbo.li@baishancloud.com>
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(repr(e))
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(repr(e))
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.4
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
- Requires-Python: >=3.9
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
  [![Action-CI](https://github.com/pykit3/k3shell/actions/workflows/python-package.yml/badge.svg)](https://github.com/pykit3/k3shell/actions/workflows/python-package.yml)
41
- [![Build Status](https://travis-ci.com/pykit3/k3shell.svg?branch=master)](https://travis-ci.com/pykit3/k3shell)
42
40
  [![Documentation Status](https://readthedocs.org/projects/k3shell/badge/?version=stable)](https://k3shell.readthedocs.io/en/stable/?badge=stable)
43
41
  [![Package](https://img.shields.io/pypi/pyversions/k3shell)](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
- import sys
71
+
73
72
  arguments = {
74
- 'echo_repr': (
73
+ "echo_repr": (
75
74
  lambda x: sys.stdout.write(repr(x)),
76
- ('x', {'nargs': '+', 'help': 'just an input message'}),
75
+ ("x", {"nargs": "+", "help": "just an input message"}),
77
76
  ),
78
-
79
- 'foo': {
80
- 'bar': lambda: sys.stdout.write('bar'),
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
- ('x', {'type': int, help: 'an int is needed'}),
86
- ('y', {'type': int, help: 'an int is needed'}),
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
- '__add_help__': {
92
- ('echo_repr',) : 'output what is input.',
93
- ('foo', 'bar',) : 'print a "bar".',
94
- ('foo', 'bob', 'plus',) : 'do addition operation with 2 numbers.',
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
- Wenbo Li(李文博) <wenbo.li@baishancloud.com>
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) 2017 Wenbo Li(李文博) <wenbo.li@baishancloud.com>
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>=61.0"]
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.4"
7
+ version = "0.1.6"
8
8
  description = "Shell command dispatcher with nested subcommand support"
9
9
  readme = "README.md"
10
- license = {text = "MIT"}
11
- requires-python = ">=3.9"
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,6 +1,7 @@
1
- import k3shell
2
1
  import sys
3
2
 
3
+ import k3shell
4
+
4
5
  arguments = {
5
6
  "echo_repr": (
6
7
  lambda x: sys.stdout.write(repr(x)),
@@ -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 EnvironmentError as e:
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