dictature 0.11.0__py3-none-any.whl → 0.11.1__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.
@@ -1,3 +1,5 @@
1
+ import tempfile
2
+ import os
1
3
  from pathlib import Path
2
4
  from typing import Iterable, Union
3
5
  from shutil import rmtree
@@ -48,7 +50,11 @@ class DictatureTableDirectory(DictatureTableMock):
48
50
 
49
51
  def set(self, item: str, value: Value) -> None:
50
52
  file_target = self.__item_path(item)
51
- file_target_tmp = file_target.with_suffix('.tmp')
53
+
54
+ # Create temporary file for atomic write
55
+ handle, file_target_tmp_path = tempfile.mkstemp(prefix=file_target.name, suffix='.tmp', dir=file_target.parent)
56
+ os.close(handle)
57
+ file_target_tmp = Path(file_target_tmp_path)
52
58
 
53
59
  save_data = self.__value_serializer.serialize(value)
54
60
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: dictature
3
- Version: 0.11.0
3
+ Version: 0.11.1
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
@@ -13,7 +13,12 @@ License-File: LICENSE
13
13
 
14
14
  # Dictature
15
15
 
16
- A wrapper for Python's dictionary with multiple backends.
16
+ Make a Python dictionary out of anything. A wrapper for Python's dictionary with multiple backends.
17
+ Thread-safe, supports multiple backends, and allows for transformers to change how the data is stored.
18
+
19
+ SQLite, directory, webdav, and more backends are supported, and you can easily create your own backend.
20
+
21
+ [![PyPI version](https://badge.fury.io/py/dictature.svg)](https://badge.fury.io/py/dictature)
17
22
 
18
23
  ## Installation
19
24
 
@@ -1,7 +1,7 @@
1
1
  dictature/__init__.py,sha256=UCPJKHeyirRZ0pCYoyeat-rwXa8pDezOJ3UWCipDdyc,33
2
2
  dictature/dictature.py,sha256=q4QFQz91r2boViuhsf6y-C9uRntaMD-VagKFUGZjnpQ,10015
3
3
  dictature/backend/__init__.py,sha256=d5s6QCJOUzFglVNg8Cqqx_8b61S-AOTGjEUIF6FS69U,149
4
- dictature/backend/directory.py,sha256=nPNJ-wRZOsuzaCOLxgGnNB093qID5LWw7VELAqi7kZc,3384
4
+ dictature/backend/directory.py,sha256=_-8Fx7Ef4tFbOQWHcARfKjm0kbZUpmN1f1ysyWINOr4,3600
5
5
  dictature/backend/misp.py,sha256=R9osuEJa79SoXErwByIwhViJ26cEfw2nKhWu8XxkO7Y,4860
6
6
  dictature/backend/mock.py,sha256=o4YBl6Wk-q6IHFdykGeryTKcQFsJHvymlONPbbwVkak,5891
7
7
  dictature/backend/sqlite.py,sha256=zyphYEeLY4eGuBCor16i80_-brdipMpXZ3_kONwErsE,5237
@@ -13,8 +13,8 @@ dictature/transformer/hmac.py,sha256=vURsB0HlzRPn_Vkl7lGmZV9OKempQuds8AanmadDxIo
13
13
  dictature/transformer/mock.py,sha256=7zu65ZqUV_AVRaPSzNd73cVMXixXt31SeuX9OKZxaJQ,948
14
14
  dictature/transformer/passthrough.py,sha256=Pt3N6G_Qh6HJ_q75ETL5nfAwYHLB-SjkVwUwbbbMik8,344
15
15
  dictature/transformer/pipeline.py,sha256=OaQaJeJ5NpICetJe08r8ontqstsXGuW8jDbKw1zxYs4,842
16
- dictature-0.11.0.dist-info/LICENSE,sha256=n1U9DKr8sM5EY2QHcvxSGiKTDWUT8MyXsOC79w94MT0,1072
17
- dictature-0.11.0.dist-info/METADATA,sha256=cLMkq0S6mDBlPJXwitBNbZfpZ_KuqogCLoR4EGhb8zQ,2937
18
- dictature-0.11.0.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
19
- dictature-0.11.0.dist-info/top_level.txt,sha256=-RO39WWCF44lqiXhSUcACVqbk6SkgReZTz7ZmHKH3-U,10
20
- dictature-0.11.0.dist-info/RECORD,,
16
+ dictature-0.11.1.dist-info/LICENSE,sha256=n1U9DKr8sM5EY2QHcvxSGiKTDWUT8MyXsOC79w94MT0,1072
17
+ dictature-0.11.1.dist-info/METADATA,sha256=b-VVWD1Tgz0GwX0OvoWHPCtx-g117pYEbyEWyNeBKbE,3283
18
+ dictature-0.11.1.dist-info/WHEEL,sha256=iAkIy5fosb7FzIOwONchHf19Qu7_1wCWyFNR5gu9nU0,91
19
+ dictature-0.11.1.dist-info/top_level.txt,sha256=-RO39WWCF44lqiXhSUcACVqbk6SkgReZTz7ZmHKH3-U,10
20
+ dictature-0.11.1.dist-info/RECORD,,