encommon 0.20.0__py3-none-any.whl → 0.20.2__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- encommon/colors/color.py +1 -4
- encommon/colors/test/test_color.py +2 -1
- encommon/config/config.py +3 -3
- encommon/config/test/test_config.py +2 -1
- encommon/config/test/test_files.py +4 -2
- encommon/config/test/test_logger.py +4 -2
- encommon/config/test/test_paths.py +4 -2
- encommon/crypts/crypts.py +32 -11
- encommon/crypts/test/test_crypts.py +2 -1
- encommon/crypts/test/test_hashes.py +2 -1
- encommon/parse/test/test_jinja2.py +2 -1
- encommon/parse/test/test_network.py +2 -1
- encommon/times/duration.py +1 -1
- encommon/times/test/test_duration.py +2 -1
- encommon/times/test/test_time.py +2 -1
- encommon/times/test/test_timer.py +2 -1
- encommon/times/test/test_timers.py +2 -1
- encommon/times/test/test_window.py +2 -1
- encommon/times/test/test_windows.py +2 -1
- encommon/times/timers.py +3 -1
- encommon/times/windows.py +3 -1
- encommon/types/test/test_empty.py +2 -1
- encommon/version.txt +1 -1
- {encommon-0.20.0.dist-info → encommon-0.20.2.dist-info}/METADATA +1 -1
- {encommon-0.20.0.dist-info → encommon-0.20.2.dist-info}/RECORD +28 -28
- {encommon-0.20.0.dist-info → encommon-0.20.2.dist-info}/LICENSE +0 -0
- {encommon-0.20.0.dist-info → encommon-0.20.2.dist-info}/WHEEL +0 -0
- {encommon-0.20.0.dist-info → encommon-0.20.2.dist-info}/top_level.txt +0 -0
encommon/colors/color.py
CHANGED
encommon/config/config.py
CHANGED
@@ -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',
|
encommon/crypts/crypts.py
CHANGED
@@ -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')
|
encommon/times/duration.py
CHANGED
encommon/times/test/test_time.py
CHANGED
encommon/times/timers.py
CHANGED
encommon/times/windows.py
CHANGED
encommon/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.20.
|
1
|
+
0.20.2
|
@@ -1,60 +1,60 @@
|
|
1
1
|
encommon/__init__.py,sha256=YDGzuhpk5Gd1hq54LI0hw1NrrDvrJDrvH20TEy_0l5E,443
|
2
2
|
encommon/conftest.py,sha256=I7Zl2cMytnA-mwSPh0rRjsU0YSlES94jQq6mocRhVUE,1884
|
3
3
|
encommon/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
-
encommon/version.txt,sha256=
|
4
|
+
encommon/version.txt,sha256=Xkl_AowC_0UUkUzZHcJ71DmQsW9kCOKZCb-fSoFi47w,7
|
5
5
|
encommon/colors/__init__.py,sha256=XRiGimMj8oo040NO5a5ZsbsIUxaGVW4tf4xWTPWgnZY,269
|
6
|
-
encommon/colors/color.py,sha256=
|
6
|
+
encommon/colors/color.py,sha256=zw8Qt6trXUg4rdQ7Yzk3TVSpfdE5G99WKvLBVrx36UQ,10834
|
7
7
|
encommon/colors/test/__init__.py,sha256=PjrnBYT0efyvbaGeNx94dm3tP3EVHUHSVs-VGeLEv5g,218
|
8
|
-
encommon/colors/test/test_color.py,sha256=
|
8
|
+
encommon/colors/test/test_color.py,sha256=tFpPJoduaexLdruV7llvwdEt5EWiMBktTmmUgTqwjYE,4588
|
9
9
|
encommon/config/__init__.py,sha256=iZdbW7A4m7iN4xt5cEeQqo0Klqs-CaPLdD5ocLmUYi8,856
|
10
|
-
encommon/config/config.py,sha256=
|
10
|
+
encommon/config/config.py,sha256=dgJD9Ftj7i309ZBecbILcNGW2WALKdIjDnwa9WoggyM,7000
|
11
11
|
encommon/config/files.py,sha256=dSuShvIbQXFiNmpkwNVHCKDI-phBWC03OJVUfKJnfX0,2433
|
12
12
|
encommon/config/logger.py,sha256=MsGng6k1m4r5DnFkX8PhO33nj26AyiRYrKtFkjhAuNo,14556
|
13
13
|
encommon/config/params.py,sha256=FtcWi3-CY6OHLN7o3S-iBktpS1yGt5wLVD0546XEKRY,2223
|
14
14
|
encommon/config/paths.py,sha256=6eLhqEXDyNQpwdL6QWNPf060uayuUzXyM6A3ikNC24Q,2585
|
15
15
|
encommon/config/utils.py,sha256=jZ9x6Nd7H4XZMSyAFr7mydgIu8P7xBzjHqKzMpmduw0,2127
|
16
16
|
encommon/config/test/__init__.py,sha256=Vs5Pca7QBgoyoSjk6DSpO0YFcqkUhap5-VLbaCn8MjA,304
|
17
|
-
encommon/config/test/test_config.py,sha256=
|
18
|
-
encommon/config/test/test_files.py,sha256=
|
19
|
-
encommon/config/test/test_logger.py,sha256=
|
20
|
-
encommon/config/test/test_paths.py,sha256=
|
17
|
+
encommon/config/test/test_config.py,sha256=yS7RvFsXxhwj1cUU61srqHunLk51O5PERTP4TYqV8OM,2987
|
18
|
+
encommon/config/test/test_files.py,sha256=xhR6-FUqTDaMcK7cUMWuyL9x2rSu6dmJUy_J6r1cHBM,2345
|
19
|
+
encommon/config/test/test_logger.py,sha256=hCFedEwbZinlYZ2qzUkiH6mhqFdAv3NYJy6-OX091kU,5626
|
20
|
+
encommon/config/test/test_paths.py,sha256=emkDpz7W2TMdH3-wEy4ZYcrufiwRVKT6w_U5rEVp06o,2693
|
21
21
|
encommon/config/test/test_utils.py,sha256=RePpMD97HRCTkZ75ES8Eaf6_BOpcw_DknpgCFZGlQYg,1066
|
22
22
|
encommon/crypts/__init__.py,sha256=UsGEitz8rWa7DQF3iAxEbTUAbdiEnE87LSuRs4OBeAQ,371
|
23
|
-
encommon/crypts/crypts.py,sha256=
|
23
|
+
encommon/crypts/crypts.py,sha256=EtWKF6nRkABb1FhAK1Ec8pVncwHJTDjq7LUTWtgk8mY,4930
|
24
24
|
encommon/crypts/hashes.py,sha256=bpQf2-Ma5SdMaEWP2nL1_9rtEQmTE0XTdDvSD-fQ9Mk,3075
|
25
25
|
encommon/crypts/params.py,sha256=2uH_i1NBMlzhq7UtWgX2jsiUGNniOK69eTCeeiQFpdw,1417
|
26
26
|
encommon/crypts/test/__init__.py,sha256=PjrnBYT0efyvbaGeNx94dm3tP3EVHUHSVs-VGeLEv5g,218
|
27
|
-
encommon/crypts/test/test_crypts.py,sha256=
|
28
|
-
encommon/crypts/test/test_hashes.py,sha256=
|
27
|
+
encommon/crypts/test/test_crypts.py,sha256=YKB4Kra-5CRQ8gsLLCYj2s4mjlPuibszUWClPDvMYk0,3504
|
28
|
+
encommon/crypts/test/test_hashes.py,sha256=HEvKHTkWy6Xehh5fRHmntovGbkjWEgMsrVQCmMCBLtA,1223
|
29
29
|
encommon/parse/__init__.py,sha256=6uV4GCm_nOYC77x2jQvTDsa0F6vBGRbCgju_HCc96zM,422
|
30
30
|
encommon/parse/jinja2.py,sha256=2ZKTWjEGVHp6Dh8fkeMvuFp_AcIzCim-pA3UUf2TXWw,7067
|
31
31
|
encommon/parse/network.py,sha256=PgQ6xV6Y9KmyH0iXqQ-b88Gtkrry75Fzc-tZd-BH0ng,8771
|
32
32
|
encommon/parse/test/__init__.py,sha256=PjrnBYT0efyvbaGeNx94dm3tP3EVHUHSVs-VGeLEv5g,218
|
33
|
-
encommon/parse/test/test_jinja2.py,sha256=
|
34
|
-
encommon/parse/test/test_network.py,sha256
|
33
|
+
encommon/parse/test/test_jinja2.py,sha256=vFi8mzWPDJvFO00aMYSbjLVxctdsSvv_L19r1dVxNr8,3782
|
34
|
+
encommon/parse/test/test_network.py,sha256=-6FmgMzpDAZ4SI6Ccq4jUm9RYtanV24W9aTJyK6Y0W4,4170
|
35
35
|
encommon/times/__init__.py,sha256=QX4iuZ59UlsMbEWbubnVJXJtrOubNxAAAv510urcLUA,972
|
36
36
|
encommon/times/common.py,sha256=HWgWBbqDoyKHIqeg4bBAZZfRM3499X3WPu8dVCzt_5o,995
|
37
|
-
encommon/times/duration.py,sha256=
|
37
|
+
encommon/times/duration.py,sha256=1mDrLZozWXWQfqxHS2wzMwpRx5c0EjGDnwzJbzPvTkw,10786
|
38
38
|
encommon/times/params.py,sha256=qg0mLkXVsl54m72kd9uXRvmYKqUR_Ag5PBfnTsrwQhE,4360
|
39
39
|
encommon/times/parse.py,sha256=_PF12z-UOa75SyeUpBXVn7Jjt-c-Pfnzt6pAs_PjXmQ,6496
|
40
40
|
encommon/times/time.py,sha256=mdYl8vDJ0ZbaiH96A1cFHhOn7fExiRnudQJP1M4Xe2E,11746
|
41
41
|
encommon/times/timer.py,sha256=xxS6KVXFuRLq-RkXWMR7MMX5x0HGrEhLlOhRCecuCZY,3225
|
42
|
-
encommon/times/timers.py,sha256=
|
42
|
+
encommon/times/timers.py,sha256=JwvBIfWbXjwoIDQ08k2MAOoMif0Q1jsIJjmFWMxSRGA,9807
|
43
43
|
encommon/times/unitime.py,sha256=pO2I6qaSxR4HN82QSQYX6fo27xTP-n6bW8TahOG8c2k,1179
|
44
44
|
encommon/times/utils.py,sha256=PJ5QsKb3_pYEnD3Sz81d8QDhYQtTIj4HJfMoC9gNwmo,3100
|
45
45
|
encommon/times/window.py,sha256=tnOPz57cwIXVnOEGh7WPvBPhdjenvw1bYxV4mz721n0,8490
|
46
|
-
encommon/times/windows.py,sha256=
|
46
|
+
encommon/times/windows.py,sha256=oxEsCsM8qPQ5AbB8IRK_ONEWzLgXPpft8yR6xUKrb_4,10853
|
47
47
|
encommon/times/test/__init__.py,sha256=PjrnBYT0efyvbaGeNx94dm3tP3EVHUHSVs-VGeLEv5g,218
|
48
|
-
encommon/times/test/test_duration.py,sha256=
|
48
|
+
encommon/times/test/test_duration.py,sha256=3Tw6Y_ah36GCJl4vZ76z4Jt7rIxcm9P18-A69qsbLjI,4224
|
49
49
|
encommon/times/test/test_params.py,sha256=kHvs-WvKfPQCdCDnPU9tAyMVXmzH3eUjwQN-QdWBeh4,1407
|
50
50
|
encommon/times/test/test_parse.py,sha256=3Dihhu8xKmgbcq_dqKcO-itAeGtqAJxjGFQ6dPsJ4XM,4210
|
51
|
-
encommon/times/test/test_time.py,sha256=
|
52
|
-
encommon/times/test/test_timer.py,sha256=
|
53
|
-
encommon/times/test/test_timers.py,sha256=
|
51
|
+
encommon/times/test/test_time.py,sha256=XTgtsil2dgkeBUlJyORsNKUapcZWDFvOU-JwtypA6zw,2257
|
52
|
+
encommon/times/test/test_timer.py,sha256=cBZvO-k-FG7k4LICLLGVFxNBJuTjH4-eL4FNaa14uyY,1563
|
53
|
+
encommon/times/test/test_timers.py,sha256=zW6czbR5Ujz2cM4K935HCpO6Rx9EHxCgpFqktGYw8Xs,3892
|
54
54
|
encommon/times/test/test_unitime.py,sha256=5i4UjBCw8R9h-Lw963GfB_dHBMEQhjvv1k-t27Wyyls,510
|
55
55
|
encommon/times/test/test_utils.py,sha256=WkzHJY6zOt02Ujg5FItOo1nPtktz5ss8ODmG1tRQaaw,2056
|
56
|
-
encommon/times/test/test_window.py,sha256=
|
57
|
-
encommon/times/test/test_windows.py,sha256=
|
56
|
+
encommon/times/test/test_window.py,sha256=6ySO5DaYzg1bsVNCqB6u71rKWc0vpolxQ09ruoswN2c,6138
|
57
|
+
encommon/times/test/test_windows.py,sha256=Sq31BCvJtEN9OGGYXFKiagVZP0kc1n6HuaEBNwbkuks,4496
|
58
58
|
encommon/types/__init__.py,sha256=wMgdz0PuJyL_LIfafDlWIDaDLJi-bhnQJ4YTuUgN2gY,1143
|
59
59
|
encommon/types/classes.py,sha256=FYFTu8Uj-74JWudHOlhaOrsXXPxitorBfM9_QM3EGSU,1689
|
60
60
|
encommon/types/dicts.py,sha256=IuLoVdtilhM83ujT74mcz0Zi1HI87P4k7wjnnyMxPag,2821
|
@@ -66,7 +66,7 @@ encommon/types/types.py,sha256=DbzdDLLclD1Gk8bmyhDUUWVDnJ5LdaolLV3JYKHFVgA,322
|
|
66
66
|
encommon/types/test/__init__.py,sha256=uauiJIPPJjk1bzp5WEH_YEFLR5m0zxVN_c1liYAYIro,827
|
67
67
|
encommon/types/test/test_classes.py,sha256=CjthMInwz5WB7aTc7-GpzgcYAvkF9dRmC6nXJVoE91k,1475
|
68
68
|
encommon/types/test/test_dicts.py,sha256=kVYIGlIyXOx9yiCPKbhhFMf0TpiTU0ESNOaJYIq0_Ms,3650
|
69
|
-
encommon/types/test/test_empty.py,sha256=
|
69
|
+
encommon/types/test/test_empty.py,sha256=eLsHuqq2YNABFkMLPbGbJMXeW2nyGNIxzUZv7YhPT5U,1017
|
70
70
|
encommon/types/test/test_lists.py,sha256=uRdON1vnDT21TBl2prlO15SHIkN7YOApZzHS78R-Bvs,1139
|
71
71
|
encommon/types/test/test_notate.py,sha256=NfrDmMD6hOoVi9wlQ8yLZNnuHwS6Z7bLze70FkxOjSA,4008
|
72
72
|
encommon/types/test/test_strings.py,sha256=oXusioFMdknHeBdwlP_GakDVS9Tf2YBndjonj22UfmM,1277
|
@@ -83,8 +83,8 @@ encommon/utils/test/test_match.py,sha256=QagKpTFdRo23-Y55fSaJrSMpt5jIebScKbz0h8t
|
|
83
83
|
encommon/utils/test/test_paths.py,sha256=4AzIhQyYFEWhRWHgOZCCzomQ3Zs3EVwRnDQDa6Nq1Mc,1942
|
84
84
|
encommon/utils/test/test_sample.py,sha256=Qf-W0XbjTe5PfG87sdVizL2ymUPRTdX0qQtLGHaTgx8,3539
|
85
85
|
encommon/utils/test/test_stdout.py,sha256=fYiqEaUraD-3hFQYLxMPR4Ti_8CbTjEc8WvReXUA884,6139
|
86
|
-
encommon-0.20.
|
87
|
-
encommon-0.20.
|
88
|
-
encommon-0.20.
|
89
|
-
encommon-0.20.
|
90
|
-
encommon-0.20.
|
86
|
+
encommon-0.20.2.dist-info/LICENSE,sha256=otnXKCtMjPlbHs0wgZ_BWULrp3g_2dWQJ6icRk9nkgg,1071
|
87
|
+
encommon-0.20.2.dist-info/METADATA,sha256=C-vk8gHP2LFEGRRuysykY4aJDis4FqNkv-rrfJtN1ig,3640
|
88
|
+
encommon-0.20.2.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
|
89
|
+
encommon-0.20.2.dist-info/top_level.txt,sha256=bP8q7-5tLDNm-3XPlqn_bDENfYNug5801H_xfz3BEAM,9
|
90
|
+
encommon-0.20.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|