encommon 0.16.0__py3-none-any.whl → 0.17.0__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- encommon/times/test/test_timer.py +5 -0
- encommon/times/test/test_timers.py +4 -0
- encommon/times/timer.py +14 -0
- encommon/times/timers.py +17 -0
- encommon/version.txt +1 -1
- {encommon-0.16.0.dist-info → encommon-0.17.0.dist-info}/METADATA +1 -1
- {encommon-0.16.0.dist-info → encommon-0.17.0.dist-info}/RECORD +10 -10
- {encommon-0.16.0.dist-info → encommon-0.17.0.dist-info}/WHEEL +1 -1
- {encommon-0.16.0.dist-info → encommon-0.17.0.dist-info}/LICENSE +0 -0
- {encommon-0.16.0.dist-info → encommon-0.17.0.dist-info}/top_level.txt +0 -0
@@ -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
|
|
encommon/times/timer.py
CHANGED
@@ -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,
|
encommon/times/timers.py
CHANGED
@@ -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,
|
encommon/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.17.0
|
@@ -1,7 +1,7 @@
|
|
1
1
|
encommon/__init__.py,sha256=YDGzuhpk5Gd1hq54LI0hw1NrrDvrJDrvH20TEy_0l5E,443
|
2
2
|
encommon/conftest.py,sha256=pDU0t5M2fMKPFZsbxJ1ty_dxW_BoiyEC7VoNSqNBVHc,1899
|
3
3
|
encommon/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
-
encommon/version.txt,sha256=
|
4
|
+
encommon/version.txt,sha256=AtOOmOiPSo3C6kDbt2kzhgEGb8lJILUogqFPIa2X9-4,7
|
5
5
|
encommon/colors/__init__.py,sha256=XRiGimMj8oo040NO5a5ZsbsIUxaGVW4tf4xWTPWgnZY,269
|
6
6
|
encommon/colors/color.py,sha256=EiUxNbVL1689Cqhw1LmO9ysmN3ulCVtGZGylyV8LuVA,10884
|
7
7
|
encommon/colors/test/__init__.py,sha256=PjrnBYT0efyvbaGeNx94dm3tP3EVHUHSVs-VGeLEv5g,218
|
@@ -32,8 +32,8 @@ encommon/times/duration.py,sha256=LTROiKcRXvPcs2Gz9KaB5Cmxo9NXd3TcMo5-jnTxPo0,10
|
|
32
32
|
encommon/times/params.py,sha256=qg0mLkXVsl54m72kd9uXRvmYKqUR_Ag5PBfnTsrwQhE,4360
|
33
33
|
encommon/times/parse.py,sha256=_PF12z-UOa75SyeUpBXVn7Jjt-c-Pfnzt6pAs_PjXmQ,6496
|
34
34
|
encommon/times/time.py,sha256=mdYl8vDJ0ZbaiH96A1cFHhOn7fExiRnudQJP1M4Xe2E,11746
|
35
|
-
encommon/times/timer.py,sha256=
|
36
|
-
encommon/times/timers.py,sha256=
|
35
|
+
encommon/times/timer.py,sha256=xxS6KVXFuRLq-RkXWMR7MMX5x0HGrEhLlOhRCecuCZY,3225
|
36
|
+
encommon/times/timers.py,sha256=ROJzIP0WnYBladc0hFMDOX2m_Hnd4F6rJD8PUxpq_tg,9779
|
37
37
|
encommon/times/unitime.py,sha256=pO2I6qaSxR4HN82QSQYX6fo27xTP-n6bW8TahOG8c2k,1179
|
38
38
|
encommon/times/utils.py,sha256=PJ5QsKb3_pYEnD3Sz81d8QDhYQtTIj4HJfMoC9gNwmo,3100
|
39
39
|
encommon/times/window.py,sha256=tnOPz57cwIXVnOEGh7WPvBPhdjenvw1bYxV4mz721n0,8490
|
@@ -43,8 +43,8 @@ encommon/times/test/test_duration.py,sha256=BZLTggT87HnQcQODHXM50nW8iE-ROZF3aSPf
|
|
43
43
|
encommon/times/test/test_params.py,sha256=kHvs-WvKfPQCdCDnPU9tAyMVXmzH3eUjwQN-QdWBeh4,1407
|
44
44
|
encommon/times/test/test_parse.py,sha256=3Dihhu8xKmgbcq_dqKcO-itAeGtqAJxjGFQ6dPsJ4XM,4210
|
45
45
|
encommon/times/test/test_time.py,sha256=CrmC9dY9ROqQqYV_cQHpBPfgsiZBhrppTVfPLbSINnQ,2235
|
46
|
-
encommon/times/test/test_timer.py,sha256=
|
47
|
-
encommon/times/test/test_timers.py,sha256=
|
46
|
+
encommon/times/test/test_timer.py,sha256=_Sry94CaQicncjEhM8QniL5IGujMHprCLOy-3UzTqfY,1541
|
47
|
+
encommon/times/test/test_timers.py,sha256=xHaZcopALER3dbz73OR1C1w2DIqpyEdSGJm_rGT9xt8,3870
|
48
48
|
encommon/times/test/test_unitime.py,sha256=5i4UjBCw8R9h-Lw963GfB_dHBMEQhjvv1k-t27Wyyls,510
|
49
49
|
encommon/times/test/test_utils.py,sha256=WkzHJY6zOt02Ujg5FItOo1nPtktz5ss8ODmG1tRQaaw,2056
|
50
50
|
encommon/times/test/test_window.py,sha256=gNJpWVrwQTnUFQ00OLzWUuvJjWUCoiCwydohr9mevT0,6116
|
@@ -77,8 +77,8 @@ encommon/utils/test/test_match.py,sha256=QagKpTFdRo23-Y55fSaJrSMpt5jIebScKbz0h8t
|
|
77
77
|
encommon/utils/test/test_paths.py,sha256=4AzIhQyYFEWhRWHgOZCCzomQ3Zs3EVwRnDQDa6Nq1Mc,1942
|
78
78
|
encommon/utils/test/test_sample.py,sha256=Qf-W0XbjTe5PfG87sdVizL2ymUPRTdX0qQtLGHaTgx8,3539
|
79
79
|
encommon/utils/test/test_stdout.py,sha256=fYiqEaUraD-3hFQYLxMPR4Ti_8CbTjEc8WvReXUA884,6139
|
80
|
-
encommon-0.
|
81
|
-
encommon-0.
|
82
|
-
encommon-0.
|
83
|
-
encommon-0.
|
84
|
-
encommon-0.
|
80
|
+
encommon-0.17.0.dist-info/LICENSE,sha256=otnXKCtMjPlbHs0wgZ_BWULrp3g_2dWQJ6icRk9nkgg,1071
|
81
|
+
encommon-0.17.0.dist-info/METADATA,sha256=ieo8193Z8YtT8np40oSLNq-qST2PJzp5QMtxozJ9CIY,3362
|
82
|
+
encommon-0.17.0.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
|
83
|
+
encommon-0.17.0.dist-info/top_level.txt,sha256=bP8q7-5tLDNm-3XPlqn_bDENfYNug5801H_xfz3BEAM,9
|
84
|
+
encommon-0.17.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|