Skip to content

Commit

Permalink
Release version 0.0.0.dev54
Browse files Browse the repository at this point in the history
  • Loading branch information
AAriam committed Dec 9, 2024
1 parent d41389f commit 55d7dec
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 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.dev53"
version = "0.0.0.dev54"
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.dev50",
"ExceptionMan == 0.0.0.dev50",
"MDit == 0.0.0.dev51",
"ExceptionMan == 0.0.0.dev51",
"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.dev50
ExceptionMan == 0.0.0.dev50
MDit == 0.0.0.dev51
ExceptionMan == 0.0.0.dev51
ProtocolMan == 0.0.0.dev2
2 changes: 2 additions & 0 deletions src/pyserials/nested_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def __init__(
stringer: Callable[[str], str] = str,
unpack_string_joiner: str = ", ",
relative_template_keys: list[str] | None = None,
relative_key_key: str | None = None,
implicit_root: bool = True,
getter_function_name: str = "get",
):
Expand All @@ -58,6 +59,7 @@ def __init__(
stringer=stringer,
unpack_string_joiner=unpack_string_joiner,
relative_template_keys=relative_template_keys,
relative_key_key=relative_key_key,
implicit_root=implicit_root,
getter_function_name=getter_function_name,
)
Expand Down
8 changes: 8 additions & 0 deletions src/pyserials/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ def __init__(
stringer: Callable[[str], str] = str,
unpack_string_joiner: str = ", ",
relative_template_keys: list[str] | None = None,
relative_key_key: str | None = None,
implicit_root: bool = True,
getter_function_name: str = "get",
):
Expand All @@ -148,6 +149,7 @@ def __init__(
self._unpack_string_joiner = unpack_string_joiner
self._add_prefix = implicit_root
self._template_keys = relative_template_keys or []
self._relative_key_key = relative_key_key
self._getter_function_name = getter_function_name

self._pattern_value: dict[int, _RegexPattern] = {}
Expand Down Expand Up @@ -237,6 +239,12 @@ def get_address_value(match: _re.Match | str, return_all_matches: bool = False,
),
)
root_path_expr = root_path_expr.left
# Handle relative-key key
if self._relative_key_key and path == self._relative_key_key:
output = root_path_expr.right
if from_code:
return output, True
return output
path_expr = self._concat_json_paths(root_path_expr, path_expr)
cached_result = self._visited_paths.get(path_expr)
if cached_result:
Expand Down

0 comments on commit 55d7dec

Please sign in to comment.