lockss-pybasic 0.3.0.dev7__tar.gz → 0.3.0.dev8__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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lockss-pybasic
3
- Version: 0.3.0.dev7
3
+ Version: 0.3.0.dev8
4
4
  Summary: Basic Python utilities
5
5
  License: BSD-3-Clause
6
6
  License-File: LICENSE
@@ -26,7 +26,7 @@ Description-Content-Type: text/x-rst
26
26
  lockss-pybasic
27
27
  ==============
28
28
 
29
- .. |RELEASE| replace:: 0.3.0-dev7
29
+ .. |RELEASE| replace:: 0.3.0-dev8
30
30
  .. |RELEASE_DATE| replace:: NOT YET RELEASED
31
31
 
32
32
  **Latest release:** |RELEASE| (|RELEASE_DATE|)
@@ -2,7 +2,7 @@
2
2
  lockss-pybasic
3
3
  ==============
4
4
 
5
- .. |RELEASE| replace:: 0.3.0-dev7
5
+ .. |RELEASE| replace:: 0.3.0-dev8
6
6
  .. |RELEASE_DATE| replace:: NOT YET RELEASED
7
7
 
8
8
  **Latest release:** |RELEASE| (|RELEASE_DATE|)
@@ -28,7 +28,7 @@
28
28
 
29
29
  [project]
30
30
  name = "lockss-pybasic"
31
- version = "0.3.0-dev7" # Always change in __init__.py, and at release time in README.rst and CHANGELOG.rst
31
+ version = "0.3.0-dev8" # Always change in __init__.py, and at release time in README.rst and CHANGELOG.rst
32
32
  description = "Basic Python utilities"
33
33
  license = { text = "BSD-3-Clause" }
34
34
  readme = "README.rst"
@@ -36,4 +36,4 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36
36
  POSSIBILITY OF SUCH DAMAGE.
37
37
  '''.strip()
38
38
 
39
- __version__ = '0.3.0-dev7'
39
+ __version__ = '0.3.0-dev8'
@@ -77,8 +77,7 @@ class BaseNodeSpec(BaseModel):
77
77
  kind: NodeSpecKind = Field(title='Kind',
78
78
  description="This object's kind")
79
79
 
80
- id: NodeIdentifier = Field(default='',
81
- title='Node Identifier',
80
+ id: NodeIdentifier = Field(title='Node Identifier',
82
81
  description='An identifier for the node')
83
82
 
84
83
  protocol: NodeProtocolEnum = Field(default=DEFAULT_PROTOCOL,
@@ -99,9 +98,6 @@ class NodeSpec1(BaseNodeSpec):
99
98
  title='UI Port',
100
99
  description="The LOCKSS 1.x node's Web user interface port")
101
100
 
102
- def __str__(self) -> str:
103
- return f'{self.protocol.value}://{self.host}:{self.ui}'
104
-
105
101
 
106
102
  class NodeSpec2(BaseNodeSpec):
107
103
 
@@ -143,9 +139,6 @@ class NodeSpec2(BaseNodeSpec):
143
139
  title='SOAP Port',
144
140
  description="The node's SOAP Compatibility Service REST API Port")
145
141
 
146
- def __str__(self) -> str:
147
- return f'{self.protocol.value}://{self.host}:{self.repository}:{self.configuration}:{self.poller}:{self.crawler}:{self.metadata}:{self.soap}'
148
-
149
142
 
150
143
  _RE_COMPACT_NODE_SPEC: Pattern[str] = re.compile(r'((?P<protocol>https?)://)?(?P<host>[^:]+)(:(?P<repository>\d+|(?=:))(:(?P<configuration>\d+|(?=:))(:(?P<poller>\d+|(?=:))(:(?P<crawler>\d+|(?=:))(:(?P<metadata>\d+|(?=:))(:(?P<soap>\d+))?)?)?)?)?)?')
151
144
 
@@ -158,7 +151,7 @@ def _parse_compact_node_spec(compact_node_spec: CompactNodeSpec) -> dict[str, st
158
151
  mat: Optional[Match[str]] = _RE_COMPACT_NODE_SPEC.fullmatch(compact_node_spec)
159
152
  if mat is None:
160
153
  raise ValueError(f'Invalid compact node specification: {compact_node_spec}')
161
- d = dict(kind='NodeSpec', host=mat.group('host'))
154
+ d = dict(kind='NodeSpec', id=compact_node_spec, host=mat.group('host'))
162
155
  if prot := mat.group('protocol'):
163
156
  d['protocol'] = prot
164
157
  five = ('configuration', 'poller', 'crawler', 'metadata', 'soap')