Skip to content

Commit

Permalink
Release version 0.0.0.dev38
Browse files Browse the repository at this point in the history
  • Loading branch information
AAriam committed Nov 17, 2024
1 parent e6e08d9 commit f231500
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 9 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.dev37"
version = "0.0.0.dev38"
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.dev34",
"ExceptionMan == 0.0.0.dev34",
"MDit == 0.0.0.dev35",
"ExceptionMan == 0.0.0.dev35",
"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.dev34
ExceptionMan == 0.0.0.dev34
MDit == 0.0.0.dev35
ExceptionMan == 0.0.0.dev35
ProtocolMan == 0.0.0.dev2
1 change: 1 addition & 0 deletions src/pyserials/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@

from pyserials import exception, update, validate, read, write, format, compare
from pyserials.nested_dict import NestedDict
from pyserials.property_dict import PropertyDict
11 changes: 11 additions & 0 deletions src/pyserials/nested_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,14 @@ def values(self):
def update(self, data: dict):
self._data.update(data)
return

def pop(self, key: str, default=None):
keys = key.split(".")
data = self._data
for key in keys[:-1]:
if not isinstance(data, dict) or key not in data:
return default
data = data[key]
if not isinstance(data, dict) or key not in data:
return default
return data.pop(key)
11 changes: 7 additions & 4 deletions src/pyserials/property_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ def as_dict(self) -> dict:
"""The data as a dictionary."""
return self._data

def get(self, name: str, default=None):
return self._data.get(name, default)
def get(self, key, default=None):
return self._data.get(key, default)

def pop(self, name: str, default=None):
return self._data.pop(name, default)
def pop(self, key, default=None):
return self._data.pop(key, default)

def setdefault(self, key, default):
return self._data.setdefault(key, default)

def __getattr__(self, name: str):
return self._data[name]
Expand Down

0 comments on commit f231500

Please sign in to comment.