encommon 0.14.0__py3-none-any.whl → 0.16.0__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/colors/__init__.py +2 -2
- encommon/colors/{colors.py → color.py} +24 -24
- encommon/colors/test/{test_colors.py → test_color.py} +16 -16
- encommon/config/config.py +27 -27
- encommon/config/files.py +14 -14
- encommon/config/logger.py +7 -7
- encommon/config/params.py +47 -30
- encommon/config/paths.py +13 -13
- encommon/config/test/__init__.py +1 -1
- encommon/config/test/test_config.py +45 -18
- encommon/config/test/test_files.py +8 -7
- encommon/config/test/test_logger.py +11 -10
- encommon/config/test/test_paths.py +11 -10
- encommon/config/utils.py +2 -2
- encommon/crypts/crypts.py +2 -2
- encommon/crypts/params.py +28 -12
- encommon/crypts/test/test_crypts.py +5 -5
- encommon/crypts/test/test_hashes.py +2 -1
- encommon/times/__init__.py +2 -2
- encommon/times/common.py +2 -2
- encommon/times/params.py +76 -48
- encommon/times/parse.py +3 -3
- encommon/times/test/test_duration.py +3 -2
- encommon/times/test/test_time.py +123 -0
- encommon/times/test/test_timer.py +5 -4
- encommon/times/test/test_timers.py +10 -9
- encommon/times/test/test_window.py +4 -3
- encommon/times/test/test_windows.py +7 -6
- encommon/times/{times.py → time.py} +62 -15
- encommon/times/timer.py +10 -10
- encommon/times/timers.py +5 -5
- encommon/times/unitime.py +9 -0
- encommon/times/window.py +31 -31
- encommon/times/windows.py +12 -12
- encommon/types/classes.py +2 -15
- encommon/types/lists.py +6 -0
- encommon/types/notate.py +2 -1
- encommon/types/strings.py +5 -0
- encommon/types/test/test_classes.py +2 -2
- encommon/types/test/test_empty.py +2 -1
- encommon/utils/sample.py +8 -7
- encommon/utils/stdout.py +4 -5
- encommon/utils/test/test_paths.py +3 -3
- encommon/utils/test/test_sample.py +2 -2
- encommon/utils/test/test_stdout.py +3 -3
- encommon/version.txt +1 -1
- {encommon-0.14.0.dist-info → encommon-0.16.0.dist-info}/METADATA +1 -1
- encommon-0.16.0.dist-info/RECORD +84 -0
- {encommon-0.14.0.dist-info → encommon-0.16.0.dist-info}/WHEEL +1 -1
- encommon/times/test/test_times.py +0 -122
- encommon-0.14.0.dist-info/RECORD +0 -84
- {encommon-0.14.0.dist-info → encommon-0.16.0.dist-info}/LICENSE +0 -0
- {encommon-0.14.0.dist-info → encommon-0.16.0.dist-info}/top_level.txt +0 -0
encommon/utils/sample.py
CHANGED
@@ -16,10 +16,11 @@ from typing import Any
|
|
16
16
|
from typing import Callable
|
17
17
|
from typing import Optional
|
18
18
|
|
19
|
-
from pydantic import BaseModel
|
20
19
|
|
21
20
|
from .files import read_text
|
22
21
|
from .files import save_text
|
22
|
+
from ..types import BaseModel
|
23
|
+
from ..types import DictStrAny
|
23
24
|
from ..types import rplstr
|
24
25
|
|
25
26
|
|
@@ -35,7 +36,7 @@ def prep_sample( # noqa: CFQ004
|
|
35
36
|
content: Any,
|
36
37
|
*,
|
37
38
|
default: Callable[[Any], str] = str,
|
38
|
-
replace: Optional[
|
39
|
+
replace: Optional[DictStrAny] = None,
|
39
40
|
indent: Optional[int] = 2,
|
40
41
|
) -> str:
|
41
42
|
r"""
|
@@ -61,7 +62,7 @@ def prep_sample( # noqa: CFQ004
|
|
61
62
|
|
62
63
|
def _default(
|
63
64
|
value: Any, # noqa: ANN401
|
64
|
-
) ->
|
65
|
+
) -> DictStrAny | str:
|
65
66
|
|
66
67
|
if is_dataclass(value):
|
67
68
|
|
@@ -71,7 +72,7 @@ def prep_sample( # noqa: CFQ004
|
|
71
72
|
return asdict(value)
|
72
73
|
|
73
74
|
if isinstance(value, BaseModel):
|
74
|
-
return value.
|
75
|
+
return value.endumped
|
75
76
|
|
76
77
|
return str(value)
|
77
78
|
|
@@ -104,7 +105,7 @@ def load_sample(
|
|
104
105
|
update: bool = False,
|
105
106
|
*,
|
106
107
|
default: Callable[[Any], str] = str,
|
107
|
-
replace: Optional[
|
108
|
+
replace: Optional[DictStrAny] = None,
|
108
109
|
) -> str:
|
109
110
|
r"""
|
110
111
|
Load the sample file and compare using provided content.
|
@@ -173,7 +174,7 @@ def load_sample(
|
|
173
174
|
def read_sample(
|
174
175
|
sample: str,
|
175
176
|
*,
|
176
|
-
replace: Optional[
|
177
|
+
replace: Optional[DictStrAny] = None,
|
177
178
|
prefix: bool = True,
|
178
179
|
) -> str:
|
179
180
|
"""
|
@@ -204,7 +205,7 @@ def read_sample(
|
|
204
205
|
def rvrt_sample(
|
205
206
|
sample: str,
|
206
207
|
*,
|
207
|
-
replace: Optional[
|
208
|
+
replace: Optional[DictStrAny] = None,
|
208
209
|
) -> str:
|
209
210
|
"""
|
210
211
|
Return the content after processing as the sample value.
|
encommon/utils/stdout.py
CHANGED
@@ -19,11 +19,10 @@ from typing import Optional
|
|
19
19
|
from typing import TYPE_CHECKING
|
20
20
|
from typing import Union
|
21
21
|
|
22
|
-
from pydantic import BaseModel
|
23
|
-
|
24
22
|
from .common import JOINABLE
|
25
23
|
from ..times import Duration
|
26
|
-
from ..times import
|
24
|
+
from ..times import Time
|
25
|
+
from ..types import BaseModel
|
27
26
|
from ..types import Empty
|
28
27
|
from ..types import clsname
|
29
28
|
from ..types.strings import COMMAD
|
@@ -287,7 +286,7 @@ def array_ansi( # noqa: CFQ001, CFQ004
|
|
287
286
|
elif isinstance(source, Duration):
|
288
287
|
color = colors.times
|
289
288
|
|
290
|
-
elif isinstance(source,
|
289
|
+
elif isinstance(source, Time):
|
291
290
|
color = colors.times
|
292
291
|
|
293
292
|
elif source is Empty:
|
@@ -308,7 +307,7 @@ def array_ansi( # noqa: CFQ001, CFQ004
|
|
308
307
|
) -> None:
|
309
308
|
|
310
309
|
if isinstance(source, BaseModel):
|
311
|
-
source = source.
|
310
|
+
source = source.endumped
|
312
311
|
|
313
312
|
if is_dataclass(source):
|
314
313
|
source = asdict(source)
|
@@ -13,7 +13,7 @@ from ..paths import resolve_path
|
|
13
13
|
from ..paths import resolve_paths
|
14
14
|
from ..paths import stats_path
|
15
15
|
from ... import PROJECT
|
16
|
-
from ...times import
|
16
|
+
from ...times import Time
|
17
17
|
|
18
18
|
|
19
19
|
|
@@ -67,9 +67,9 @@ def test_stats_path() -> None:
|
|
67
67
|
stat = stats['/utils/paths.py']
|
68
68
|
|
69
69
|
assert stat.st_ctime >= (
|
70
|
-
|
70
|
+
Time('2023-01-01').epoch)
|
71
71
|
assert stat.st_mtime >= (
|
72
|
-
|
72
|
+
Time('2023-01-01').epoch)
|
73
73
|
|
74
74
|
assert stat.st_size >= 2000
|
75
75
|
|
@@ -151,7 +151,7 @@ def test_read_sample(
|
|
151
151
|
|
152
152
|
expect = dumps(_EXPECT)
|
153
153
|
|
154
|
-
assert
|
154
|
+
assert expect == sample
|
155
155
|
|
156
156
|
|
157
157
|
|
@@ -179,4 +179,4 @@ def test_rvrt_sample(
|
|
179
179
|
|
180
180
|
expect = dumps(_EXPECT)
|
181
181
|
|
182
|
-
assert
|
182
|
+
assert expect == sample
|
@@ -17,7 +17,7 @@ from ..stdout import print_ansi
|
|
17
17
|
from ..stdout import strip_ansi
|
18
18
|
from ...config import LoggerParams
|
19
19
|
from ...times import Duration
|
20
|
-
from ...times import
|
20
|
+
from ...times import Time
|
21
21
|
from ...times.common import UNIXMPOCH
|
22
22
|
from ...types import Empty
|
23
23
|
|
@@ -170,7 +170,7 @@ def test_array_ansi() -> None: # noqa: CFQ001
|
|
170
170
|
'colors': colors,
|
171
171
|
'params': params,
|
172
172
|
'Empty': Empty,
|
173
|
-
'
|
173
|
+
'Time': Time(0),
|
174
174
|
'Duration': durate}
|
175
175
|
|
176
176
|
|
@@ -254,7 +254,7 @@ def test_array_ansi() -> None: # noqa: CFQ001
|
|
254
254
|
' file_level: None\n'
|
255
255
|
' file_path: None\n'
|
256
256
|
'Empty: Empty\n'
|
257
|
-
f'
|
257
|
+
f'Time: {UNIXMPOCH}\n'
|
258
258
|
'Duration: 2d5h')
|
259
259
|
|
260
260
|
|
encommon/version.txt
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.16.0
|
@@ -0,0 +1,84 @@
|
|
1
|
+
encommon/__init__.py,sha256=YDGzuhpk5Gd1hq54LI0hw1NrrDvrJDrvH20TEy_0l5E,443
|
2
|
+
encommon/conftest.py,sha256=pDU0t5M2fMKPFZsbxJ1ty_dxW_BoiyEC7VoNSqNBVHc,1899
|
3
|
+
encommon/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
+
encommon/version.txt,sha256=qgN0VLXoMgUhoysnij9K_wX8eQCatVA_XUobmjOzjEc,7
|
5
|
+
encommon/colors/__init__.py,sha256=XRiGimMj8oo040NO5a5ZsbsIUxaGVW4tf4xWTPWgnZY,269
|
6
|
+
encommon/colors/color.py,sha256=EiUxNbVL1689Cqhw1LmO9ysmN3ulCVtGZGylyV8LuVA,10884
|
7
|
+
encommon/colors/test/__init__.py,sha256=PjrnBYT0efyvbaGeNx94dm3tP3EVHUHSVs-VGeLEv5g,218
|
8
|
+
encommon/colors/test/test_color.py,sha256=GKYzfnOlb2yKI0qmPDxumkeQNSXpvxTprUV9pAJPV94,4566
|
9
|
+
encommon/config/__init__.py,sha256=iZdbW7A4m7iN4xt5cEeQqo0Klqs-CaPLdD5ocLmUYi8,856
|
10
|
+
encommon/config/config.py,sha256=-votrrG3pvU3oWrHoIMKu-pPZSC2MpdGz-1RSK6uXtk,6953
|
11
|
+
encommon/config/files.py,sha256=dSuShvIbQXFiNmpkwNVHCKDI-phBWC03OJVUfKJnfX0,2433
|
12
|
+
encommon/config/logger.py,sha256=1eAcJ2reIhk1SVhhcfPNiUGtRPj0N3h1e_YHX7w_IKg,14332
|
13
|
+
encommon/config/params.py,sha256=FtcWi3-CY6OHLN7o3S-iBktpS1yGt5wLVD0546XEKRY,2223
|
14
|
+
encommon/config/paths.py,sha256=6eLhqEXDyNQpwdL6QWNPf060uayuUzXyM6A3ikNC24Q,2585
|
15
|
+
encommon/config/utils.py,sha256=jZ9x6Nd7H4XZMSyAFr7mydgIu8P7xBzjHqKzMpmduw0,2127
|
16
|
+
encommon/config/test/__init__.py,sha256=Vs5Pca7QBgoyoSjk6DSpO0YFcqkUhap5-VLbaCn8MjA,304
|
17
|
+
encommon/config/test/test_config.py,sha256=uhvkgdW_vRX4MeKlRb4u0lJnpF4sqrgKxUXU97i2LA0,2965
|
18
|
+
encommon/config/test/test_files.py,sha256=elw484lZ9pF9fhBhRWQ_xCVjFhQXd0E5BMNaB3cbMAs,2301
|
19
|
+
encommon/config/test/test_logger.py,sha256=jj-vX9v4cl0nAqb3lgDoDeDCQMzP63Ip-ek1eIh5bmc,5293
|
20
|
+
encommon/config/test/test_paths.py,sha256=f3slZZkJqnFJK4DAFbQSdnUymhap1GXc9eZmS--vNT4,2649
|
21
|
+
encommon/config/test/test_utils.py,sha256=RePpMD97HRCTkZ75ES8Eaf6_BOpcw_DknpgCFZGlQYg,1066
|
22
|
+
encommon/crypts/__init__.py,sha256=UsGEitz8rWa7DQF3iAxEbTUAbdiEnE87LSuRs4OBeAQ,371
|
23
|
+
encommon/crypts/crypts.py,sha256=gsppdcUAdw7UBGIy28m3-JR7kFcu6wUqc2hyvQ1nqpY,4638
|
24
|
+
encommon/crypts/hashes.py,sha256=bpQf2-Ma5SdMaEWP2nL1_9rtEQmTE0XTdDvSD-fQ9Mk,3075
|
25
|
+
encommon/crypts/params.py,sha256=2uH_i1NBMlzhq7UtWgX2jsiUGNniOK69eTCeeiQFpdw,1417
|
26
|
+
encommon/crypts/test/__init__.py,sha256=PjrnBYT0efyvbaGeNx94dm3tP3EVHUHSVs-VGeLEv5g,218
|
27
|
+
encommon/crypts/test/test_crypts.py,sha256=F-81-2R8_xfPMRU8QLYzfnvp01uP5BB-xA0XtmMISJE,3482
|
28
|
+
encommon/crypts/test/test_hashes.py,sha256=OmidSycLkUyso6K5Hfun2NopPXA1uL3SFqz_2aITOMM,1201
|
29
|
+
encommon/times/__init__.py,sha256=QX4iuZ59UlsMbEWbubnVJXJtrOubNxAAAv510urcLUA,972
|
30
|
+
encommon/times/common.py,sha256=HWgWBbqDoyKHIqeg4bBAZZfRM3499X3WPu8dVCzt_5o,995
|
31
|
+
encommon/times/duration.py,sha256=LTROiKcRXvPcs2Gz9KaB5Cmxo9NXd3TcMo5-jnTxPo0,10794
|
32
|
+
encommon/times/params.py,sha256=qg0mLkXVsl54m72kd9uXRvmYKqUR_Ag5PBfnTsrwQhE,4360
|
33
|
+
encommon/times/parse.py,sha256=_PF12z-UOa75SyeUpBXVn7Jjt-c-Pfnzt6pAs_PjXmQ,6496
|
34
|
+
encommon/times/time.py,sha256=mdYl8vDJ0ZbaiH96A1cFHhOn7fExiRnudQJP1M4Xe2E,11746
|
35
|
+
encommon/times/timer.py,sha256=oNU86QRTMfwocL9dhrw0uo1wV9ZTXW3yXYH3W2rbGRY,2889
|
36
|
+
encommon/times/timers.py,sha256=RN6kyMrRlv_kc5JuasI2kOoRq5XxBfFgbiP2fqM9yI4,9337
|
37
|
+
encommon/times/unitime.py,sha256=pO2I6qaSxR4HN82QSQYX6fo27xTP-n6bW8TahOG8c2k,1179
|
38
|
+
encommon/times/utils.py,sha256=PJ5QsKb3_pYEnD3Sz81d8QDhYQtTIj4HJfMoC9gNwmo,3100
|
39
|
+
encommon/times/window.py,sha256=tnOPz57cwIXVnOEGh7WPvBPhdjenvw1bYxV4mz721n0,8490
|
40
|
+
encommon/times/windows.py,sha256=LAuM41ttsorhLpYYLgR_zzzkX-tMmpFzS6e_EdYUKoA,10825
|
41
|
+
encommon/times/test/__init__.py,sha256=PjrnBYT0efyvbaGeNx94dm3tP3EVHUHSVs-VGeLEv5g,218
|
42
|
+
encommon/times/test/test_duration.py,sha256=BZLTggT87HnQcQODHXM50nW8iE-ROZF3aSPfIFddkKQ,4202
|
43
|
+
encommon/times/test/test_params.py,sha256=kHvs-WvKfPQCdCDnPU9tAyMVXmzH3eUjwQN-QdWBeh4,1407
|
44
|
+
encommon/times/test/test_parse.py,sha256=3Dihhu8xKmgbcq_dqKcO-itAeGtqAJxjGFQ6dPsJ4XM,4210
|
45
|
+
encommon/times/test/test_time.py,sha256=CrmC9dY9ROqQqYV_cQHpBPfgsiZBhrppTVfPLbSINnQ,2235
|
46
|
+
encommon/times/test/test_timer.py,sha256=w_Rh3APNmE_7OndtlIIC5YiAMEE4KImeLgF5mQWbb3o,1416
|
47
|
+
encommon/times/test/test_timers.py,sha256=X148zl5Dkm3KN-F5PW0JldJ0ntoFUJavCxBNtbnGp7E,3746
|
48
|
+
encommon/times/test/test_unitime.py,sha256=5i4UjBCw8R9h-Lw963GfB_dHBMEQhjvv1k-t27Wyyls,510
|
49
|
+
encommon/times/test/test_utils.py,sha256=WkzHJY6zOt02Ujg5FItOo1nPtktz5ss8ODmG1tRQaaw,2056
|
50
|
+
encommon/times/test/test_window.py,sha256=gNJpWVrwQTnUFQ00OLzWUuvJjWUCoiCwydohr9mevT0,6116
|
51
|
+
encommon/times/test/test_windows.py,sha256=IaaxUXqf5n9IF9X0HkRqtCdyOdeCq5DYR1ySLORA9gE,4474
|
52
|
+
encommon/types/__init__.py,sha256=_DVoVFJWd-9aCpXtPEaB3CnZ-5gt-uYxMWzquXfXHpg,1047
|
53
|
+
encommon/types/classes.py,sha256=FYFTu8Uj-74JWudHOlhaOrsXXPxitorBfM9_QM3EGSU,1689
|
54
|
+
encommon/types/dicts.py,sha256=lC2FmPzMEj9L73jUjf3o6OVQ-LqK_3gp5nBwYibdGfo,2265
|
55
|
+
encommon/types/empty.py,sha256=n5y5maXkcM3xNYNYGK6iqvk98ivQSeguaedwc0HoMv4,2739
|
56
|
+
encommon/types/lists.py,sha256=4xn1RqS1VMsNnhR-2Xpv4ykB6d2RteFa5zdiWKzo55o,745
|
57
|
+
encommon/types/notate.py,sha256=0JIzF5VDnQ6C4umZIpgxIvd91gFo3MXTZ7Kp54S538A,6454
|
58
|
+
encommon/types/strings.py,sha256=LW2WZND64cKE1LhNip3vqsoP3elLsUP6cpS0dYnUKGE,2800
|
59
|
+
encommon/types/types.py,sha256=DbzdDLLclD1Gk8bmyhDUUWVDnJ5LdaolLV3JYKHFVgA,322
|
60
|
+
encommon/types/test/__init__.py,sha256=UIyNazTlIIdUzQS0brlD7hCPN_LYw_J6Ucxm8wh3cPU,789
|
61
|
+
encommon/types/test/test_classes.py,sha256=CjthMInwz5WB7aTc7-GpzgcYAvkF9dRmC6nXJVoE91k,1475
|
62
|
+
encommon/types/test/test_dicts.py,sha256=-RLkcyexCXGSyJyPx1e3QU8sNXEgtSvD9pZakdOwVvg,2702
|
63
|
+
encommon/types/test/test_empty.py,sha256=LVsZbKOg0deyKOtg_0Fhf0b_0c94LftwdDhijna-FbA,995
|
64
|
+
encommon/types/test/test_lists.py,sha256=RXvIQvr1nODutPBRx5hMsPRq_10AzBWF594KINoMgU8,437
|
65
|
+
encommon/types/test/test_notate.py,sha256=NfrDmMD6hOoVi9wlQ8yLZNnuHwS6Z7bLze70FkxOjSA,4008
|
66
|
+
encommon/types/test/test_strings.py,sha256=oXusioFMdknHeBdwlP_GakDVS9Tf2YBndjonj22UfmM,1277
|
67
|
+
encommon/utils/__init__.py,sha256=bBgh81wX_TwLgWkx0aBAyVLHNphrfcyQc1AF7-ziyNI,1027
|
68
|
+
encommon/utils/common.py,sha256=-bjGJ2UJa-WTOsVYiuZcVj1gkyH5OlRdRkJtxPw8J6k,555
|
69
|
+
encommon/utils/files.py,sha256=2uj10JfvKZHdLHNF992_LUvQ4rfMRCZGqJd7LrxKDnE,1458
|
70
|
+
encommon/utils/match.py,sha256=XvmmMKQ1q8_21zzPGuVvaZf6XwHXPZn4IWIYBEqVCQM,2471
|
71
|
+
encommon/utils/paths.py,sha256=u8-vTONG3QdnpkKfVpl19WssH95bCHg1gHlnRwzyAFM,3509
|
72
|
+
encommon/utils/sample.py,sha256=wcT_me9L-U6atd8kEew4q_4B-iIn8vV1LhEDoVr-cFw,4834
|
73
|
+
encommon/utils/stdout.py,sha256=aYNX_Ey9sSwnsfAT8VmRs_Kz0sz9n6gtuR_9Recaa64,8569
|
74
|
+
encommon/utils/test/__init__.py,sha256=PjrnBYT0efyvbaGeNx94dm3tP3EVHUHSVs-VGeLEv5g,218
|
75
|
+
encommon/utils/test/test_files.py,sha256=-hdl4UOo-vH1H5gTL1r9Ib3P26DtWaD2YV32P08ykvc,679
|
76
|
+
encommon/utils/test/test_match.py,sha256=QagKpTFdRo23-Y55fSaJrSMpt5jIebScKbz0h8tivrI,1124
|
77
|
+
encommon/utils/test/test_paths.py,sha256=4AzIhQyYFEWhRWHgOZCCzomQ3Zs3EVwRnDQDa6Nq1Mc,1942
|
78
|
+
encommon/utils/test/test_sample.py,sha256=Qf-W0XbjTe5PfG87sdVizL2ymUPRTdX0qQtLGHaTgx8,3539
|
79
|
+
encommon/utils/test/test_stdout.py,sha256=fYiqEaUraD-3hFQYLxMPR4Ti_8CbTjEc8WvReXUA884,6139
|
80
|
+
encommon-0.16.0.dist-info/LICENSE,sha256=otnXKCtMjPlbHs0wgZ_BWULrp3g_2dWQJ6icRk9nkgg,1071
|
81
|
+
encommon-0.16.0.dist-info/METADATA,sha256=Fi3EnRyxVlAZNsOC1poi1qgQ9xKP6ctpe2FShYU2-z0,3362
|
82
|
+
encommon-0.16.0.dist-info/WHEEL,sha256=Mdi9PDNwEZptOjTlUcAth7XJDFtKrHYaQMPulZeBCiQ,91
|
83
|
+
encommon-0.16.0.dist-info/top_level.txt,sha256=bP8q7-5tLDNm-3XPlqn_bDENfYNug5801H_xfz3BEAM,9
|
84
|
+
encommon-0.16.0.dist-info/RECORD,,
|
@@ -1,122 +0,0 @@
|
|
1
|
-
"""
|
2
|
-
Functions and routines associated with Enasis Network Common Library.
|
3
|
-
|
4
|
-
This file is part of Enasis Network software eco-system. Distribution
|
5
|
-
is permitted, for more information consult the project license file.
|
6
|
-
"""
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
from ..common import STAMP_SIMPLE
|
11
|
-
from ..common import UNIXEPOCH
|
12
|
-
from ..common import UNIXHPOCH
|
13
|
-
from ..common import UNIXMPOCH
|
14
|
-
from ..times import Times
|
15
|
-
from ...types import inrepr
|
16
|
-
from ...types import instr
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
def test_Times() -> None:
|
21
|
-
"""
|
22
|
-
Perform various tests associated with relevant routines.
|
23
|
-
"""
|
24
|
-
|
25
|
-
times = Times(
|
26
|
-
UNIXEPOCH,
|
27
|
-
format=STAMP_SIMPLE)
|
28
|
-
|
29
|
-
|
30
|
-
attrs = list(times.__dict__)
|
31
|
-
|
32
|
-
assert attrs == [
|
33
|
-
'_Times__source']
|
34
|
-
|
35
|
-
|
36
|
-
assert inrepr(
|
37
|
-
"Times('1970-01-01T00:00",
|
38
|
-
times)
|
39
|
-
|
40
|
-
assert hash(times) > 0
|
41
|
-
|
42
|
-
assert instr(
|
43
|
-
'1970-01-01T00:00:00.000',
|
44
|
-
times)
|
45
|
-
|
46
|
-
|
47
|
-
assert int(times) == 0
|
48
|
-
assert float(times) == 0.0
|
49
|
-
|
50
|
-
assert times + 1 == Times(1)
|
51
|
-
assert times - 1 == Times(-1)
|
52
|
-
|
53
|
-
assert times == Times(0)
|
54
|
-
assert times != Times(-1)
|
55
|
-
assert times != 'invalid'
|
56
|
-
|
57
|
-
assert times > Times(-1)
|
58
|
-
assert times >= Times(0)
|
59
|
-
assert times < Times(1)
|
60
|
-
assert times <= Times(0)
|
61
|
-
|
62
|
-
|
63
|
-
assert times.source.year == 1970
|
64
|
-
|
65
|
-
assert times.epoch == 0.0
|
66
|
-
|
67
|
-
assert times.spoch == 0
|
68
|
-
|
69
|
-
assert times.mpoch == 0.0
|
70
|
-
|
71
|
-
assert str(times.time) == '00:00:00'
|
72
|
-
|
73
|
-
assert times.simple == UNIXEPOCH
|
74
|
-
|
75
|
-
assert times.subsec == UNIXMPOCH
|
76
|
-
|
77
|
-
assert times.human == UNIXHPOCH
|
78
|
-
|
79
|
-
assert times.elapsed >= 1672531200
|
80
|
-
|
81
|
-
assert times.since >= 1672531200
|
82
|
-
|
83
|
-
assert times.before == (
|
84
|
-
'1969-12-31T23:59:59.999999Z')
|
85
|
-
|
86
|
-
assert times.after == (
|
87
|
-
'1970-01-01T00:00:00.000001Z')
|
88
|
-
|
89
|
-
assert times.stamp() == UNIXMPOCH
|
90
|
-
|
91
|
-
times = times.shift('+1y')
|
92
|
-
assert times == '1971-01-01'
|
93
|
-
|
94
|
-
times = times.shifz('UTC-1')
|
95
|
-
assert times == (
|
96
|
-
'12/31/1970 23:00 -0100')
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
def test_Times_tzname() -> None:
|
101
|
-
"""
|
102
|
-
Perform various tests associated with relevant routines.
|
103
|
-
"""
|
104
|
-
|
105
|
-
times1 = Times(
|
106
|
-
'1970-01-01T00:00:00Z')
|
107
|
-
|
108
|
-
times2 = times1.shifz(
|
109
|
-
'US/Central')
|
110
|
-
|
111
|
-
|
112
|
-
delta = times1 - times2
|
113
|
-
|
114
|
-
assert -1 < delta < 1
|
115
|
-
|
116
|
-
|
117
|
-
stamp1 = times1.stamp(
|
118
|
-
tzname='US/Central')
|
119
|
-
|
120
|
-
stamp2 = times2.stamp()
|
121
|
-
|
122
|
-
assert stamp1 == stamp2
|
encommon-0.14.0.dist-info/RECORD
DELETED
@@ -1,84 +0,0 @@
|
|
1
|
-
encommon/__init__.py,sha256=YDGzuhpk5Gd1hq54LI0hw1NrrDvrJDrvH20TEy_0l5E,443
|
2
|
-
encommon/conftest.py,sha256=pDU0t5M2fMKPFZsbxJ1ty_dxW_BoiyEC7VoNSqNBVHc,1899
|
3
|
-
encommon/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
-
encommon/version.txt,sha256=BlWCZVqs1vyD_3QqVxXAS7Slc5W_PuRVl5j6QsLORYk,7
|
5
|
-
encommon/colors/__init__.py,sha256=-MSjC_KbgVUKWbC4ZxyvtgnLB1t7WNJ7nwtJyp0A96E,272
|
6
|
-
encommon/colors/colors.py,sha256=DNWiJd7Kz4_cHTQcHstqQ8UWmFJV32ngpc06hi4KGFc,10908
|
7
|
-
encommon/colors/test/__init__.py,sha256=PjrnBYT0efyvbaGeNx94dm3tP3EVHUHSVs-VGeLEv5g,218
|
8
|
-
encommon/colors/test/test_colors.py,sha256=ul4XqbKn59QnBC838bvZbxjxRyjnJIC_k6BQXhlLIFQ,4583
|
9
|
-
encommon/config/__init__.py,sha256=iZdbW7A4m7iN4xt5cEeQqo0Klqs-CaPLdD5ocLmUYi8,856
|
10
|
-
encommon/config/config.py,sha256=g1nRf7517sNVoKDretxAxovVjCmIsv-6ngzdqe8QfZg,6996
|
11
|
-
encommon/config/files.py,sha256=g_4TWOKgXOM8XOHwWqkvhkKQG6Lwz3WpfgTD1pR3gTA,2451
|
12
|
-
encommon/config/logger.py,sha256=4pDjni1x_ZwIVnw5kb5fTunqompHfYb5KlxIoXq6YF0,14339
|
13
|
-
encommon/config/params.py,sha256=ME76McTnm5P-Rt80mrCzuvfQDk2zMwbuNTnzorh6-Kc,2190
|
14
|
-
encommon/config/paths.py,sha256=FG7ju_ZeqW-JXmeWm2p5poA_GZ2UJmH9EBYUZtxPtK4,2599
|
15
|
-
encommon/config/utils.py,sha256=9_3y5DIPLVKjA1fSVs_uDMOA45pidrPMDOU2j23QqqY,2123
|
16
|
-
encommon/config/test/__init__.py,sha256=i0JAeRcM-0YH2StGfwpaDbZV9dVribNSgFDcYcPPay8,313
|
17
|
-
encommon/config/test/test_config.py,sha256=WwNZLHBnHDH7eXYWH-vpOWVBJveEjs9YlN1rkiNb884,2583
|
18
|
-
encommon/config/test/test_files.py,sha256=qJgavSxTxilHOnGzfF6fBpViOmKFGcBdupOIRhDsXuk,2295
|
19
|
-
encommon/config/test/test_logger.py,sha256=CuCQPpvdl71IeKYw-foEdIVGPoqlw7RsMxJFqviERzU,5336
|
20
|
-
encommon/config/test/test_paths.py,sha256=UR1xqyXztEJsD5Npk0tLxSOo9uvVi_OKelvvNHAtP88,2645
|
21
|
-
encommon/config/test/test_utils.py,sha256=RePpMD97HRCTkZ75ES8Eaf6_BOpcw_DknpgCFZGlQYg,1066
|
22
|
-
encommon/crypts/__init__.py,sha256=UsGEitz8rWa7DQF3iAxEbTUAbdiEnE87LSuRs4OBeAQ,371
|
23
|
-
encommon/crypts/crypts.py,sha256=fD6dXqRZ_-mHv2CX3vDBAh-Fdhm6d09uA4SEUwSdqnk,4640
|
24
|
-
encommon/crypts/hashes.py,sha256=bpQf2-Ma5SdMaEWP2nL1_9rtEQmTE0XTdDvSD-fQ9Mk,3075
|
25
|
-
encommon/crypts/params.py,sha256=I0dPPnaPgNDoc0Mk4tg7x5vvxu2pd2wPeR1Xy9l6SxA,1141
|
26
|
-
encommon/crypts/test/__init__.py,sha256=PjrnBYT0efyvbaGeNx94dm3tP3EVHUHSVs-VGeLEv5g,218
|
27
|
-
encommon/crypts/test/test_crypts.py,sha256=gFkCA4-M2DLudP9nBpgU6sSchyWU1gtbvCWe6T0wg5I,3469
|
28
|
-
encommon/crypts/test/test_hashes.py,sha256=JYpPit7ISv6u-5-HbC3wSCxuieySDLKawgnE7-xHgTY,1180
|
29
|
-
encommon/times/__init__.py,sha256=Auhz4YLcPP1O8EWuMHybup0YfZousJhEjOJ8U4p0zTI,975
|
30
|
-
encommon/times/common.py,sha256=dnhONUgklXXhG7hVlOmGnwRNvkOOAAJkXXDYT60p08Y,998
|
31
|
-
encommon/times/duration.py,sha256=LTROiKcRXvPcs2Gz9KaB5Cmxo9NXd3TcMo5-jnTxPo0,10794
|
32
|
-
encommon/times/params.py,sha256=9brYdUgJRiB4H_KFvMsy8PWdSkJr6R1NwtDApVTSl9Q,3888
|
33
|
-
encommon/times/parse.py,sha256=BAIIHRAaiCAFKjpLdzHQVH-OckPnOvnX8VzBrM6NJzE,6510
|
34
|
-
encommon/times/timer.py,sha256=19dt7A5nJEUdr_0p3WDFGO-Q49OHt3sgPW4R2zHoScU,2901
|
35
|
-
encommon/times/timers.py,sha256=X3Aeutsp-GIEqYOxO0cXmNhTehHvT_aMgWogXI3T87Q,9343
|
36
|
-
encommon/times/times.py,sha256=7JgN5J1U0kqi5QayIj-CEEMkHHKo09H4K1t-RjU29Xc,10849
|
37
|
-
encommon/times/unitime.py,sha256=3CsFZMKN4NBYl3-4r_THkR8l4FtrJLO9rk1xXSzhha8,1050
|
38
|
-
encommon/times/utils.py,sha256=PJ5QsKb3_pYEnD3Sz81d8QDhYQtTIj4HJfMoC9gNwmo,3100
|
39
|
-
encommon/times/window.py,sha256=3ctrDd0UWvnwrqxRZf7M-mVeEYVWvet6GZTj17YQ9sU,8526
|
40
|
-
encommon/times/windows.py,sha256=YJd1Tq97Eo2jUjIBvvhg-828A6BxecuHKSXhqIe9bSs,10838
|
41
|
-
encommon/times/test/__init__.py,sha256=PjrnBYT0efyvbaGeNx94dm3tP3EVHUHSVs-VGeLEv5g,218
|
42
|
-
encommon/times/test/test_duration.py,sha256=ofCBdQ4-tOKP5W5U2xyTaZrCVvD-dWEgnYoCvZ99MuA,4189
|
43
|
-
encommon/times/test/test_params.py,sha256=kHvs-WvKfPQCdCDnPU9tAyMVXmzH3eUjwQN-QdWBeh4,1407
|
44
|
-
encommon/times/test/test_parse.py,sha256=3Dihhu8xKmgbcq_dqKcO-itAeGtqAJxjGFQ6dPsJ4XM,4210
|
45
|
-
encommon/times/test/test_timer.py,sha256=A5pBmkd1i71LTpG-uA9-9UGNJUK8tkw6by8Adm0AbGE,1400
|
46
|
-
encommon/times/test/test_timers.py,sha256=Kj5AgzNTCNb2vEep2zpTED6JpJ_1S5j-Kt1Bm17zkdg,3761
|
47
|
-
encommon/times/test/test_times.py,sha256=pncNOJ1Cg6XjFBR8Zc9BT300iNEHfHBRcKzvLrLzbhA,2272
|
48
|
-
encommon/times/test/test_unitime.py,sha256=5i4UjBCw8R9h-Lw963GfB_dHBMEQhjvv1k-t27Wyyls,510
|
49
|
-
encommon/times/test/test_utils.py,sha256=WkzHJY6zOt02Ujg5FItOo1nPtktz5ss8ODmG1tRQaaw,2056
|
50
|
-
encommon/times/test/test_window.py,sha256=Sx_fd0J1ofaFx52t-uWz9Isa9KqBxPFnynzfGfiG7uo,6098
|
51
|
-
encommon/times/test/test_windows.py,sha256=YJJ3-vN4bs2cGCUcGyo8-w4mQlt7fxuek17xCpvZRE8,4484
|
52
|
-
encommon/types/__init__.py,sha256=_DVoVFJWd-9aCpXtPEaB3CnZ-5gt-uYxMWzquXfXHpg,1047
|
53
|
-
encommon/types/classes.py,sha256=FsMA1mAhbtB4oL_qUnEidBOaC7y0mMx49HkASzYnEM8,1914
|
54
|
-
encommon/types/dicts.py,sha256=lC2FmPzMEj9L73jUjf3o6OVQ-LqK_3gp5nBwYibdGfo,2265
|
55
|
-
encommon/types/empty.py,sha256=n5y5maXkcM3xNYNYGK6iqvk98ivQSeguaedwc0HoMv4,2739
|
56
|
-
encommon/types/lists.py,sha256=iKtfAU2foRvXokVO_KHHSvQ8wg7FraVRsG108sF4Yhk,654
|
57
|
-
encommon/types/notate.py,sha256=jRZ34u_7hvBw58nlXTSxxm21f9-zVr8g9YLfw9qfC0E,6428
|
58
|
-
encommon/types/strings.py,sha256=Uq3hEabr6z5Ez35jussJkJT0VrleW6fM4IBPXn4x-0o,2729
|
59
|
-
encommon/types/types.py,sha256=DbzdDLLclD1Gk8bmyhDUUWVDnJ5LdaolLV3JYKHFVgA,322
|
60
|
-
encommon/types/test/__init__.py,sha256=UIyNazTlIIdUzQS0brlD7hCPN_LYw_J6Ucxm8wh3cPU,789
|
61
|
-
encommon/types/test/test_classes.py,sha256=t4A2KXG3PP6zMH01t8R3fuvvJOAx_G67kZ3Jm8NYw00,1483
|
62
|
-
encommon/types/test/test_dicts.py,sha256=-RLkcyexCXGSyJyPx1e3QU8sNXEgtSvD9pZakdOwVvg,2702
|
63
|
-
encommon/types/test/test_empty.py,sha256=4GiBs3xulfTnJ5xuGm2hM_PRcHspYEj5tAaLd4Trhyc,973
|
64
|
-
encommon/types/test/test_lists.py,sha256=RXvIQvr1nODutPBRx5hMsPRq_10AzBWF594KINoMgU8,437
|
65
|
-
encommon/types/test/test_notate.py,sha256=NfrDmMD6hOoVi9wlQ8yLZNnuHwS6Z7bLze70FkxOjSA,4008
|
66
|
-
encommon/types/test/test_strings.py,sha256=oXusioFMdknHeBdwlP_GakDVS9Tf2YBndjonj22UfmM,1277
|
67
|
-
encommon/utils/__init__.py,sha256=bBgh81wX_TwLgWkx0aBAyVLHNphrfcyQc1AF7-ziyNI,1027
|
68
|
-
encommon/utils/common.py,sha256=-bjGJ2UJa-WTOsVYiuZcVj1gkyH5OlRdRkJtxPw8J6k,555
|
69
|
-
encommon/utils/files.py,sha256=2uj10JfvKZHdLHNF992_LUvQ4rfMRCZGqJd7LrxKDnE,1458
|
70
|
-
encommon/utils/match.py,sha256=XvmmMKQ1q8_21zzPGuVvaZf6XwHXPZn4IWIYBEqVCQM,2471
|
71
|
-
encommon/utils/paths.py,sha256=u8-vTONG3QdnpkKfVpl19WssH95bCHg1gHlnRwzyAFM,3509
|
72
|
-
encommon/utils/sample.py,sha256=4-7qFH9kI3XDCZrMJVBamJr1_B60oedyeDmxEc9RoQM,4828
|
73
|
-
encommon/utils/stdout.py,sha256=4zpp2KUAgNb70jNXMX-QD0x1Sdl5s-np61yG3SIL49c,8577
|
74
|
-
encommon/utils/test/__init__.py,sha256=PjrnBYT0efyvbaGeNx94dm3tP3EVHUHSVs-VGeLEv5g,218
|
75
|
-
encommon/utils/test/test_files.py,sha256=-hdl4UOo-vH1H5gTL1r9Ib3P26DtWaD2YV32P08ykvc,679
|
76
|
-
encommon/utils/test/test_match.py,sha256=QagKpTFdRo23-Y55fSaJrSMpt5jIebScKbz0h8tivrI,1124
|
77
|
-
encommon/utils/test/test_paths.py,sha256=1yiZp5PCxljGk0J6fwIfWOUl-KWz40INybrwrN3JIog,1945
|
78
|
-
encommon/utils/test/test_sample.py,sha256=IOPz2YcJslJDEBAW2_Zjc78MI3kX0tbobAK99Fbxctg,3539
|
79
|
-
encommon/utils/test/test_stdout.py,sha256=2U9hwLvDD9tNTciSsZXw6wibodej4EqDLGjxlavIWJ0,6143
|
80
|
-
encommon-0.14.0.dist-info/LICENSE,sha256=otnXKCtMjPlbHs0wgZ_BWULrp3g_2dWQJ6icRk9nkgg,1071
|
81
|
-
encommon-0.14.0.dist-info/METADATA,sha256=whIGwRqrnB5NSQnjEEICKkDt5oJ4kbMKcBZ1yOXkVKE,3362
|
82
|
-
encommon-0.14.0.dist-info/WHEEL,sha256=nCVcAvsfA9TDtwGwhYaRrlPhTLV9m-Ga6mdyDtuwK18,91
|
83
|
-
encommon-0.14.0.dist-info/top_level.txt,sha256=bP8q7-5tLDNm-3XPlqn_bDENfYNug5801H_xfz3BEAM,9
|
84
|
-
encommon-0.14.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|