From 289ce47d64a79510bebc48178581b1853b7505df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Mon, 15 Aug 2022 18:35:53 +0200 Subject: [PATCH] new: Allow to force the timestamps in to_dict/to_json, even if a change was made --- pymisp/abstract.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pymisp/abstract.py b/pymisp/abstract.py index 523433a..657e422 100644 --- a/pymisp/abstract.py +++ b/pymisp/abstract.py @@ -280,6 +280,14 @@ class AbstractMISP(MutableMapping, MISPFileCache, metaclass=ABCMeta): def __len__(self) -> int: return len([k for k in self.__dict__.keys() if not (k[0] == '_' or k in self.__not_jsonable)]) + @property + def force_timestamp(self) -> bool: + return self.__force_timestamps + + @force_timestamp.setter + def force_timestamp(self, force: bool): + self.__force_timestamps = force + @property def edited(self) -> bool: """Recursively check if an object has been edited and update the flag accordingly