specitems 1.7.7__tar.gz → 1.7.8__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.
- {specitems-1.7.7 → specitems-1.7.8}/PKG-INFO +1 -1
- {specitems-1.7.7 → specitems-1.7.8}/pyproject.toml +1 -1
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/itemmapper.py +28 -4
- {specitems-1.7.7 → specitems-1.7.8}/README.md +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/__init__.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/cite.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/clangformat.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/clihash.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/clipickle.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/clispecdoc.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/clitypeview.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/cliutil.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/cliverify.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/cliyamlquery.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/content.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/contentcommonmark.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/contentmarkdown.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/contentsphinx.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/contenttext.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/copyrights.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/getvaluesubprocess.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/glossary.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/hashutil.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/items.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/licenseinfo.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/py.typed +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/spdx.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/spec.pickle +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/specconfig.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/specdoc.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/specformatter.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/specverify.py +0 -0
- {specitems-1.7.7 → specitems-1.7.8}/src/specitems/subprocessaction.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: specitems
|
|
3
|
-
Version: 1.7.
|
|
3
|
+
Version: 1.7.8
|
|
4
4
|
Summary: Provides interfaces to work with specification items.
|
|
5
5
|
Keywords: certification,documentation,markdown,qualification,requirements-management,traceability
|
|
6
6
|
Author: The specitems Authors
|
|
@@ -257,6 +257,17 @@ class _ItemMapperContext:
|
|
|
257
257
|
return token[len(token) // 2:]
|
|
258
258
|
|
|
259
259
|
|
|
260
|
+
class _ReferenceGetValue:
|
|
261
|
+
""" Gets a value which refers to the item and takes no content of it. """
|
|
262
|
+
|
|
263
|
+
# pylint: disable=too-few-public-methods
|
|
264
|
+
def __init__(self, get_value: ItemGetValue) -> None:
|
|
265
|
+
self._get_value = get_value
|
|
266
|
+
|
|
267
|
+
def __call__(self, ctx: "ItemGetValueContext") -> Any:
|
|
268
|
+
return self._get_value(ctx)
|
|
269
|
+
|
|
270
|
+
|
|
260
271
|
class _GetValueDictionary(dict):
|
|
261
272
|
|
|
262
273
|
def __init__(self, get_value: ItemGetValue) -> None:
|
|
@@ -548,11 +559,22 @@ class ItemMapper(abc.ABC):
|
|
|
548
559
|
assert key not in get_value_map
|
|
549
560
|
get_value_map[key] = (get_value, {})
|
|
550
561
|
|
|
551
|
-
def add_get_value(self,
|
|
552
|
-
|
|
562
|
+
def add_get_value(self,
|
|
563
|
+
type_path_key: str,
|
|
564
|
+
get_value: ItemGetValue,
|
|
565
|
+
reference: bool = False) -> None:
|
|
553
566
|
"""
|
|
554
567
|
Associate the get value method with the type/key path.
|
|
555
|
-
|
|
568
|
+
|
|
569
|
+
Args:
|
|
570
|
+
type_path_key: The type path and the key path of the value.
|
|
571
|
+
get_value: The method which gets the value.
|
|
572
|
+
reference: If true, the value refers to the item and takes no
|
|
573
|
+
content of it. A mapped value of a reference does not
|
|
574
|
+
register the item as a part of the work.
|
|
575
|
+
"""
|
|
576
|
+
if reference:
|
|
577
|
+
get_value = _ReferenceGetValue(get_value)
|
|
556
578
|
self._add_get_value_map(type_path_key, (get_value, {}))
|
|
557
579
|
|
|
558
580
|
def add_get_value_dictionary(self, type_path_key: str,
|
|
@@ -625,6 +647,7 @@ class ItemMapper(abc.ABC):
|
|
|
625
647
|
"""
|
|
626
648
|
ctx = ItemGetValueContext(item, normalized_key_path.strip("/"), args,
|
|
627
649
|
item.data, self, self.get_value_map(item))
|
|
650
|
+
get_value: ItemGetValue = self.get_value_default
|
|
628
651
|
while ctx.remaining_path:
|
|
629
652
|
key_end = ctx.remaining_path.find("/")
|
|
630
653
|
if key_end >= 0:
|
|
@@ -644,7 +667,8 @@ class ItemMapper(abc.ABC):
|
|
|
644
667
|
get_value, ctx.get_value_map = ctx.get_value_map.get(
|
|
645
668
|
parts[0], (self.get_value_default, {}))
|
|
646
669
|
ctx.value = get_value(ctx)
|
|
647
|
-
|
|
670
|
+
if not isinstance(get_value, _ReferenceGetValue):
|
|
671
|
+
self.register_part(item)
|
|
648
672
|
return ctx
|
|
649
673
|
|
|
650
674
|
def map(self,
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|