PySerials 0.0.0.dev44__tar.gz → 0.0.0.dev46__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.
Files changed (24) hide show
  1. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/PKG-INFO +3 -3
  2. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/pyproject.toml +3 -3
  3. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/src/PySerials.egg-info/PKG-INFO +3 -3
  4. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/src/PySerials.egg-info/requires.txt +2 -2
  5. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/src/pyserials/update.py +18 -25
  6. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/README.md +0 -0
  7. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/setup.cfg +0 -0
  8. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/src/PySerials.egg-info/SOURCES.txt +0 -0
  9. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/src/PySerials.egg-info/dependency_links.txt +0 -0
  10. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/src/PySerials.egg-info/not-zip-safe +0 -0
  11. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/src/PySerials.egg-info/top_level.txt +0 -0
  12. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/src/pyserials/__init__.py +0 -0
  13. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/src/pyserials/compare.py +0 -0
  14. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/src/pyserials/exception/__init__.py +0 -0
  15. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/src/pyserials/exception/_base.py +0 -0
  16. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/src/pyserials/exception/read.py +0 -0
  17. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/src/pyserials/exception/update.py +0 -0
  18. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/src/pyserials/exception/validate.py +0 -0
  19. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/src/pyserials/format.py +0 -0
  20. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/src/pyserials/nested_dict.py +0 -0
  21. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/src/pyserials/property_dict.py +0 -0
  22. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/src/pyserials/read.py +0 -0
  23. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/src/pyserials/validate.py +0 -0
  24. {pyserials-0.0.0.dev44 → pyserials-0.0.0.dev46}/src/pyserials/write.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PySerials
3
- Version: 0.0.0.dev44
3
+ Version: 0.0.0.dev46
4
4
  Requires-Python: >=3.10
5
5
  Requires-Dist: jsonschema<5,>=4.21.0
6
6
  Requires-Dist: referencing>=0.35.1
@@ -8,6 +8,6 @@ Requires-Dist: jsonpath-ng<2,>=1.6.1
8
8
  Requires-Dist: ruamel.yaml<0.18,>=0.17.32
9
9
  Requires-Dist: ruamel.yaml.string<1,>=0.1.1
10
10
  Requires-Dist: tomlkit<0.12,>=0.11.8
11
- Requires-Dist: MDit==0.0.0.dev41
12
- Requires-Dist: ExceptionMan==0.0.0.dev41
11
+ Requires-Dist: MDit==0.0.0.dev43
12
+ Requires-Dist: ExceptionMan==0.0.0.dev43
13
13
  Requires-Dist: ProtocolMan==0.0.0.dev2
@@ -17,7 +17,7 @@ namespaces = true
17
17
  # ----------------------------------------- Project Metadata -------------------------------------
18
18
  #
19
19
  [project]
20
- version = "0.0.0.dev44"
20
+ version = "0.0.0.dev46"
21
21
  name = "PySerials"
22
22
  dependencies = [
23
23
  "jsonschema >= 4.21.0, < 5",
@@ -26,8 +26,8 @@ dependencies = [
26
26
  "ruamel.yaml >= 0.17.32, < 0.18", # https://yaml.readthedocs.io/en/stable/
27
27
  "ruamel.yaml.string >= 0.1.1, < 1",
28
28
  "tomlkit >= 0.11.8, < 0.12", # https://tomlkit.readthedocs.io/en/stable/,
29
- "MDit == 0.0.0.dev41",
30
- "ExceptionMan == 0.0.0.dev41",
29
+ "MDit == 0.0.0.dev43",
30
+ "ExceptionMan == 0.0.0.dev43",
31
31
  "ProtocolMan == 0.0.0.dev2",
32
32
  ]
33
33
  requires-python = ">=3.10"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PySerials
3
- Version: 0.0.0.dev44
3
+ Version: 0.0.0.dev46
4
4
  Requires-Python: >=3.10
5
5
  Requires-Dist: jsonschema<5,>=4.21.0
6
6
  Requires-Dist: referencing>=0.35.1
@@ -8,6 +8,6 @@ Requires-Dist: jsonpath-ng<2,>=1.6.1
8
8
  Requires-Dist: ruamel.yaml<0.18,>=0.17.32
9
9
  Requires-Dist: ruamel.yaml.string<1,>=0.1.1
10
10
  Requires-Dist: tomlkit<0.12,>=0.11.8
11
- Requires-Dist: MDit==0.0.0.dev41
12
- Requires-Dist: ExceptionMan==0.0.0.dev41
11
+ Requires-Dist: MDit==0.0.0.dev43
12
+ Requires-Dist: ExceptionMan==0.0.0.dev43
13
13
  Requires-Dist: ProtocolMan==0.0.0.dev2
@@ -4,6 +4,6 @@ jsonpath-ng<2,>=1.6.1
4
4
  ruamel.yaml<0.18,>=0.17.32
5
5
  ruamel.yaml.string<1,>=0.1.1
6
6
  tomlkit<0.12,>=0.11.8
7
- MDit==0.0.0.dev41
8
- ExceptionMan==0.0.0.dev41
7
+ MDit==0.0.0.dev43
8
+ ExceptionMan==0.0.0.dev43
9
9
  ProtocolMan==0.0.0.dev2
@@ -335,21 +335,7 @@ class TemplateFiller:
335
335
  template_end=self._marker_end_value,
336
336
  )
337
337
 
338
- # if not internal:
339
- # self._path_history.append(current_path)
340
- # loop = self._find_loop()
341
- # if loop:
342
- # loop_str = "\n".join([f"- {path.replace("'", "")}" for path in loop])
343
- # raise _exception.update.PySerialsUpdateTemplatedDataError(
344
- # description_template=f"Path {{path_invalid}} starts a loop: {loop_str}",
345
- # path_invalid=loop[0],
346
- # path=current_path,
347
- # data=templ,
348
- # data_full=self._data,
349
- # data_source=self._source,
350
- # template_start=self._marker_start_value,
351
- # template_end=self._marker_end_value,
352
- # )
338
+ self._check_endless_loop(templ, current_chain)
353
339
 
354
340
  if isinstance(templ, str):
355
341
  # Handle value blocks
@@ -438,16 +424,23 @@ class TemplateFiller:
438
424
  return new_dict
439
425
  return templ
440
426
 
441
- # def _find_loop(self):
442
- # for pattern_length in range(1, len(self._path_history) // 2 + 1):
443
- # # Slice the end of the list into two consecutive patterns
444
- # pattern = self._path_history[-pattern_length:]
445
- # previous_pattern = self._path_history[-2 * pattern_length:-pattern_length]
446
- # # Check if the two patterns are the same
447
- # if pattern == previous_pattern:
448
- # pattern.insert(0, pattern[-1])
449
- # return pattern
450
- # return
427
+ def _check_endless_loop(self,templ, chain: list[str]):
428
+ last_idx = len(chain) -1
429
+ first_idx = chain.index(chain[-1])
430
+ if first_idx == last_idx:
431
+ return
432
+ loop = chain[first_idx - 1: -1]
433
+ loop_str = "\n".join([f"- {path.replace("'", "")}" for path in loop])
434
+ raise _exception.update.PySerialsUpdateTemplatedDataError(
435
+ description_template=f"Path {{path_invalid}} starts a loop:\n{loop_str}",
436
+ path_invalid=loop[0],
437
+ path=chain[-1],
438
+ data=templ,
439
+ data_full=self._data,
440
+ data_source=self._data,
441
+ template_start=self._marker_start_value,
442
+ template_end=self._marker_end_value,
443
+ )
451
444
 
452
445
  def _get_value_regex_pattern(self, level: int = 0) -> _RegexPattern:
453
446
  if level in self._pattern_value: