Skip to content

Commit

Permalink
Release version 0.0.0.dev48
Browse files Browse the repository at this point in the history
  • Loading branch information
AAriam committed Dec 1, 2024
1 parent d83d8a0 commit 9d4c1f9
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 11 deletions.
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespaces = true
# ----------------------------------------- Project Metadata -------------------------------------
#
[project]
version = "0.0.0.dev47"
version = "0.0.0.dev48"
name = "PySerials"
dependencies = [
"jsonschema >= 4.21.0, < 5",
Expand All @@ -26,8 +26,8 @@ dependencies = [
"ruamel.yaml >= 0.17.32, < 0.18", # https://yaml.readthedocs.io/en/stable/
"ruamel.yaml.string >= 0.1.1, < 1",
"tomlkit >= 0.11.8, < 0.12", # https://tomlkit.readthedocs.io/en/stable/,
"MDit == 0.0.0.dev44",
"ExceptionMan == 0.0.0.dev44",
"MDit == 0.0.0.dev45",
"ExceptionMan == 0.0.0.dev45",
"ProtocolMan == 0.0.0.dev2",
]
requires-python = ">=3.10"
4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ jsonpath-ng >= 1.6.1, < 2
ruamel.yaml >= 0.17.32, < 0.18
ruamel.yaml.string >= 0.1.1, < 1
tomlkit >= 0.11.8, < 0.12
MDit == 0.0.0.dev44
ExceptionMan == 0.0.0.dev44
MDit == 0.0.0.dev45
ExceptionMan == 0.0.0.dev45
ProtocolMan == 0.0.0.dev2
7 changes: 4 additions & 3 deletions src/pyserials/exception/read.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,10 @@ def __init__(
self.problem = cause.problem.strip()
if cause.context:
self.context = cause.context.strip()
self.context_line = cause.context_mark.line + 1
self.context_column = cause.context_mark.column + 1
self.context_data_type = cause.context_mark.name.removeprefix("<").removesuffix(">")
if cause.context_mark:
self.context_line = cause.context_mark.line + 1
self.context_column = cause.context_mark.column + 1
self.context_data_type = cause.context_mark.name.removeprefix("<").removesuffix(">")
elif isinstance(cause, _json.JSONDecodeError):
self.problem = cause.msg
self.problem_line = cause.lineno
Expand Down
7 changes: 4 additions & 3 deletions src/pyserials/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ def getter_function(path: str, default: Any = None, search: bool = False):
raise_error(
description_template=f"Code at {{path_invalid}} raised an exception: {e}\n{code_str_full}",
path_invalid=current_path,
exception=e,
)

def get_address_value(match: _re.Match | str, return_all_matches: bool = False, from_code: bool = False):
Expand Down Expand Up @@ -323,7 +324,7 @@ def string_filler_unpack(match: _re.Match):
values = get_address_value(path)
return self._unpack_string_joiner.join([self._stringer(val) for val in values])

def raise_error(path_invalid: str, description_template: str):
def raise_error(path_invalid: str, description_template: str, exception: Exception | None = None):
raise _exception.update.PySerialsUpdateTemplatedDataError(
description_template=description_template,
path_invalid=path_invalid,
Expand All @@ -333,7 +334,7 @@ def raise_error(path_invalid: str, description_template: str):
data_source=self._data,
template_start=self._marker_start_value,
template_end=self._marker_end_value,
)
) from exception

self._check_endless_loop(templ, current_chain)

Expand Down Expand Up @@ -361,7 +362,7 @@ def raise_error(path_invalid: str, description_template: str):
unpack_value = fill_nested_values(unpack_value)
submatch_list = self._pattern_list.fullmatch(unpack_value)
if submatch_list:
return get_address_value(unpack_value, return_all_matches=True)
return get_address_value(submatch_list, return_all_matches=True)
return get_address_value(unpack_value)
# Handle strings
code_blocks_filled = self._pattern_code.sub(
Expand Down

0 comments on commit 9d4c1f9

Please sign in to comment.