lockss-pybasic 0.2.0.dev12__py3-none-any.whl → 0.2.0.dev14__py3-none-any.whl
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.
- lockss/pybasic/__init__.py +1 -1
- lockss/pybasic/cliutil.py +34 -1
- {lockss_pybasic-0.2.0.dev12.dist-info → lockss_pybasic-0.2.0.dev14.dist-info}/METADATA +2 -2
- lockss_pybasic-0.2.0.dev14.dist-info/RECORD +9 -0
- lockss_pybasic-0.2.0.dev12.dist-info/RECORD +0 -9
- {lockss_pybasic-0.2.0.dev12.dist-info → lockss_pybasic-0.2.0.dev14.dist-info}/WHEEL +0 -0
- {lockss_pybasic-0.2.0.dev12.dist-info → lockss_pybasic-0.2.0.dev14.dist-info}/licenses/LICENSE +0 -0
lockss/pybasic/__init__.py
CHANGED
lockss/pybasic/cliutil.py
CHANGED
|
@@ -33,9 +33,12 @@ Command line utilities.
|
|
|
33
33
|
"""
|
|
34
34
|
|
|
35
35
|
from pathlib import Path
|
|
36
|
-
from typing import Optional
|
|
36
|
+
from typing import Any, Optional
|
|
37
37
|
|
|
38
38
|
import click
|
|
39
|
+
from click.types import ParamType, IntRange
|
|
40
|
+
from click_extra import ExtraContext, HelpExtraFormatter, Style
|
|
41
|
+
from click_extra.colorize import default_theme
|
|
39
42
|
|
|
40
43
|
|
|
41
44
|
def click_path(spec: Optional[str]) -> click.Path:
|
|
@@ -98,3 +101,33 @@ def click_path(spec: Optional[str]) -> click.Path:
|
|
|
98
101
|
readable=readable,
|
|
99
102
|
resolve_path=resolve_path,
|
|
100
103
|
writable=writable)
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
def compose_decorators(*decorators):
|
|
107
|
+
def wrapped(decorated):
|
|
108
|
+
for dec in reversed(decorators):
|
|
109
|
+
decorated = dec(decorated)
|
|
110
|
+
return decorated
|
|
111
|
+
return wrapped
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
def make_extra_context_settings() -> dict[str, Any]:
|
|
115
|
+
return ExtraContext.settings(
|
|
116
|
+
formatter_settings=HelpExtraFormatter.settings(
|
|
117
|
+
theme=default_theme.with_(
|
|
118
|
+
invoked_command=Style(bold=True)
|
|
119
|
+
)
|
|
120
|
+
)
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
PositiveInt: ParamType = IntRange(min=1, max=None)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
NonNegativeInt: ParamType = IntRange(min=0, max=None)
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
NegativeInt: ParamType = IntRange(min=None, max=-1)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
NonPositiveInt: ParamType = IntRange(min=None, max=0)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: lockss-pybasic
|
|
3
|
-
Version: 0.2.0.
|
|
3
|
+
Version: 0.2.0.dev14
|
|
4
4
|
Summary: Basic Python utilities
|
|
5
5
|
License: BSD-3-Clause
|
|
6
6
|
License-File: LICENSE
|
|
@@ -24,7 +24,7 @@ Description-Content-Type: text/x-rst
|
|
|
24
24
|
lockss-pybasic
|
|
25
25
|
==============
|
|
26
26
|
|
|
27
|
-
.. |RELEASE| replace:: 0.2.0-
|
|
27
|
+
.. |RELEASE| replace:: 0.2.0-dev14
|
|
28
28
|
.. |RELEASE_DATE| replace:: NOT YET RELEASED
|
|
29
29
|
|
|
30
30
|
**Latest release:** |RELEASE| (|RELEASE_DATE|)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
lockss/pybasic/__init__.py,sha256=-ClMNdSZyY2IHG3sp-PLg7SpT57huLFgebkK2bduYhE,1679
|
|
2
|
+
lockss/pybasic/auidutil.py,sha256=o5IsRLEYROXRVS6oTO1VFtdzw7SImYSR5VcqAMHY4To,13921
|
|
3
|
+
lockss/pybasic/cliutil.py,sha256=sK8hT8BeNwYndOQyADiuFO9z39zVlBjB2BxO_M4eSVI,4606
|
|
4
|
+
lockss/pybasic/errorutil.py,sha256=XI84PScZ851_-gfoazivJ8ceieMYWaxQr7qih5ltga0,1951
|
|
5
|
+
lockss/pybasic/fileutil.py,sha256=BpdoPWL70xYTuhyQRBEurScRVnPQg0mX-XW8yyKPGjw,2958
|
|
6
|
+
lockss_pybasic-0.2.0.dev14.dist-info/METADATA,sha256=UthtKAWYyPUKX347M8M4CZvyRW8tOzSpAZqqqQ6m-qM,4145
|
|
7
|
+
lockss_pybasic-0.2.0.dev14.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
8
|
+
lockss_pybasic-0.2.0.dev14.dist-info/licenses/LICENSE,sha256=O9ONND4uDxY_jucI4jZDf2liAk05ScEJaYu-Al7EOdQ,1506
|
|
9
|
+
lockss_pybasic-0.2.0.dev14.dist-info/RECORD,,
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
lockss/pybasic/__init__.py,sha256=1lOcr-OzldJ6dU_dPaQtvOwIPE_xh0QWTxAHb5RS68I,1679
|
|
2
|
-
lockss/pybasic/auidutil.py,sha256=o5IsRLEYROXRVS6oTO1VFtdzw7SImYSR5VcqAMHY4To,13921
|
|
3
|
-
lockss/pybasic/cliutil.py,sha256=NN9PuhBN5RDO68Zxwve-CqjlgImBwAoKR0qTHJlrClY,3773
|
|
4
|
-
lockss/pybasic/errorutil.py,sha256=XI84PScZ851_-gfoazivJ8ceieMYWaxQr7qih5ltga0,1951
|
|
5
|
-
lockss/pybasic/fileutil.py,sha256=BpdoPWL70xYTuhyQRBEurScRVnPQg0mX-XW8yyKPGjw,2958
|
|
6
|
-
lockss_pybasic-0.2.0.dev12.dist-info/METADATA,sha256=WCPlzpE00yqzkHvnketszPD9QW_0rRbu-78v-8Lchvg,4145
|
|
7
|
-
lockss_pybasic-0.2.0.dev12.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
8
|
-
lockss_pybasic-0.2.0.dev12.dist-info/licenses/LICENSE,sha256=O9ONND4uDxY_jucI4jZDf2liAk05ScEJaYu-Al7EOdQ,1506
|
|
9
|
-
lockss_pybasic-0.2.0.dev12.dist-info/RECORD,,
|
|
File without changes
|
{lockss_pybasic-0.2.0.dev12.dist-info → lockss_pybasic-0.2.0.dev14.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|