cli2 2.6.3__tar.gz → 2.6.4__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.
- {cli2-2.6.3/cli2.egg-info → cli2-2.6.4}/PKG-INFO +1 -1
- {cli2-2.6.3 → cli2-2.6.4}/cli2/group.py +5 -1
- {cli2-2.6.3 → cli2-2.6.4}/cli2/test_group.py +17 -0
- {cli2-2.6.3 → cli2-2.6.4/cli2.egg-info}/PKG-INFO +1 -1
- {cli2-2.6.3 → cli2-2.6.4}/setup.py +1 -1
- {cli2-2.6.3 → cli2-2.6.4}/MANIFEST.in +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/README.rst +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/classifiers.txt +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/cli2/__init__.py +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/cli2/argument.py +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/cli2/cli.py +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/cli2/colors.py +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/cli2/command.py +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/cli2/decorators.py +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/cli2/entry_point.py +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/cli2/node.py +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/cli2/table.py +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/cli2/test.py +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/cli2/test_cli.py +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/cli2/test_command.py +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/cli2/test_decorators.py +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/cli2/test_entrypoint.py +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/cli2/test_inject.py +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/cli2/test_node.py +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/cli2/test_table.py +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/cli2.egg-info/SOURCES.txt +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/cli2.egg-info/dependency_links.txt +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/cli2.egg-info/entry_points.txt +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/cli2.egg-info/requires.txt +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/cli2.egg-info/top_level.txt +0 -0
- {cli2-2.6.3 → cli2-2.6.4}/setup.cfg +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import inspect
|
|
2
|
+
import textwrap
|
|
2
3
|
|
|
3
4
|
from .colors import colors
|
|
4
5
|
from .command import Command
|
|
@@ -13,7 +14,10 @@ class Group(EntryPoint, dict):
|
|
|
13
14
|
def __init__(self, name=None, doc=None, color=None, posix=False,
|
|
14
15
|
outfile=None, cmdclass=None, log=True):
|
|
15
16
|
self.name = name
|
|
16
|
-
|
|
17
|
+
if doc:
|
|
18
|
+
self.doc = textwrap.dedent(doc).strip()
|
|
19
|
+
else:
|
|
20
|
+
self.doc = inspect.getdoc(self)
|
|
17
21
|
self.color = color or colors.green
|
|
18
22
|
self.posix = posix
|
|
19
23
|
self.parent = None
|
|
@@ -54,6 +54,23 @@ def test_help():
|
|
|
54
54
|
group('help', 'lol')
|
|
55
55
|
assert 'not found' in group.outfile
|
|
56
56
|
|
|
57
|
+
group.group(
|
|
58
|
+
"test",
|
|
59
|
+
doc="""
|
|
60
|
+
Le Lorem Ipsum est simplement du faux texte employé dans la composition
|
|
61
|
+
et la mise en page avant impression. Le Lorem Ipsum est le faux texte
|
|
62
|
+
|
|
63
|
+
standard de l'imprimerie depuis les années 1500, quand un imprimeur
|
|
64
|
+
anonyme assembla ensemble des morceaux de texte pour réaliser un livre
|
|
65
|
+
applications de mise en page de texte, comme Aldus PageMaker.
|
|
66
|
+
"""
|
|
67
|
+
)
|
|
68
|
+
group.outfile.reset()
|
|
69
|
+
group('help')
|
|
70
|
+
assert group.outfile.out.endswith("avant impression\n")
|
|
71
|
+
group.outfile.reset()
|
|
72
|
+
group('help', 'test')
|
|
73
|
+
|
|
57
74
|
|
|
58
75
|
def test_help_nested():
|
|
59
76
|
def c(): 'cdoc'
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|