PySerials 0.0.0.dev47__tar.gz → 0.0.0.dev48__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.dev47 → pyserials-0.0.0.dev48}/PKG-INFO +3 -3
  2. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/pyproject.toml +3 -3
  3. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/src/PySerials.egg-info/PKG-INFO +3 -3
  4. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/src/PySerials.egg-info/requires.txt +2 -2
  5. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/src/pyserials/exception/read.py +4 -3
  6. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/src/pyserials/update.py +4 -3
  7. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/README.md +0 -0
  8. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/setup.cfg +0 -0
  9. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/src/PySerials.egg-info/SOURCES.txt +0 -0
  10. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/src/PySerials.egg-info/dependency_links.txt +0 -0
  11. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/src/PySerials.egg-info/not-zip-safe +0 -0
  12. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/src/PySerials.egg-info/top_level.txt +0 -0
  13. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/src/pyserials/__init__.py +0 -0
  14. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/src/pyserials/compare.py +0 -0
  15. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/src/pyserials/exception/__init__.py +0 -0
  16. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/src/pyserials/exception/_base.py +0 -0
  17. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/src/pyserials/exception/update.py +0 -0
  18. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/src/pyserials/exception/validate.py +0 -0
  19. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/src/pyserials/format.py +0 -0
  20. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/src/pyserials/nested_dict.py +0 -0
  21. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/src/pyserials/property_dict.py +0 -0
  22. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/src/pyserials/read.py +0 -0
  23. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/src/pyserials/validate.py +0 -0
  24. {pyserials-0.0.0.dev47 → pyserials-0.0.0.dev48}/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.dev47
3
+ Version: 0.0.0.dev48
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.dev44
12
- Requires-Dist: ExceptionMan==0.0.0.dev44
11
+ Requires-Dist: MDit==0.0.0.dev45
12
+ Requires-Dist: ExceptionMan==0.0.0.dev45
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.dev47"
20
+ version = "0.0.0.dev48"
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.dev44",
30
- "ExceptionMan == 0.0.0.dev44",
29
+ "MDit == 0.0.0.dev45",
30
+ "ExceptionMan == 0.0.0.dev45",
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.dev47
3
+ Version: 0.0.0.dev48
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.dev44
12
- Requires-Dist: ExceptionMan==0.0.0.dev44
11
+ Requires-Dist: MDit==0.0.0.dev45
12
+ Requires-Dist: ExceptionMan==0.0.0.dev45
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.dev44
8
- ExceptionMan==0.0.0.dev44
7
+ MDit==0.0.0.dev45
8
+ ExceptionMan==0.0.0.dev45
9
9
  ProtocolMan==0.0.0.dev2
@@ -142,9 +142,10 @@ class PySerialsInvalidDataError(PySerialsReadException):
142
142
  self.problem = cause.problem.strip()
143
143
  if cause.context:
144
144
  self.context = cause.context.strip()
145
- self.context_line = cause.context_mark.line + 1
146
- self.context_column = cause.context_mark.column + 1
147
- self.context_data_type = cause.context_mark.name.removeprefix("<").removesuffix(">")
145
+ if cause.context_mark:
146
+ self.context_line = cause.context_mark.line + 1
147
+ self.context_column = cause.context_mark.column + 1
148
+ self.context_data_type = cause.context_mark.name.removeprefix("<").removesuffix(">")
148
149
  elif isinstance(cause, _json.JSONDecodeError):
149
150
  self.problem = cause.msg
150
151
  self.problem_line = cause.lineno
@@ -203,6 +203,7 @@ class TemplateFiller:
203
203
  raise_error(
204
204
  description_template=f"Code at {{path_invalid}} raised an exception: {e}\n{code_str_full}",
205
205
  path_invalid=current_path,
206
+ exception=e,
206
207
  )
207
208
 
208
209
  def get_address_value(match: _re.Match | str, return_all_matches: bool = False, from_code: bool = False):
@@ -323,7 +324,7 @@ class TemplateFiller:
323
324
  values = get_address_value(path)
324
325
  return self._unpack_string_joiner.join([self._stringer(val) for val in values])
325
326
 
326
- def raise_error(path_invalid: str, description_template: str):
327
+ def raise_error(path_invalid: str, description_template: str, exception: Exception | None = None):
327
328
  raise _exception.update.PySerialsUpdateTemplatedDataError(
328
329
  description_template=description_template,
329
330
  path_invalid=path_invalid,
@@ -333,7 +334,7 @@ class TemplateFiller:
333
334
  data_source=self._data,
334
335
  template_start=self._marker_start_value,
335
336
  template_end=self._marker_end_value,
336
- )
337
+ ) from exception
337
338
 
338
339
  self._check_endless_loop(templ, current_chain)
339
340
 
@@ -361,7 +362,7 @@ class TemplateFiller:
361
362
  unpack_value = fill_nested_values(unpack_value)
362
363
  submatch_list = self._pattern_list.fullmatch(unpack_value)
363
364
  if submatch_list:
364
- return get_address_value(unpack_value, return_all_matches=True)
365
+ return get_address_value(submatch_list, return_all_matches=True)
365
366
  return get_address_value(unpack_value)
366
367
  # Handle strings
367
368
  code_blocks_filled = self._pattern_code.sub(