encommon 0.12.0__py3-none-any.whl → 0.12.2__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.
- encommon/config/logger.py +3 -0
- encommon/config/params.py +0 -2
- encommon/times/params.py +0 -4
- encommon/times/test/test_timers.py +2 -0
- encommon/times/timers.py +27 -16
- encommon/times/windows.py +20 -14
- encommon/version.txt +1 -1
- {encommon-0.12.0.dist-info → encommon-0.12.2.dist-info}/METADATA +31 -14
- {encommon-0.12.0.dist-info → encommon-0.12.2.dist-info}/RECORD +12 -12
- {encommon-0.12.0.dist-info → encommon-0.12.2.dist-info}/LICENSE +0 -0
- {encommon-0.12.0.dist-info → encommon-0.12.2.dist-info}/WHEEL +0 -0
- {encommon-0.12.0.dist-info → encommon-0.12.2.dist-info}/top_level.txt +0 -0
encommon/config/logger.py
CHANGED
encommon/config/params.py
CHANGED
@@ -37,8 +37,6 @@ class LoggerParams(BaseModel, extra='forbid'):
|
|
37
37
|
:param stdo_level: Minimum level for the message to pass.
|
38
38
|
:param file_level: Minimum level for the message to pass.
|
39
39
|
:param file_path: Enables writing to the filesystem path.
|
40
|
-
:param data: Keyword arguments passed to Pydantic model.
|
41
|
-
Parameter is picked up by autodoc, please ignore.
|
42
40
|
"""
|
43
41
|
|
44
42
|
stdo_level: Optional[LOGLEVELS] = None
|
encommon/times/params.py
CHANGED
@@ -24,8 +24,6 @@ class TimerParams(BaseModel, extra='forbid'):
|
|
24
24
|
|
25
25
|
:param timer: Seconds that are used for related timer.
|
26
26
|
:param start: Optional time for when the timer started.
|
27
|
-
:param data: Keyword arguments passed to Pydantic model.
|
28
|
-
Parameter is picked up by autodoc, please ignore.
|
29
27
|
"""
|
30
28
|
|
31
29
|
timer: float
|
@@ -81,8 +79,6 @@ class WindowParams(BaseModel, extra='forbid'):
|
|
81
79
|
:param stop: Determine the ending for scheduling window.
|
82
80
|
:param anchor: Optionally define time anchor for window.
|
83
81
|
:param delay: Period of time schedulng will be delayed.
|
84
|
-
:param data: Keyword arguments passed to Pydantic model.
|
85
|
-
Parameter is picked up by autodoc, please ignore.
|
86
82
|
"""
|
87
83
|
|
88
84
|
window: SCHEDULE
|
@@ -58,6 +58,7 @@ def timers(
|
|
58
58
|
timer = TimersTable(
|
59
59
|
group='default',
|
60
60
|
unique='two',
|
61
|
+
last='1970-01-01T00:00:00Z',
|
61
62
|
update='1970-01-01T00:00:00Z')
|
62
63
|
|
63
64
|
session.add(timer)
|
@@ -68,6 +69,7 @@ def timers(
|
|
68
69
|
timer = TimersTable(
|
69
70
|
group='default',
|
70
71
|
unique='tre',
|
72
|
+
last='1970-01-01T00:00:00Z',
|
71
73
|
update='1970-01-01T00:00:00Z')
|
72
74
|
|
73
75
|
session.add(timer)
|
encommon/times/timers.py
CHANGED
@@ -36,6 +36,9 @@ TIMERS = dict[str, Timer]
|
|
36
36
|
class SQLBase(DeclarativeBase):
|
37
37
|
"""
|
38
38
|
Some additional class that SQLAlchemy requires to work.
|
39
|
+
|
40
|
+
.. note::
|
41
|
+
Input parameters are not defined, check parent class.
|
39
42
|
"""
|
40
43
|
|
41
44
|
|
@@ -48,8 +51,6 @@ class TimersTable(SQLBase):
|
|
48
51
|
Fields are not completely documented for this model.
|
49
52
|
"""
|
50
53
|
|
51
|
-
__tablename__ = 'timers'
|
52
|
-
|
53
54
|
group = Column(
|
54
55
|
String,
|
55
56
|
primary_key=True,
|
@@ -60,10 +61,16 @@ class TimersTable(SQLBase):
|
|
60
61
|
primary_key=True,
|
61
62
|
nullable=False)
|
62
63
|
|
64
|
+
last = Column(
|
65
|
+
String,
|
66
|
+
nullable=False)
|
67
|
+
|
63
68
|
update = Column(
|
64
69
|
String,
|
65
70
|
nullable=False)
|
66
71
|
|
72
|
+
__tablename__ = 'timers'
|
73
|
+
|
67
74
|
|
68
75
|
|
69
76
|
class Timers:
|
@@ -249,28 +256,30 @@ class Timers:
|
|
249
256
|
group = self.__group
|
250
257
|
|
251
258
|
session = self.store_session
|
252
|
-
table = TimersTable
|
253
|
-
|
254
259
|
|
255
260
|
config = params.timers
|
256
261
|
|
257
262
|
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
.order_by(table.unique))
|
263
|
+
_table = TimersTable
|
264
|
+
_group = _table.group
|
265
|
+
_unique = _table.unique
|
262
266
|
|
263
|
-
|
267
|
+
query = (
|
268
|
+
session.query(_table)
|
269
|
+
.filter(_group == group)
|
270
|
+
.order_by(_unique))
|
271
|
+
|
272
|
+
for record in query.all():
|
264
273
|
|
265
274
|
unique = str(record.unique)
|
266
|
-
|
275
|
+
last = str(record.last)
|
267
276
|
|
268
277
|
if unique not in config:
|
269
278
|
continue
|
270
279
|
|
271
280
|
_config = config[unique]
|
272
281
|
|
273
|
-
_config.start =
|
282
|
+
_config.start = last
|
274
283
|
|
275
284
|
|
276
285
|
items = config.items()
|
@@ -318,12 +327,14 @@ class Timers:
|
|
318
327
|
append = TimersTable(
|
319
328
|
group=group,
|
320
329
|
unique=unique,
|
330
|
+
last=timer.times.subsec,
|
321
331
|
update=update.subsec)
|
322
332
|
|
323
333
|
session.merge(append)
|
324
334
|
|
325
335
|
|
326
336
|
session.commit()
|
337
|
+
session.close()
|
327
338
|
|
328
339
|
|
329
340
|
def ready(
|
@@ -367,12 +378,12 @@ class Timers:
|
|
367
378
|
:returns: Newly constructed instance of related class.
|
368
379
|
"""
|
369
380
|
|
370
|
-
|
381
|
+
config = self.params.timers
|
371
382
|
|
372
|
-
if unique in
|
383
|
+
if unique in config:
|
373
384
|
raise ValueError('unique')
|
374
385
|
|
375
|
-
|
386
|
+
config[unique] = params
|
376
387
|
|
377
388
|
self.load_children()
|
378
389
|
|
@@ -400,9 +411,9 @@ class Timers:
|
|
400
411
|
|
401
412
|
timer = timers[unique]
|
402
413
|
|
403
|
-
|
414
|
+
timer.update(value)
|
404
415
|
|
405
|
-
|
416
|
+
self.save_children()
|
406
417
|
|
407
418
|
|
408
419
|
def delete(
|
encommon/times/windows.py
CHANGED
@@ -36,6 +36,9 @@ WINDOWS = dict[str, Window]
|
|
36
36
|
class SQLBase(DeclarativeBase):
|
37
37
|
"""
|
38
38
|
Some additional class that SQLAlchemy requires to work.
|
39
|
+
|
40
|
+
.. note::
|
41
|
+
Input parameters are not defined, check parent class.
|
39
42
|
"""
|
40
43
|
|
41
44
|
|
@@ -48,8 +51,6 @@ class WindowsTable(SQLBase):
|
|
48
51
|
Fields are not completely documented for this model.
|
49
52
|
"""
|
50
53
|
|
51
|
-
__tablename__ = 'windows'
|
52
|
-
|
53
54
|
group = Column(
|
54
55
|
String,
|
55
56
|
primary_key=True,
|
@@ -72,6 +73,8 @@ class WindowsTable(SQLBase):
|
|
72
73
|
String,
|
73
74
|
nullable=False)
|
74
75
|
|
76
|
+
__tablename__ = 'windows'
|
77
|
+
|
75
78
|
|
76
79
|
|
77
80
|
class Windows:
|
@@ -298,18 +301,20 @@ class Windows:
|
|
298
301
|
group = self.__group
|
299
302
|
|
300
303
|
session = self.store_session
|
301
|
-
table = WindowsTable
|
302
|
-
|
303
304
|
|
304
305
|
config = params.windows
|
305
306
|
|
306
307
|
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
308
|
+
_table = WindowsTable
|
309
|
+
_group = _table.group
|
310
|
+
_unique = _table.unique
|
311
|
+
|
312
|
+
query = (
|
313
|
+
session.query(_table)
|
314
|
+
.filter(_group == group)
|
315
|
+
.order_by(_unique))
|
311
316
|
|
312
|
-
for record in
|
317
|
+
for record in query.all():
|
313
318
|
|
314
319
|
unique = str(record.unique)
|
315
320
|
next = str(record.next)
|
@@ -394,6 +399,7 @@ class Windows:
|
|
394
399
|
|
395
400
|
|
396
401
|
session.commit()
|
402
|
+
session.close()
|
397
403
|
|
398
404
|
|
399
405
|
def ready(
|
@@ -437,12 +443,12 @@ class Windows:
|
|
437
443
|
:returns: Newly constructed instance of related class.
|
438
444
|
"""
|
439
445
|
|
440
|
-
|
446
|
+
config = self.params.windows
|
441
447
|
|
442
|
-
if unique in
|
448
|
+
if unique in config:
|
443
449
|
raise ValueError('unique')
|
444
450
|
|
445
|
-
|
451
|
+
config[unique] = params
|
446
452
|
|
447
453
|
self.load_children()
|
448
454
|
|
@@ -470,9 +476,9 @@ class Windows:
|
|
470
476
|
|
471
477
|
window = windows[unique]
|
472
478
|
|
473
|
-
|
479
|
+
window.update(value)
|
474
480
|
|
475
|
-
|
481
|
+
self.save_children()
|
476
482
|
|
477
483
|
|
478
484
|
def delete(
|
encommon/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.12.
|
1
|
+
0.12.2
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: encommon
|
3
|
-
Version: 0.12.
|
3
|
+
Version: 0.12.2
|
4
4
|
Summary: Enasis Network Common Library
|
5
5
|
License: MIT
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
@@ -74,16 +74,33 @@ information found in the `htmlcov` folder in the root of the project.
|
|
74
74
|
make -s pytest
|
75
75
|
```
|
76
76
|
|
77
|
-
##
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
```
|
82
|
-
|
83
|
-
```
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
77
|
+
## Version management
|
78
|
+
:warning: Ensure that no changes are pending.
|
79
|
+
|
80
|
+
1. Rebuild the environment.
|
81
|
+
```
|
82
|
+
make -s check-revenv
|
83
|
+
```
|
84
|
+
|
85
|
+
1. Update the [version.txt](encommon/version.txt) file.
|
86
|
+
|
87
|
+
1. Push to the `main` branch.
|
88
|
+
|
89
|
+
1. Create [repository](https://github.com/enasisnetwork/encommon) release.
|
90
|
+
|
91
|
+
1. Build the Python package.<br>
|
92
|
+
```
|
93
|
+
make -s pypackage
|
94
|
+
```
|
95
|
+
|
96
|
+
1. Upload Python package to PyPi test.
|
97
|
+
```
|
98
|
+
make -s pypi-upload-test
|
99
|
+
```
|
100
|
+
|
101
|
+
1. Upload Python package to PyPi prod.
|
102
|
+
```
|
103
|
+
make -s pypi-upload-prod
|
104
|
+
```
|
105
|
+
|
106
|
+
1. Update [Read the Docs](https://encommon.readthedocs.io) documentation.
|
@@ -1,12 +1,12 @@
|
|
1
1
|
encommon/__init__.py,sha256=VoXUcphq-gcXCraaU47EtXBftF6UVuQPMGr0fuCTt9A,525
|
2
2
|
encommon/conftest.py,sha256=zoshfXjo2y_NsmWSHErOaTZx7A5tSYxNAhUf4TmUZKE,1827
|
3
3
|
encommon/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
-
encommon/version.txt,sha256=
|
4
|
+
encommon/version.txt,sha256=9ILQbk7oMVjkKZnc-VHVkJhh2tfgMxfesrHi3dXEYnQ,7
|
5
5
|
encommon/config/__init__.py,sha256=iZdbW7A4m7iN4xt5cEeQqo0Klqs-CaPLdD5ocLmUYi8,856
|
6
6
|
encommon/config/config.py,sha256=ldq1LfXGq0kfZwmlWE9mGG_hCdRuLT98QyLqnZY6ms8,5312
|
7
7
|
encommon/config/files.py,sha256=ueXiKTOqlQ4GKUT9lLyOlE-tfr6QAkSxdUs0VPbwEnE,2385
|
8
|
-
encommon/config/logger.py,sha256=
|
9
|
-
encommon/config/params.py,sha256=
|
8
|
+
encommon/config/logger.py,sha256=7qjujhs0pI02gazhGpPCNa18qnuYpajVCTDlBkCtiro,14217
|
9
|
+
encommon/config/params.py,sha256=xygONdnwagGn06791nTX_mCR9hmdFl60RMe7MZr6ICw,2192
|
10
10
|
encommon/config/paths.py,sha256=f0JDqkmd1xVd9KJ6s0b5KaFk-N6MlOjz4n1W39A5JHM,2533
|
11
11
|
encommon/config/utils.py,sha256=VzTpBSZ-l6codt6vk4p4SpcmKk-H1OBy-9IUBPKP3t4,2039
|
12
12
|
encommon/config/test/__init__.py,sha256=i0JAeRcM-0YH2StGfwpaDbZV9dVribNSgFDcYcPPay8,313
|
@@ -25,20 +25,20 @@ encommon/crypts/test/test_hashes.py,sha256=JYpPit7ISv6u-5-HbC3wSCxuieySDLKawgnE7
|
|
25
25
|
encommon/times/__init__.py,sha256=aa3Wb2WBpZcf_RBgZu4vM3lEyPZhyuZicG5Fcg0DgEI,931
|
26
26
|
encommon/times/common.py,sha256=g7kkZLyodZCIPpdiPCZh0-UMHwn-rwCv_Y6gdSvek6k,988
|
27
27
|
encommon/times/duration.py,sha256=LTROiKcRXvPcs2Gz9KaB5Cmxo9NXd3TcMo5-jnTxPo0,10794
|
28
|
-
encommon/times/params.py,sha256=
|
28
|
+
encommon/times/params.py,sha256=qwfy7cw9_UlWUm2xWm1aRjJJZzZp36w3Bo3Rc-HU2hM,3515
|
29
29
|
encommon/times/parse.py,sha256=DXoT_NyWL2Ea_j3vlGHMDY-5P6NBeYHyGhJoiavgBS0,6144
|
30
30
|
encommon/times/timer.py,sha256=19dt7A5nJEUdr_0p3WDFGO-Q49OHt3sgPW4R2zHoScU,2901
|
31
|
-
encommon/times/timers.py,sha256=
|
31
|
+
encommon/times/timers.py,sha256=dtwPGpCkNFDoydzgpq33bl_xkcLWzHUUhK94MaYNGCs,8784
|
32
32
|
encommon/times/times.py,sha256=FBOAVY1H21OV4BjGHj6iJrYbGQpSkWPj3Ss2Vepdvu4,9682
|
33
33
|
encommon/times/utils.py,sha256=PJ5QsKb3_pYEnD3Sz81d8QDhYQtTIj4HJfMoC9gNwmo,3100
|
34
34
|
encommon/times/window.py,sha256=3ctrDd0UWvnwrqxRZf7M-mVeEYVWvet6GZTj17YQ9sU,8526
|
35
|
-
encommon/times/windows.py,sha256=
|
35
|
+
encommon/times/windows.py,sha256=2MdZPMkkkDUvec70EtlakHPtYA31UHmYKaaVgCVJ994,10277
|
36
36
|
encommon/times/test/__init__.py,sha256=PjrnBYT0efyvbaGeNx94dm3tP3EVHUHSVs-VGeLEv5g,218
|
37
37
|
encommon/times/test/test_duration.py,sha256=ofCBdQ4-tOKP5W5U2xyTaZrCVvD-dWEgnYoCvZ99MuA,4189
|
38
38
|
encommon/times/test/test_params.py,sha256=kHvs-WvKfPQCdCDnPU9tAyMVXmzH3eUjwQN-QdWBeh4,1407
|
39
39
|
encommon/times/test/test_parse.py,sha256=ozP8PBgIsqdknK8cEtlYA3KusKnJzbjfAUKhcFv_eFk,4054
|
40
40
|
encommon/times/test/test_timer.py,sha256=A5pBmkd1i71LTpG-uA9-9UGNJUK8tkw6by8Adm0AbGE,1400
|
41
|
-
encommon/times/test/test_timers.py,sha256=
|
41
|
+
encommon/times/test/test_timers.py,sha256=7PC9WgA4_HcgW7zH6I7UxaRsLrxzMx48VfHw176RNaA,3919
|
42
42
|
encommon/times/test/test_times.py,sha256=vxEtXI9gYFlWnBLsyPyi17a96MJzgcI79SCy8U1Co8I,1748
|
43
43
|
encommon/times/test/test_utils.py,sha256=WkzHJY6zOt02Ujg5FItOo1nPtktz5ss8ODmG1tRQaaw,2056
|
44
44
|
encommon/times/test/test_window.py,sha256=Sx_fd0J1ofaFx52t-uWz9Isa9KqBxPFnynzfGfiG7uo,6098
|
@@ -66,8 +66,8 @@ encommon/utils/test/test_match.py,sha256=QagKpTFdRo23-Y55fSaJrSMpt5jIebScKbz0h8t
|
|
66
66
|
encommon/utils/test/test_paths.py,sha256=1yiZp5PCxljGk0J6fwIfWOUl-KWz40INybrwrN3JIog,1945
|
67
67
|
encommon/utils/test/test_sample.py,sha256=sHAeWOL1mchTGYGQaFK_A3Z28tThuULumm9kQebnIdk,1710
|
68
68
|
encommon/utils/test/test_stdout.py,sha256=TA7xQuFoPZUYW2l00e04MGp4P9gHkkVxVflvPlhpQXg,4878
|
69
|
-
encommon-0.12.
|
70
|
-
encommon-0.12.
|
71
|
-
encommon-0.12.
|
72
|
-
encommon-0.12.
|
73
|
-
encommon-0.12.
|
69
|
+
encommon-0.12.2.dist-info/LICENSE,sha256=otnXKCtMjPlbHs0wgZ_BWULrp3g_2dWQJ6icRk9nkgg,1071
|
70
|
+
encommon-0.12.2.dist-info/METADATA,sha256=grKBX9PyQwrEEi6QCS-FvraKKbLQgEMftCFFMTOrrhU,3362
|
71
|
+
encommon-0.12.2.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
72
|
+
encommon-0.12.2.dist-info/top_level.txt,sha256=bP8q7-5tLDNm-3XPlqn_bDENfYNug5801H_xfz3BEAM,9
|
73
|
+
encommon-0.12.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|