dictature 0.13.1__tar.gz → 0.13.2__tar.gz
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-0.13.1/src/dictature.egg-info → dictature-0.13.2}/PKG-INFO +1 -1
- {dictature-0.13.1 → dictature-0.13.2}/pyproject.toml +1 -1
- {dictature-0.13.1 → dictature-0.13.2}/src/dictature/dictature.py +7 -4
- {dictature-0.13.1 → dictature-0.13.2/src/dictature.egg-info}/PKG-INFO +1 -1
- {dictature-0.13.1 → dictature-0.13.2}/LICENSE +0 -0
- {dictature-0.13.1 → dictature-0.13.2}/README.md +0 -0
- {dictature-0.13.1 → dictature-0.13.2}/setup.cfg +0 -0
- {dictature-0.13.1 → dictature-0.13.2}/src/dictature/__init__.py +0 -0
- {dictature-0.13.1 → dictature-0.13.2}/src/dictature/backend/__init__.py +0 -0
- {dictature-0.13.1 → dictature-0.13.2}/src/dictature/backend/directory.py +0 -0
- {dictature-0.13.1 → dictature-0.13.2}/src/dictature/backend/misp.py +0 -0
- {dictature-0.13.1 → dictature-0.13.2}/src/dictature/backend/mock.py +0 -0
- {dictature-0.13.1 → dictature-0.13.2}/src/dictature/backend/mysql.py +0 -0
- {dictature-0.13.1 → dictature-0.13.2}/src/dictature/backend/s3.py +0 -0
- {dictature-0.13.1 → dictature-0.13.2}/src/dictature/backend/sqlite.py +0 -0
- {dictature-0.13.1 → dictature-0.13.2}/src/dictature/backend/webdav.py +0 -0
- {dictature-0.13.1 → dictature-0.13.2}/src/dictature/transformer/__init__.py +0 -0
- {dictature-0.13.1 → dictature-0.13.2}/src/dictature/transformer/aes.py +0 -0
- {dictature-0.13.1 → dictature-0.13.2}/src/dictature/transformer/gzip.py +0 -0
- {dictature-0.13.1 → dictature-0.13.2}/src/dictature/transformer/hmac.py +0 -0
- {dictature-0.13.1 → dictature-0.13.2}/src/dictature/transformer/mock.py +0 -0
- {dictature-0.13.1 → dictature-0.13.2}/src/dictature/transformer/passthrough.py +0 -0
- {dictature-0.13.1 → dictature-0.13.2}/src/dictature/transformer/pipeline.py +0 -0
- {dictature-0.13.1 → dictature-0.13.2}/src/dictature.egg-info/SOURCES.txt +0 -0
- {dictature-0.13.1 → dictature-0.13.2}/src/dictature.egg-info/dependency_links.txt +0 -0
- {dictature-0.13.1 → dictature-0.13.2}/src/dictature.egg-info/top_level.txt +0 -0
- {dictature-0.13.1 → dictature-0.13.2}/tests/test_operations.py +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: dictature
|
3
|
-
Version: 0.13.
|
3
|
+
Version: 0.13.2
|
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
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
4
4
|
|
5
5
|
[project]
|
6
6
|
name = "dictature"
|
7
|
-
version = "0.13.
|
7
|
+
version = "0.13.2"
|
8
8
|
description = "dictature -- A generic wrapper around dict-like interface with mulitple backends"
|
9
9
|
authors = [
|
10
10
|
{ name = "Adam Hlavacek", email = "git@adamhlavacek.com" }
|
@@ -39,7 +39,7 @@ class Dictature:
|
|
39
39
|
Return all table names
|
40
40
|
:return: all table names
|
41
41
|
"""
|
42
|
-
return set(map(self.
|
42
|
+
return set(map(self.__table_name_transformer.backward, self.__backend.keys()))
|
43
43
|
|
44
44
|
def values(self) -> Iterator["DictatureTable"]:
|
45
45
|
"""
|
@@ -84,6 +84,7 @@ class Dictature:
|
|
84
84
|
item,
|
85
85
|
name_transformer=self.__name_transformer,
|
86
86
|
value_transformer=self.__value_transformer,
|
87
|
+
table_name_transformer=self.__table_name_transformer,
|
87
88
|
allow_pickle=self.__allow_pickle,
|
88
89
|
)
|
89
90
|
return self.__table_cache[item]
|
@@ -119,6 +120,7 @@ class DictatureTable:
|
|
119
120
|
table_name: str,
|
120
121
|
name_transformer: MockTransformer = PassthroughTransformer(),
|
121
122
|
value_transformer: MockTransformer = PassthroughTransformer(),
|
123
|
+
table_name_transformer: Optional[MockTransformer] = None,
|
122
124
|
allow_pickle: bool = True
|
123
125
|
):
|
124
126
|
"""
|
@@ -132,6 +134,7 @@ class DictatureTable:
|
|
132
134
|
self.__backend = backend
|
133
135
|
self.__name_transformer = name_transformer
|
134
136
|
self.__value_transformer = value_transformer
|
137
|
+
self.__table_name_transformer = table_name_transformer or name_transformer
|
135
138
|
self.__table = self.__backend.table(self.__table_key(table_name))
|
136
139
|
self.__table_created = False
|
137
140
|
self.__allow_pickle = allow_pickle
|
@@ -297,8 +300,8 @@ class DictatureTable:
|
|
297
300
|
:param table_name: table name to transform
|
298
301
|
:return: transformed table name
|
299
302
|
"""
|
300
|
-
if not self.
|
303
|
+
if not self.__table_name_transformer.static:
|
301
304
|
for key in self.__backend.keys():
|
302
|
-
if self.
|
305
|
+
if self.__table_name_transformer.backward(key) == table_name:
|
303
306
|
return key
|
304
|
-
return self.
|
307
|
+
return self.__table_name_transformer.forward(table_name)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: dictature
|
3
|
-
Version: 0.13.
|
3
|
+
Version: 0.13.2
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|