lockss-pybasic 0.1.0.dev5__tar.gz → 0.1.0.dev6__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.
- {lockss_pybasic-0.1.0.dev5 → lockss_pybasic-0.1.0.dev6}/PKG-INFO +1 -1
- {lockss_pybasic-0.1.0.dev5 → lockss_pybasic-0.1.0.dev6}/pyproject.toml +1 -1
- {lockss_pybasic-0.1.0.dev5 → lockss_pybasic-0.1.0.dev6}/src/lockss/pybasic/__init__.py +1 -1
- {lockss_pybasic-0.1.0.dev5 → lockss_pybasic-0.1.0.dev6}/src/lockss/pybasic/cliutil.py +14 -9
- {lockss_pybasic-0.1.0.dev5 → lockss_pybasic-0.1.0.dev6}/LICENSE +0 -0
- {lockss_pybasic-0.1.0.dev5 → lockss_pybasic-0.1.0.dev6}/README.rst +0 -0
|
@@ -30,15 +30,20 @@
|
|
|
30
30
|
|
|
31
31
|
import sys
|
|
32
32
|
|
|
33
|
-
from pydantic.v1
|
|
33
|
+
from pydantic.v1 import BaseModel, Field
|
|
34
34
|
|
|
35
|
-
class VersionCommand
|
|
35
|
+
class VersionCommand:
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
self._version = version
|
|
41
|
-
self._validate() # Same as the Field(...) function
|
|
37
|
+
@staticmethod
|
|
38
|
+
def make(version):
|
|
39
|
+
class VersionModel(BaseModel):
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
def print_version(self, file=sys.stdout):
|
|
42
|
+
print(version, file=file)
|
|
43
|
+
sys.exit(0)
|
|
44
|
+
|
|
45
|
+
return VersionModel
|
|
46
|
+
|
|
47
|
+
@staticmethod
|
|
48
|
+
def field():
|
|
49
|
+
return Field(description='print the version number and exit')
|
|
File without changes
|
|
File without changes
|