dictature 0.9.6__py3-none-any.whl → 0.9.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- dictature/backend/directory.py +4 -3
- {dictature-0.9.6.dist-info → dictature-0.9.7.dist-info}/METADATA +1 -1
- {dictature-0.9.6.dist-info → dictature-0.9.7.dist-info}/RECORD +6 -6
- {dictature-0.9.6.dist-info → dictature-0.9.7.dist-info}/LICENSE +0 -0
- {dictature-0.9.6.dist-info → dictature-0.9.7.dist-info}/WHEEL +0 -0
- {dictature-0.9.6.dist-info → dictature-0.9.7.dist-info}/top_level.txt +0 -0
dictature/backend/directory.py
CHANGED
@@ -32,7 +32,8 @@ class DictatureTableDirectory(DictatureTableMock):
|
|
32
32
|
def __init__(self, path_root: Path, name: str, db_prefix: str, prefix: str) -> None:
|
33
33
|
self.__path = path_root / (db_prefix + self._filename_encode(name, suffix=''))
|
34
34
|
self.__prefix = prefix
|
35
|
-
self.
|
35
|
+
self.__name_serializer = ValueSerializer(mode=ValueSerializerMode.filename_only)
|
36
|
+
self.__value_serializer = ValueSerializer(mode=ValueSerializerMode.any_string)
|
36
37
|
|
37
38
|
def keys(self) -> Iterable[str]:
|
38
39
|
for child in self.__path.iterdir():
|
@@ -49,7 +50,7 @@ class DictatureTableDirectory(DictatureTableMock):
|
|
49
50
|
file_target = self.__item_path(item)
|
50
51
|
file_target_tmp = file_target.with_suffix('.tmp')
|
51
52
|
|
52
|
-
save_data = self.
|
53
|
+
save_data = self.__value_serializer.serialize(value)
|
53
54
|
|
54
55
|
file_target_tmp.write_text(save_data)
|
55
56
|
file_target_tmp.rename(file_target)
|
@@ -57,7 +58,7 @@ class DictatureTableDirectory(DictatureTableMock):
|
|
57
58
|
def get(self, item: str) -> Value:
|
58
59
|
try:
|
59
60
|
save_data = self.__item_path(item).read_text()
|
60
|
-
return self.
|
61
|
+
return self.__value_serializer.deserialize(save_data)
|
61
62
|
except FileNotFoundError:
|
62
63
|
raise KeyError(item)
|
63
64
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: dictature
|
3
|
-
Version: 0.9.
|
3
|
+
Version: 0.9.7
|
4
4
|
Summary: dictature -- A generic wrapper around dict-like interface with mulitple backends
|
5
5
|
Author-email: Adam Hlavacek <git@adamhlavacek.com>
|
6
6
|
Project-URL: Homepage, https://github.com/esoadamo/dictature
|
@@ -1,7 +1,7 @@
|
|
1
1
|
dictature/__init__.py,sha256=UCPJKHeyirRZ0pCYoyeat-rwXa8pDezOJ3UWCipDdyc,33
|
2
2
|
dictature/dictature.py,sha256=SHwG_XvGwm6qpvMt5OjeS8BoU5wLgJi_4jIBKFmYFyI,9330
|
3
3
|
dictature/backend/__init__.py,sha256=d5s6QCJOUzFglVNg8Cqqx_8b61S-AOTGjEUIF6FS69U,149
|
4
|
-
dictature/backend/directory.py,sha256=
|
4
|
+
dictature/backend/directory.py,sha256=nPNJ-wRZOsuzaCOLxgGnNB093qID5LWw7VELAqi7kZc,3384
|
5
5
|
dictature/backend/misp.py,sha256=iPjvgnJg6WveNP2wvgN7OK2vkX-SC9qYPrdoa9ahRT0,4411
|
6
6
|
dictature/backend/mock.py,sha256=BzfLstxkTIjk6mcMTdFKj8rSaFgIqn9-2Cyelslj8bY,5889
|
7
7
|
dictature/backend/sqlite.py,sha256=zyphYEeLY4eGuBCor16i80_-brdipMpXZ3_kONwErsE,5237
|
@@ -12,8 +12,8 @@ dictature/transformer/hmac.py,sha256=vURsB0HlzRPn_Vkl7lGmZV9OKempQuds8AanmadDxIo
|
|
12
12
|
dictature/transformer/mock.py,sha256=7zu65ZqUV_AVRaPSzNd73cVMXixXt31SeuX9OKZxaJQ,948
|
13
13
|
dictature/transformer/passthrough.py,sha256=Pt3N6G_Qh6HJ_q75ETL5nfAwYHLB-SjkVwUwbbbMik8,344
|
14
14
|
dictature/transformer/pipeline.py,sha256=OaQaJeJ5NpICetJe08r8ontqstsXGuW8jDbKw1zxYs4,842
|
15
|
-
dictature-0.9.
|
16
|
-
dictature-0.9.
|
17
|
-
dictature-0.9.
|
18
|
-
dictature-0.9.
|
19
|
-
dictature-0.9.
|
15
|
+
dictature-0.9.7.dist-info/LICENSE,sha256=n1U9DKr8sM5EY2QHcvxSGiKTDWUT8MyXsOC79w94MT0,1072
|
16
|
+
dictature-0.9.7.dist-info/METADATA,sha256=oyBWco6Qtzo3C6MsHl_tdco6Oqo0mTyIsyXeui7sfjo,2869
|
17
|
+
dictature-0.9.7.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
|
18
|
+
dictature-0.9.7.dist-info/top_level.txt,sha256=-RO39WWCF44lqiXhSUcACVqbk6SkgReZTz7ZmHKH3-U,10
|
19
|
+
dictature-0.9.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|