encommon 0.20.0__tar.gz → 0.20.2__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {encommon-0.20.0/encommon.egg-info → encommon-0.20.2}/PKG-INFO +1 -1
- {encommon-0.20.0 → encommon-0.20.2}/encommon/colors/color.py +1 -4
- {encommon-0.20.0 → encommon-0.20.2}/encommon/colors/test/test_color.py +2 -1
- {encommon-0.20.0 → encommon-0.20.2}/encommon/config/config.py +3 -3
- {encommon-0.20.0 → encommon-0.20.2}/encommon/config/test/test_config.py +2 -1
- {encommon-0.20.0 → encommon-0.20.2}/encommon/config/test/test_files.py +4 -2
- {encommon-0.20.0 → encommon-0.20.2}/encommon/config/test/test_logger.py +4 -2
- {encommon-0.20.0 → encommon-0.20.2}/encommon/config/test/test_paths.py +4 -2
- {encommon-0.20.0 → encommon-0.20.2}/encommon/crypts/crypts.py +32 -11
- {encommon-0.20.0 → encommon-0.20.2}/encommon/crypts/test/test_crypts.py +2 -1
- {encommon-0.20.0 → encommon-0.20.2}/encommon/crypts/test/test_hashes.py +2 -1
- {encommon-0.20.0 → encommon-0.20.2}/encommon/parse/test/test_jinja2.py +2 -1
- {encommon-0.20.0 → encommon-0.20.2}/encommon/parse/test/test_network.py +2 -1
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/duration.py +1 -1
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/test/test_duration.py +2 -1
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/test/test_time.py +2 -1
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/test/test_timer.py +2 -1
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/test/test_timers.py +2 -1
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/test/test_window.py +2 -1
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/test/test_windows.py +2 -1
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/timers.py +3 -1
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/windows.py +3 -1
- {encommon-0.20.0 → encommon-0.20.2}/encommon/types/test/test_empty.py +2 -1
- encommon-0.20.2/encommon/version.txt +1 -0
- {encommon-0.20.0 → encommon-0.20.2/encommon.egg-info}/PKG-INFO +1 -1
- encommon-0.20.0/encommon/version.txt +0 -1
- {encommon-0.20.0 → encommon-0.20.2}/LICENSE +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/MANIFEST.in +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/README.md +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/__init__.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/colors/__init__.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/colors/test/__init__.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/config/__init__.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/config/files.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/config/logger.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/config/params.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/config/paths.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/config/test/__init__.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/config/test/test_utils.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/config/utils.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/conftest.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/crypts/__init__.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/crypts/hashes.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/crypts/params.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/crypts/test/__init__.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/parse/__init__.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/parse/jinja2.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/parse/network.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/parse/test/__init__.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/py.typed +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/__init__.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/common.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/params.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/parse.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/test/__init__.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/test/test_params.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/test/test_parse.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/test/test_unitime.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/test/test_utils.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/time.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/timer.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/unitime.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/utils.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/times/window.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/types/__init__.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/types/classes.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/types/dicts.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/types/empty.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/types/lists.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/types/notate.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/types/strings.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/types/test/__init__.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/types/test/test_classes.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/types/test/test_dicts.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/types/test/test_lists.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/types/test/test_notate.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/types/test/test_strings.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/types/types.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/__init__.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/common.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/files.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/match.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/paths.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/sample.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/stdout.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/test/__init__.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/test/test_files.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/test/test_match.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/test/test_paths.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/test/test_sample.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon/utils/test/test_stdout.py +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon.egg-info/SOURCES.txt +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon.egg-info/dependency_links.txt +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon.egg-info/requires.txt +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/encommon.egg-info/top_level.txt +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/pyproject.toml +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/reqs-install.txt +0 -0
- {encommon-0.20.0 → encommon-0.20.2}/setup.cfg +0 -0
@@ -185,7 +185,7 @@ class Config:
|
|
185
185
|
:returns: Configuration source loaded from the objects.
|
186
186
|
"""
|
187
187
|
|
188
|
-
files = self.
|
188
|
+
files = self.__files
|
189
189
|
|
190
190
|
ferged = files.merge
|
191
191
|
|
@@ -207,8 +207,8 @@ class Config:
|
|
207
207
|
:returns: Configuration source loaded from the objects.
|
208
208
|
"""
|
209
209
|
|
210
|
-
files = self.
|
211
|
-
paths = self.
|
210
|
+
files = self.__files
|
211
|
+
paths = self.__paths
|
212
212
|
|
213
213
|
ferged = files.merge
|
214
214
|
perged = paths.merge
|
@@ -61,7 +61,8 @@ def test_ConfigFile(
|
|
61
61
|
'files.ConfigFile object',
|
62
62
|
file)
|
63
63
|
|
64
|
-
assert
|
64
|
+
assert isinstance(
|
65
|
+
hash(file), int)
|
65
66
|
|
66
67
|
assert instr(
|
67
68
|
'files.ConfigFile object',
|
@@ -96,7 +97,8 @@ def test_ConfigFiles(
|
|
96
97
|
'files.ConfigFiles object',
|
97
98
|
files)
|
98
99
|
|
99
|
-
assert
|
100
|
+
assert isinstance(
|
101
|
+
hash(files), int)
|
100
102
|
|
101
103
|
assert instr(
|
102
104
|
'files.ConfigFiles object',
|
@@ -83,7 +83,8 @@ def test_Message() -> None:
|
|
83
83
|
'Message(level="info"',
|
84
84
|
message)
|
85
85
|
|
86
|
-
assert
|
86
|
+
assert isinstance(
|
87
|
+
hash(message), int)
|
87
88
|
|
88
89
|
assert instr(
|
89
90
|
'Message(level="info"',
|
@@ -157,7 +158,8 @@ def test_Logger(
|
|
157
158
|
'logger.Logger object',
|
158
159
|
logger)
|
159
160
|
|
160
|
-
assert
|
161
|
+
assert isinstance(
|
162
|
+
hash(logger), int)
|
161
163
|
|
162
164
|
assert instr(
|
163
165
|
'logger.Logger object',
|
@@ -64,7 +64,8 @@ def test_ConfigPath(
|
|
64
64
|
'paths.ConfigPath object',
|
65
65
|
path)
|
66
66
|
|
67
|
-
assert
|
67
|
+
assert isinstance(
|
68
|
+
hash(path), int)
|
68
69
|
|
69
70
|
assert instr(
|
70
71
|
'paths.ConfigPath object',
|
@@ -98,7 +99,8 @@ def test_ConfigPaths(
|
|
98
99
|
'paths.ConfigPaths object',
|
99
100
|
paths)
|
100
101
|
|
101
|
-
assert
|
102
|
+
assert isinstance(
|
103
|
+
hash(paths), int)
|
102
104
|
|
103
105
|
assert instr(
|
104
106
|
'paths.ConfigPaths object',
|
@@ -62,12 +62,14 @@ class Crypts:
|
|
62
62
|
Initialize instance for class using provided parameters.
|
63
63
|
"""
|
64
64
|
|
65
|
-
from .params import
|
65
|
+
from .params import (
|
66
|
+
CryptsParams)
|
66
67
|
|
67
68
|
if params is None:
|
68
69
|
params = CryptsParams()
|
69
70
|
|
70
|
-
self.__params =
|
71
|
+
self.__params = (
|
72
|
+
deepcopy(params))
|
71
73
|
|
72
74
|
|
73
75
|
@property
|
@@ -96,16 +98,22 @@ class Crypts:
|
|
96
98
|
:returns: Encrypted value using the relevant passphrase.
|
97
99
|
"""
|
98
100
|
|
99
|
-
phrases =
|
101
|
+
phrases = (
|
102
|
+
self.params
|
103
|
+
.phrases)
|
100
104
|
|
101
105
|
if unique not in phrases:
|
102
106
|
raise ValueError('unique')
|
103
107
|
|
104
|
-
phrase =
|
108
|
+
phrase = (
|
109
|
+
phrases[unique]
|
110
|
+
.phrase)
|
111
|
+
|
112
|
+
encoded = value.encode()
|
105
113
|
|
106
114
|
encrypt = (
|
107
115
|
Fernet(phrase)
|
108
|
-
.encrypt(
|
116
|
+
.encrypt(encoded)
|
109
117
|
.decode())
|
110
118
|
|
111
119
|
return (
|
@@ -124,11 +132,16 @@ class Crypts:
|
|
124
132
|
:returns: Decrypted value using the relevant passphrase.
|
125
133
|
"""
|
126
134
|
|
127
|
-
phrases =
|
135
|
+
phrases = (
|
136
|
+
self.params
|
137
|
+
.phrases)
|
128
138
|
|
129
139
|
value = crypt_clean(value)
|
130
140
|
|
131
|
-
|
141
|
+
match = re_match(
|
142
|
+
ENCRYPT, value)
|
143
|
+
|
144
|
+
if match is None:
|
132
145
|
raise ValueError('string')
|
133
146
|
|
134
147
|
version, unique, value = (
|
@@ -137,11 +150,15 @@ class Crypts:
|
|
137
150
|
if version != '1.0':
|
138
151
|
raise ValueError('version')
|
139
152
|
|
140
|
-
phrase =
|
153
|
+
phrase = (
|
154
|
+
phrases[unique]
|
155
|
+
.phrase)
|
156
|
+
|
157
|
+
encoded = value.encode()
|
141
158
|
|
142
159
|
return (
|
143
160
|
Fernet(phrase)
|
144
|
-
.decrypt(
|
161
|
+
.decrypt(encoded)
|
145
162
|
.decode())
|
146
163
|
|
147
164
|
|
@@ -157,7 +174,9 @@ class Crypts:
|
|
157
174
|
:param params: Parameters used to instantiate the class.
|
158
175
|
"""
|
159
176
|
|
160
|
-
phrases =
|
177
|
+
phrases = (
|
178
|
+
self.params
|
179
|
+
.phrases)
|
161
180
|
|
162
181
|
if unique in phrases:
|
163
182
|
raise ValueError('unique')
|
@@ -175,7 +194,9 @@ class Crypts:
|
|
175
194
|
:param unique: Unique identifier of mapping passphrase.
|
176
195
|
"""
|
177
196
|
|
178
|
-
phrases =
|
197
|
+
phrases = (
|
198
|
+
self.params
|
199
|
+
.phrases)
|
179
200
|
|
180
201
|
if unique not in phrases:
|
181
202
|
raise ValueError('unique')
|
@@ -0,0 +1 @@
|
|
1
|
+
0.20.2
|
@@ -1 +0,0 @@
|
|
1
|
-
0.20.0
|
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
|
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
|
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
|
File without changes
|
File without changes
|
File without changes
|