diff --git a/setup.py b/setup.py index 9abafef3038b5b59cb9d8f06dd63d808e4f89072..1d78fc8f8efd720c648f2a717b43e91a39bd6476 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ def contents(*filenames): setup( name = "yangson", packages = ["yangson"], - version = "0.1.39", + version = "0.1.40", description = "Library for working with YANG schemas and data", author = "Ladislav Lhotka", author_email = "lhotka@nic.cz", diff --git a/yangson/instance.py b/yangson/instance.py index eefec2d36ddd8b6d5853f45cdf1886769858e2ca..09a795e33f994425949e9f8ed0b963e8cdb483e0 100644 --- a/yangson/instance.py +++ b/yangson/instance.py @@ -14,12 +14,12 @@ Value = Union[ScalarValue, "ArrayValue", "ObjectValue"] class StructuredValue: """Abstract class for array and object values.""" - def __init__(self, ts: datetime = None) -> None: + def __init__(self, ts: datetime) -> None: """Initialize class instance. :param ts: creation timestamp """ - self.timestamp = ts + self.timestamp = ts if ts else datetime.now() def stamp(self) -> None: """Update the receiver's timestamp to current time.""" diff --git a/yangson/schema.py b/yangson/schema.py index b2ab7f22df2bd77da6af569183372f231a902a91..c80d97b67b91c5cd74bd46a2f0e06d3db9f72630 100644 --- a/yangson/schema.py +++ b/yangson/schema.py @@ -313,7 +313,6 @@ class InternalNode(SchemaNode): if ch is None: raise NonexistentSchemaNode(cn[0], cn[1] if cn[1] else self.ns) res[ch.instance_name()] = ch.from_raw(val[qn]) - res.stamp() return res def _ascii_tree(self, indent: str) -> str: @@ -445,7 +444,6 @@ class SequenceNode(DataNode): res = ArrayValue([]) for en in val: res.append(self._entry_from_raw(en)) - res.stamp() return res def _entry_from_raw(self, val: RawValue) -> Value: