encommon 0.16.0__tar.gz → 0.17.1__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {encommon-0.16.0/encommon.egg-info → encommon-0.17.1}/PKG-INFO +2 -2
- {encommon-0.16.0 → encommon-0.17.1}/README.md +1 -1
- {encommon-0.16.0 → encommon-0.17.1}/encommon/config/logger.py +8 -1
- {encommon-0.16.0 → encommon-0.17.1}/encommon/config/test/test_logger.py +25 -10
- {encommon-0.16.0 → encommon-0.17.1}/encommon/conftest.py +1 -1
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/test/test_timer.py +5 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/test/test_timers.py +4 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/timer.py +14 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/timers.py +17 -0
- encommon-0.17.1/encommon/version.txt +1 -0
- {encommon-0.16.0 → encommon-0.17.1/encommon.egg-info}/PKG-INFO +2 -2
- encommon-0.16.0/encommon/version.txt +0 -1
- {encommon-0.16.0 → encommon-0.17.1}/LICENSE +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/MANIFEST.in +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/__init__.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/colors/__init__.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/colors/color.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/colors/test/__init__.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/colors/test/test_color.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/config/__init__.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/config/config.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/config/files.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/config/params.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/config/paths.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/config/test/__init__.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/config/test/test_config.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/config/test/test_files.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/config/test/test_paths.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/config/test/test_utils.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/config/utils.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/crypts/__init__.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/crypts/crypts.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/crypts/hashes.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/crypts/params.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/crypts/test/__init__.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/crypts/test/test_crypts.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/crypts/test/test_hashes.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/py.typed +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/__init__.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/common.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/duration.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/params.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/parse.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/test/__init__.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/test/test_duration.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/test/test_params.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/test/test_parse.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/test/test_time.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/test/test_unitime.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/test/test_utils.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/test/test_window.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/test/test_windows.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/time.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/unitime.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/utils.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/window.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/times/windows.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/types/__init__.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/types/classes.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/types/dicts.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/types/empty.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/types/lists.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/types/notate.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/types/strings.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/types/test/__init__.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/types/test/test_classes.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/types/test/test_dicts.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/types/test/test_empty.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/types/test/test_lists.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/types/test/test_notate.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/types/test/test_strings.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/types/types.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/utils/__init__.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/utils/common.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/utils/files.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/utils/match.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/utils/paths.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/utils/sample.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/utils/stdout.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/utils/test/__init__.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/utils/test/test_files.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/utils/test/test_match.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/utils/test/test_paths.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/utils/test/test_sample.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon/utils/test/test_stdout.py +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon.egg-info/SOURCES.txt +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon.egg-info/dependency_links.txt +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon.egg-info/requires.txt +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/encommon.egg-info/top_level.txt +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/pyproject.toml +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/reqs-install.txt +0 -0
- {encommon-0.16.0 → encommon-0.17.1}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: encommon
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.17.1
|
4
4
|
Summary: Enasis Network Common Library
|
5
5
|
License: MIT
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
@@ -88,7 +88,7 @@ make -s pytest
|
|
88
88
|
|
89
89
|
1. Create [repository](https://github.com/enasisnetwork/encommon) release.
|
90
90
|
|
91
|
-
1. Build the Python package.<br>
|
91
|
+
1. Build the Python package.<br>Be sure no uncommited files in tree.
|
92
92
|
```
|
93
93
|
make -s pypackage
|
94
94
|
```
|
@@ -133,7 +133,7 @@ class Message:
|
|
133
133
|
value = round(value, 2)
|
134
134
|
|
135
135
|
|
136
|
-
value = str(value)
|
136
|
+
value = str(value).strip()
|
137
137
|
|
138
138
|
self.__fields[key] = value
|
139
139
|
|
@@ -574,6 +574,13 @@ class Logger:
|
|
574
574
|
logr_stdo = self.__logr_stdo
|
575
575
|
logr_file = self.__logr_file
|
576
576
|
|
577
|
+
# Prevent debug from creating
|
578
|
+
# new object each time called
|
579
|
+
if (level == 'debug'
|
580
|
+
and stdo_level != 'debug'
|
581
|
+
and file_level != 'debug'):
|
582
|
+
return None
|
583
|
+
|
577
584
|
message = Message(level, **kwargs)
|
578
585
|
|
579
586
|
if stdo_level is not None:
|
@@ -42,7 +42,7 @@ def logger(
|
|
42
42
|
"""
|
43
43
|
|
44
44
|
params = LoggerParams(
|
45
|
-
stdo_level='
|
45
|
+
stdo_level='debug',
|
46
46
|
file_level='info',
|
47
47
|
file_path=f'{tmp_path}/test.log')
|
48
48
|
|
@@ -166,7 +166,7 @@ def test_Logger(
|
|
166
166
|
|
167
167
|
assert logger.params
|
168
168
|
|
169
|
-
assert logger.stdo_level == '
|
169
|
+
assert logger.stdo_level == 'debug'
|
170
170
|
|
171
171
|
assert logger.file_level == 'info'
|
172
172
|
|
@@ -201,6 +201,21 @@ def test_Logger_cover(
|
|
201
201
|
time = Time('now')
|
202
202
|
|
203
203
|
|
204
|
+
# Test preventing debug from
|
205
|
+
# any needless instantiation
|
206
|
+
setattr(
|
207
|
+
logger,
|
208
|
+
'_Logger__file_level',
|
209
|
+
'info')
|
210
|
+
|
211
|
+
# Test preventing debug from
|
212
|
+
# any needless instantiation
|
213
|
+
setattr(
|
214
|
+
logger,
|
215
|
+
'_Logger__stdo_level',
|
216
|
+
'info')
|
217
|
+
|
218
|
+
|
204
219
|
def _logger_logs() -> None:
|
205
220
|
logger.log_d(msg='pytest')
|
206
221
|
logger.log_c(msg='pytest')
|
@@ -234,16 +249,16 @@ def test_Logger_cover(
|
|
234
249
|
|
235
250
|
_logger_logs()
|
236
251
|
|
237
|
-
assert len(_logger_stdo()) ==
|
238
|
-
assert len(_logger_file()) ==
|
252
|
+
assert len(_logger_stdo()) == 5
|
253
|
+
assert len(_logger_file()) == 5
|
239
254
|
|
240
255
|
logger.stop()
|
241
256
|
|
242
257
|
|
243
258
|
_logger_logs()
|
244
259
|
|
245
|
-
assert len(_logger_stdo()) ==
|
246
|
-
assert len(_logger_file()) ==
|
260
|
+
assert len(_logger_stdo()) == 5
|
261
|
+
assert len(_logger_file()) == 5
|
247
262
|
|
248
263
|
|
249
264
|
logger.start()
|
@@ -261,8 +276,8 @@ def test_Logger_cover(
|
|
261
276
|
assert message in str(stdo)
|
262
277
|
assert message in str(file)
|
263
278
|
|
264
|
-
assert len(_logger_stdo()) ==
|
265
|
-
assert len(_logger_file()) ==
|
279
|
+
assert len(_logger_stdo()) == 6
|
280
|
+
assert len(_logger_file()) == 6
|
266
281
|
|
267
282
|
|
268
283
|
logger.stop()
|
@@ -270,5 +285,5 @@ def test_Logger_cover(
|
|
270
285
|
|
271
286
|
_logger_logs()
|
272
287
|
|
273
|
-
assert len(_logger_stdo()) ==
|
274
|
-
assert len(_logger_file()) ==
|
288
|
+
assert len(_logger_stdo()) == 6
|
289
|
+
assert len(_logger_file()) == 6
|
@@ -68,6 +68,7 @@ def test_Timer(
|
|
68
68
|
assert timer.remains <= 1
|
69
69
|
|
70
70
|
assert not timer.ready()
|
71
|
+
assert timer.pause()
|
71
72
|
|
72
73
|
|
73
74
|
sleep(1)
|
@@ -77,11 +78,15 @@ def test_Timer(
|
|
77
78
|
assert timer.remains == 0
|
78
79
|
|
79
80
|
assert timer.ready()
|
81
|
+
assert timer.pause()
|
80
82
|
|
81
83
|
assert not timer.ready()
|
84
|
+
assert timer.pause()
|
82
85
|
|
83
86
|
timer.update('1980-01-01')
|
84
87
|
|
85
88
|
assert timer.ready()
|
89
|
+
assert timer.pause()
|
86
90
|
|
87
91
|
assert not timer.ready()
|
92
|
+
assert timer.pause()
|
@@ -151,10 +151,12 @@ def test_Timers_cover(
|
|
151
151
|
|
152
152
|
|
153
153
|
assert timers.ready('two')
|
154
|
+
assert timers.pause('two')
|
154
155
|
|
155
156
|
timers.update('two', 'now')
|
156
157
|
|
157
158
|
assert not timers.ready('two')
|
159
|
+
assert timers.pause('two')
|
158
160
|
|
159
161
|
|
160
162
|
timers = Timers()
|
@@ -165,10 +167,12 @@ def test_Timers_cover(
|
|
165
167
|
timers.create('fur', params)
|
166
168
|
|
167
169
|
assert not timers.ready('fur')
|
170
|
+
assert timers.pause('fur')
|
168
171
|
|
169
172
|
sleep(1)
|
170
173
|
|
171
174
|
assert timers.ready('fur')
|
175
|
+
assert timers.pause('fur')
|
172
176
|
|
173
177
|
timers.delete('fur')
|
174
178
|
|
@@ -131,6 +131,20 @@ class Timer:
|
|
131
131
|
return True
|
132
132
|
|
133
133
|
|
134
|
+
def pause(
|
135
|
+
self,
|
136
|
+
update: bool = True,
|
137
|
+
) -> bool:
|
138
|
+
"""
|
139
|
+
Determine whether or not the appropriate time has passed.
|
140
|
+
|
141
|
+
:param update: Determines whether or not time is updated.
|
142
|
+
:returns: Boolean indicating whether enough time passed.
|
143
|
+
"""
|
144
|
+
|
145
|
+
return not self.ready(update)
|
146
|
+
|
147
|
+
|
134
148
|
def update(
|
135
149
|
self,
|
136
150
|
value: Optional[PARSABLE] = None,
|
@@ -365,6 +365,23 @@ class Timers:
|
|
365
365
|
return ready
|
366
366
|
|
367
367
|
|
368
|
+
def pause(
|
369
|
+
self,
|
370
|
+
unique: str,
|
371
|
+
update: bool = True,
|
372
|
+
) -> bool:
|
373
|
+
"""
|
374
|
+
Determine whether or not the appropriate time has passed.
|
375
|
+
|
376
|
+
:param unique: Unique identifier for the related child.
|
377
|
+
:param update: Determines whether or not time is updated.
|
378
|
+
:returns: Boolean indicating whether enough time passed.
|
379
|
+
"""
|
380
|
+
|
381
|
+
return not self.ready(
|
382
|
+
unique, update)
|
383
|
+
|
384
|
+
|
368
385
|
def create(
|
369
386
|
self,
|
370
387
|
unique: str,
|
@@ -0,0 +1 @@
|
|
1
|
+
0.17.1
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: encommon
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.17.1
|
4
4
|
Summary: Enasis Network Common Library
|
5
5
|
License: MIT
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
@@ -88,7 +88,7 @@ make -s pytest
|
|
88
88
|
|
89
89
|
1. Create [repository](https://github.com/enasisnetwork/encommon) release.
|
90
90
|
|
91
|
-
1. Build the Python package.<br>
|
91
|
+
1. Build the Python package.<br>Be sure no uncommited files in tree.
|
92
92
|
```
|
93
93
|
make -s pypackage
|
94
94
|
```
|
@@ -1 +0,0 @@
|
|
1
|
-
0.16.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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|