encommon 0.7.2__tar.gz → 0.7.3__tar.gz
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-0.7.2/encommon.egg-info → encommon-0.7.3}/PKG-INFO +1 -1
- {encommon-0.7.2 → encommon-0.7.3}/encommon/config/config.py +12 -16
- {encommon-0.7.2 → encommon-0.7.3}/encommon/config/logger.py +31 -20
- {encommon-0.7.2 → encommon-0.7.3}/encommon/config/params.py +2 -2
- {encommon-0.7.2 → encommon-0.7.3}/encommon/config/test/test_config.py +10 -2
- {encommon-0.7.2 → encommon-0.7.3}/encommon/config/test/test_files.py +4 -1
- {encommon-0.7.2 → encommon-0.7.3}/encommon/config/test/test_paths.py +4 -1
- {encommon-0.7.2 → encommon-0.7.3}/encommon/crypts/crypts.py +15 -3
- {encommon-0.7.2 → encommon-0.7.3}/encommon/crypts/hashes.py +14 -14
- {encommon-0.7.2 → encommon-0.7.3}/encommon/times/duration.py +6 -6
- {encommon-0.7.2 → encommon-0.7.3}/encommon/times/parse.py +1 -1
- {encommon-0.7.2 → encommon-0.7.3}/encommon/times/timers.py +11 -10
- {encommon-0.7.2 → encommon-0.7.3}/encommon/times/times.py +4 -4
- {encommon-0.7.2 → encommon-0.7.3}/encommon/times/window.py +16 -16
- encommon-0.7.3/encommon/version.txt +1 -0
- {encommon-0.7.2 → encommon-0.7.3/encommon.egg-info}/PKG-INFO +1 -1
- encommon-0.7.2/encommon/version.txt +0 -1
- {encommon-0.7.2 → encommon-0.7.3}/LICENSE +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/MANIFEST.in +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/README.md +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/__init__.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/config/__init__.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/config/common.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/config/files.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/config/paths.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/config/test/__init__.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/config/test/test_common.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/config/test/test_logger.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/conftest.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/crypts/__init__.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/crypts/params.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/crypts/test/__init__.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/crypts/test/test_crypts.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/crypts/test/test_hashes.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/py.typed +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/times/__init__.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/times/common.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/times/test/__init__.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/times/test/test_common.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/times/test/test_duration.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/times/test/test_parse.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/times/test/test_timers.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/times/test/test_times.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/times/test/test_window.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/types/__init__.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/types/dicts.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/types/empty.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/types/strings.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/types/test/__init__.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/types/test/test_dicts.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/types/test/test_empty.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/types/test/test_strings.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/utils/__init__.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/utils/common.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/utils/match.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/utils/paths.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/utils/sample.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/utils/stdout.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/utils/test/__init__.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/utils/test/test_match.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/utils/test/test_paths.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/utils/test/test_sample.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon/utils/test/test_stdout.py +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon.egg-info/SOURCES.txt +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon.egg-info/dependency_links.txt +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon.egg-info/requires.txt +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/encommon.egg-info/top_level.txt +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/pyproject.toml +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/reqs-install.txt +0 -0
- {encommon-0.7.2 → encommon-0.7.3}/setup.cfg +0 -0
@@ -90,9 +90,9 @@ class Config:
|
|
90
90
|
self,
|
91
91
|
) -> ConfigFiles:
|
92
92
|
"""
|
93
|
-
Return the
|
93
|
+
Return the value for the attribute from class instance.
|
94
94
|
|
95
|
-
:returns:
|
95
|
+
:returns: Value for the attribute from class instance.
|
96
96
|
"""
|
97
97
|
|
98
98
|
return self.__files
|
@@ -103,9 +103,9 @@ class Config:
|
|
103
103
|
self,
|
104
104
|
) -> ConfigPaths:
|
105
105
|
"""
|
106
|
-
Return the
|
106
|
+
Return the value for the attribute from class instance.
|
107
107
|
|
108
|
-
:returns:
|
108
|
+
:returns: Value for the attribute from class instance.
|
109
109
|
"""
|
110
110
|
|
111
111
|
return self.__paths
|
@@ -116,9 +116,9 @@ class Config:
|
|
116
116
|
self,
|
117
117
|
) -> dict[str, Any]:
|
118
118
|
"""
|
119
|
-
Return the
|
119
|
+
Return the value for the attribute from class instance.
|
120
120
|
|
121
|
-
:returns:
|
121
|
+
:returns: Value for the attribute from class instance.
|
122
122
|
"""
|
123
123
|
|
124
124
|
return self.__cargs
|
@@ -142,9 +142,9 @@ class Config:
|
|
142
142
|
self,
|
143
143
|
) -> Callable: # type: ignore
|
144
144
|
"""
|
145
|
-
Return the
|
145
|
+
Return the value for the attribute from class instance.
|
146
146
|
|
147
|
-
:returns:
|
147
|
+
:returns: Value for the attribute from class instance.
|
148
148
|
"""
|
149
149
|
|
150
150
|
return self.__model
|
@@ -191,10 +191,8 @@ class Config:
|
|
191
191
|
enlogger = (
|
192
192
|
self.params.enlogger)
|
193
193
|
|
194
|
-
|
195
|
-
|
196
|
-
self.__logger = Logger(
|
197
|
-
**enlogger.model_dump())
|
194
|
+
self.__logger = (
|
195
|
+
Logger(params=enlogger))
|
198
196
|
|
199
197
|
return self.__logger
|
200
198
|
|
@@ -213,9 +211,7 @@ class Config:
|
|
213
211
|
encrypts = (
|
214
212
|
self.params.encrypts)
|
215
213
|
|
216
|
-
|
217
|
-
|
218
|
-
self.__crypts = Crypts(
|
219
|
-
**encrypts.model_dump())
|
214
|
+
self.__crypts = (
|
215
|
+
Crypts(params=encrypts))
|
220
216
|
|
221
217
|
return self.__crypts
|
@@ -24,6 +24,7 @@ from pathlib import Path
|
|
24
24
|
from typing import Any
|
25
25
|
from typing import Literal
|
26
26
|
from typing import Optional
|
27
|
+
from typing import TYPE_CHECKING
|
27
28
|
|
28
29
|
from .common import LOGLEVELS
|
29
30
|
from .common import config_path
|
@@ -32,6 +33,9 @@ from ..times.times import Times
|
|
32
33
|
from ..types.empty import Empty
|
33
34
|
from ..utils.stdout import kvpair_ansi
|
34
35
|
|
36
|
+
if TYPE_CHECKING:
|
37
|
+
from .params import LoggerParams
|
38
|
+
|
35
39
|
|
36
40
|
|
37
41
|
LOGGER_FILE = 'encommon.logger.file'
|
@@ -143,9 +147,9 @@ class Message:
|
|
143
147
|
self,
|
144
148
|
) -> LOGLEVELS:
|
145
149
|
"""
|
146
|
-
Return the
|
150
|
+
Return the value for the attribute from class instance.
|
147
151
|
|
148
|
-
:returns:
|
152
|
+
:returns: Value for the attribute from class instance.
|
149
153
|
"""
|
150
154
|
|
151
155
|
return self.__level
|
@@ -156,9 +160,9 @@ class Message:
|
|
156
160
|
self,
|
157
161
|
) -> Times:
|
158
162
|
"""
|
159
|
-
Return the
|
163
|
+
Return the value for the attribute from class instance.
|
160
164
|
|
161
|
-
:returns:
|
165
|
+
:returns: Value for the attribute from class instance.
|
162
166
|
"""
|
163
167
|
|
164
168
|
return Times(self.__time)
|
@@ -169,9 +173,9 @@ class Message:
|
|
169
173
|
self,
|
170
174
|
) -> dict[str, str]:
|
171
175
|
"""
|
172
|
-
Return the
|
176
|
+
Return the value for the attribute from class instance.
|
173
177
|
|
174
|
-
:returns:
|
178
|
+
:returns: Value for the attribute from class instance.
|
175
179
|
"""
|
176
180
|
|
177
181
|
return dict(self.__fields)
|
@@ -283,9 +287,10 @@ class Logger:
|
|
283
287
|
>>> logger.start()
|
284
288
|
>>> logger.log_i(message='testing')
|
285
289
|
|
286
|
-
:param stdo_level: Minimum
|
287
|
-
:param file_level: Minimum
|
290
|
+
:param stdo_level: Minimum level for the message to pass.
|
291
|
+
:param file_level: Minimum level for the message to pass.
|
288
292
|
:param file_path: Enables writing to the filesystem path.
|
293
|
+
:param params: Parameters for instantiating the instance.
|
289
294
|
"""
|
290
295
|
|
291
296
|
__stdo_level: Optional[LOGLEVELS]
|
@@ -304,11 +309,17 @@ class Logger:
|
|
304
309
|
stdo_level: Optional[LOGLEVELS] = None,
|
305
310
|
file_level: Optional[LOGLEVELS] = None,
|
306
311
|
file_path: Optional[str | Path] = None,
|
312
|
+
params: Optional['LoggerParams'] = None,
|
307
313
|
) -> None:
|
308
314
|
"""
|
309
315
|
Initialize instance for class using provided parameters.
|
310
316
|
"""
|
311
317
|
|
318
|
+
if params is not None:
|
319
|
+
stdo_level = params.stdo_level
|
320
|
+
file_level = params.file_level
|
321
|
+
file_path = params.file_path
|
322
|
+
|
312
323
|
if file_path is not None:
|
313
324
|
file_path = config_path(file_path)
|
314
325
|
|
@@ -327,9 +338,9 @@ class Logger:
|
|
327
338
|
self,
|
328
339
|
) -> Optional[LOGLEVELS]:
|
329
340
|
"""
|
330
|
-
Return the
|
341
|
+
Return the value for the attribute from class instance.
|
331
342
|
|
332
|
-
:returns:
|
343
|
+
:returns: Value for the attribute from class instance.
|
333
344
|
"""
|
334
345
|
|
335
346
|
return self.__stdo_level
|
@@ -340,9 +351,9 @@ class Logger:
|
|
340
351
|
self,
|
341
352
|
) -> Optional[LOGLEVELS]:
|
342
353
|
"""
|
343
|
-
Return the
|
354
|
+
Return the value for the attribute from class instance.
|
344
355
|
|
345
|
-
:returns:
|
356
|
+
:returns: Value for the attribute from class instance.
|
346
357
|
"""
|
347
358
|
|
348
359
|
return self.__file_level
|
@@ -353,9 +364,9 @@ class Logger:
|
|
353
364
|
self,
|
354
365
|
) -> Optional[Path]:
|
355
366
|
"""
|
356
|
-
Return the
|
367
|
+
Return the value for the attribute from class instance.
|
357
368
|
|
358
|
-
:returns:
|
369
|
+
:returns: Value for the attribute from class instance.
|
359
370
|
"""
|
360
371
|
|
361
372
|
return self.__file_path
|
@@ -366,9 +377,9 @@ class Logger:
|
|
366
377
|
self,
|
367
378
|
) -> bool:
|
368
379
|
"""
|
369
|
-
Return the
|
380
|
+
Return the value for the attribute from class instance.
|
370
381
|
|
371
|
-
:returns:
|
382
|
+
:returns: Value for the attribute from class instance.
|
372
383
|
"""
|
373
384
|
|
374
385
|
return self.__started
|
@@ -379,9 +390,9 @@ class Logger:
|
|
379
390
|
self,
|
380
391
|
) -> _Logger:
|
381
392
|
"""
|
382
|
-
Return the
|
393
|
+
Return the value for the attribute from class instance.
|
383
394
|
|
384
|
-
:returns:
|
395
|
+
:returns: Value for the attribute from class instance.
|
385
396
|
"""
|
386
397
|
|
387
398
|
return self.__logger_stdo
|
@@ -392,9 +403,9 @@ class Logger:
|
|
392
403
|
self,
|
393
404
|
) -> _Logger:
|
394
405
|
"""
|
395
|
-
Return the
|
406
|
+
Return the value for the attribute from class instance.
|
396
407
|
|
397
|
-
:returns:
|
408
|
+
:returns: Value for the attribute from class instance.
|
398
409
|
"""
|
399
410
|
|
400
411
|
return self.__logger_file
|
@@ -33,8 +33,8 @@ class LoggerParams(BaseModel, extra='forbid'):
|
|
33
33
|
"""
|
34
34
|
Process and validate the common configuration parameters.
|
35
35
|
|
36
|
-
:param stdo_level: Minimum
|
37
|
-
:param file_level: Minimum
|
36
|
+
:param stdo_level: Minimum level for the message to pass.
|
37
|
+
:param file_level: Minimum level for the message to pass.
|
38
38
|
:param file_path: Enables writing to the filesystem path.
|
39
39
|
:param data: Keyword arguments passed to Pydantic model.
|
40
40
|
Parameter is picked up by autodoc, please ignore.
|
@@ -88,8 +88,12 @@ def test_Config( # noqa: CFQ001
|
|
88
88
|
|
89
89
|
assert _config1 is not _config2
|
90
90
|
|
91
|
+
|
92
|
+
sample_path = Path(
|
93
|
+
f'{SAMPLES}/config.json')
|
94
|
+
|
91
95
|
sample = load_sample(
|
92
|
-
path=
|
96
|
+
path=sample_path,
|
93
97
|
update=ENPYRWS,
|
94
98
|
content=_config1,
|
95
99
|
replace={
|
@@ -108,8 +112,12 @@ def test_Config( # noqa: CFQ001
|
|
108
112
|
|
109
113
|
assert _params1 is _params2
|
110
114
|
|
115
|
+
|
116
|
+
sample_path = Path(
|
117
|
+
f'{SAMPLES}/params.json')
|
118
|
+
|
111
119
|
sample = load_sample(
|
112
|
-
path=
|
120
|
+
path=sample_path,
|
113
121
|
update=ENPYRWS,
|
114
122
|
content=_params1.model_dump(),
|
115
123
|
replace={
|
@@ -87,8 +87,11 @@ def test_ConfigFiles(
|
|
87
87
|
|
88
88
|
assert _merged1 is not _merged2
|
89
89
|
|
90
|
+
sample_path = Path(
|
91
|
+
f'{SAMPLES}/files.json')
|
92
|
+
|
90
93
|
sample = load_sample(
|
91
|
-
path=
|
94
|
+
path=sample_path,
|
92
95
|
update=ENPYRWS,
|
93
96
|
content=_merged1,
|
94
97
|
replace={
|
@@ -80,8 +80,11 @@ def test_ConfigPaths(
|
|
80
80
|
|
81
81
|
assert _merged1 is not _merged2
|
82
82
|
|
83
|
+
sample_path = Path(
|
84
|
+
f'{SAMPLES}/paths.json')
|
85
|
+
|
83
86
|
sample = load_sample(
|
84
|
-
path=
|
87
|
+
path=sample_path,
|
85
88
|
update=ENPYRWS,
|
86
89
|
content=_merged1,
|
87
90
|
replace={
|
@@ -10,9 +10,14 @@ is permitted, for more information consult the project license file.
|
|
10
10
|
from re import compile
|
11
11
|
from re import match as re_match
|
12
12
|
from re import sub as re_sub
|
13
|
+
from typing import Optional
|
14
|
+
from typing import TYPE_CHECKING
|
13
15
|
|
14
16
|
from cryptography.fernet import Fernet
|
15
17
|
|
18
|
+
if TYPE_CHECKING:
|
19
|
+
from .params import CryptsParams
|
20
|
+
|
16
21
|
|
17
22
|
|
18
23
|
ENCRYPT = compile(
|
@@ -33,6 +38,7 @@ class Crypts:
|
|
33
38
|
'example'
|
34
39
|
|
35
40
|
:param phrases: Passphrases that are used in operations.
|
41
|
+
:param params: Parameters for instantiating the instance.
|
36
42
|
"""
|
37
43
|
|
38
44
|
__phrases: dict[str, str]
|
@@ -40,12 +46,18 @@ class Crypts:
|
|
40
46
|
|
41
47
|
def __init__(
|
42
48
|
self,
|
43
|
-
phrases: dict[str, str],
|
49
|
+
phrases: Optional[dict[str, str]] = None,
|
50
|
+
params: Optional['CryptsParams'] = None,
|
44
51
|
) -> None:
|
45
52
|
"""
|
46
53
|
Initialize instance for class using provided parameters.
|
47
54
|
"""
|
48
55
|
|
56
|
+
phrases = phrases or {}
|
57
|
+
|
58
|
+
if params is not None:
|
59
|
+
phrases |= params.phrases
|
60
|
+
|
49
61
|
if 'default' not in phrases:
|
50
62
|
raise ValueError('default')
|
51
63
|
|
@@ -57,9 +69,9 @@ class Crypts:
|
|
57
69
|
self,
|
58
70
|
) -> dict[str, str]:
|
59
71
|
"""
|
60
|
-
Return the
|
72
|
+
Return the value for the attribute from class instance.
|
61
73
|
|
62
|
-
:returns:
|
74
|
+
:returns: Value for the attribute from class instance.
|
63
75
|
"""
|
64
76
|
|
65
77
|
return dict(self.__phrases)
|
@@ -55,9 +55,9 @@ class Hashes:
|
|
55
55
|
self,
|
56
56
|
) -> str:
|
57
57
|
"""
|
58
|
-
Return the
|
58
|
+
Return the value for the attribute from class instance.
|
59
59
|
|
60
|
-
:returns:
|
60
|
+
:returns: Value for the attribute from class instance.
|
61
61
|
"""
|
62
62
|
|
63
63
|
return self.__string
|
@@ -68,9 +68,9 @@ class Hashes:
|
|
68
68
|
self,
|
69
69
|
) -> str:
|
70
70
|
"""
|
71
|
-
Return the
|
71
|
+
Return the value for the attribute from class instance.
|
72
72
|
|
73
|
-
:returns:
|
73
|
+
:returns: Value for the attribute from class instance.
|
74
74
|
"""
|
75
75
|
|
76
76
|
encode = self.__string.encode()
|
@@ -83,9 +83,9 @@ class Hashes:
|
|
83
83
|
self,
|
84
84
|
) -> str:
|
85
85
|
"""
|
86
|
-
Return the
|
86
|
+
Return the value for the attribute from class instance.
|
87
87
|
|
88
|
-
:returns:
|
88
|
+
:returns: Value for the attribute from class instance.
|
89
89
|
"""
|
90
90
|
|
91
91
|
string = self.__string.encode()
|
@@ -98,9 +98,9 @@ class Hashes:
|
|
98
98
|
self,
|
99
99
|
) -> str:
|
100
100
|
"""
|
101
|
-
Return the
|
101
|
+
Return the value for the attribute from class instance.
|
102
102
|
|
103
|
-
:returns:
|
103
|
+
:returns: Value for the attribute from class instance.
|
104
104
|
"""
|
105
105
|
|
106
106
|
string = self.__string.encode()
|
@@ -113,9 +113,9 @@ class Hashes:
|
|
113
113
|
self,
|
114
114
|
) -> str:
|
115
115
|
"""
|
116
|
-
Return the
|
116
|
+
Return the value for the attribute from class instance.
|
117
117
|
|
118
|
-
:returns:
|
118
|
+
:returns: Value for the attribute from class instance.
|
119
119
|
"""
|
120
120
|
|
121
121
|
string = self.__string.encode()
|
@@ -128,9 +128,9 @@ class Hashes:
|
|
128
128
|
self,
|
129
129
|
) -> str:
|
130
130
|
"""
|
131
|
-
Return the
|
131
|
+
Return the value for the attribute from class instance.
|
132
132
|
|
133
|
-
:returns:
|
133
|
+
:returns: Value for the attribute from class instance.
|
134
134
|
"""
|
135
135
|
|
136
136
|
string = self.__string
|
@@ -144,9 +144,9 @@ class Hashes:
|
|
144
144
|
self,
|
145
145
|
) -> str:
|
146
146
|
"""
|
147
|
-
Return the
|
147
|
+
Return the value for the attribute from class instance.
|
148
148
|
|
149
|
-
:returns:
|
149
|
+
:returns: Value for the attribute from class instance.
|
150
150
|
"""
|
151
151
|
|
152
152
|
string = self.__string.encode()
|
@@ -278,9 +278,9 @@ class Duration:
|
|
278
278
|
self,
|
279
279
|
) -> float:
|
280
280
|
"""
|
281
|
-
Return the
|
281
|
+
Return the value for the attribute from class instance.
|
282
282
|
|
283
|
-
:returns:
|
283
|
+
:returns: Value for the attribute from class instance.
|
284
284
|
"""
|
285
285
|
|
286
286
|
return self.__source
|
@@ -291,9 +291,9 @@ class Duration:
|
|
291
291
|
self,
|
292
292
|
) -> bool:
|
293
293
|
"""
|
294
|
-
Return the
|
294
|
+
Return the value for the attribute from class instance.
|
295
295
|
|
296
|
-
:returns:
|
296
|
+
:returns: Value for the attribute from class instance.
|
297
297
|
"""
|
298
298
|
|
299
299
|
return self.__smart
|
@@ -304,9 +304,9 @@ class Duration:
|
|
304
304
|
self,
|
305
305
|
) -> int:
|
306
306
|
"""
|
307
|
-
Return the
|
307
|
+
Return the value for the attribute from class instance.
|
308
308
|
|
309
|
-
:returns:
|
309
|
+
:returns: Value for the attribute from class instance.
|
310
310
|
"""
|
311
311
|
|
312
312
|
return self.__groups
|
@@ -73,7 +73,7 @@ def parse_time( # noqa: CFQ004
|
|
73
73
|
|
74
74
|
:param source: Time in various forms that will be parsed.
|
75
75
|
:param anchor: Optional relative time; for snap notation.
|
76
|
-
:param format: Optional format
|
76
|
+
:param format: Optional format when source is timestamp.
|
77
77
|
:param tzname: Name of the timezone associated to source.
|
78
78
|
This is not relevant in timezone included in source.
|
79
79
|
:returns: Python datetime object containing related time.
|
@@ -19,6 +19,7 @@ if TYPE_CHECKING:
|
|
19
19
|
from sqlite3 import Connection
|
20
20
|
|
21
21
|
|
22
|
+
|
22
23
|
TABLE = (
|
23
24
|
"""
|
24
25
|
create table
|
@@ -159,9 +160,9 @@ class Timers:
|
|
159
160
|
self,
|
160
161
|
) -> dict[str, float]:
|
161
162
|
"""
|
162
|
-
Return the
|
163
|
+
Return the value for the attribute from class instance.
|
163
164
|
|
164
|
-
:returns:
|
165
|
+
:returns: Value for the attribute from class instance.
|
165
166
|
"""
|
166
167
|
|
167
168
|
return dict(self.__timers)
|
@@ -172,9 +173,9 @@ class Timers:
|
|
172
173
|
self,
|
173
174
|
) -> 'Connection':
|
174
175
|
"""
|
175
|
-
Return the
|
176
|
+
Return the value for the attribute from class instance.
|
176
177
|
|
177
|
-
:returns:
|
178
|
+
:returns: Value for the attribute from class instance.
|
178
179
|
"""
|
179
180
|
|
180
181
|
return self.__cache_file
|
@@ -185,9 +186,9 @@ class Timers:
|
|
185
186
|
self,
|
186
187
|
) -> dict[str, Times]:
|
187
188
|
"""
|
188
|
-
Return the
|
189
|
+
Return the value for the attribute from class instance.
|
189
190
|
|
190
|
-
:returns:
|
191
|
+
:returns: Value for the attribute from class instance.
|
191
192
|
"""
|
192
193
|
|
193
194
|
return dict(self.__cache_dict)
|
@@ -198,9 +199,9 @@ class Timers:
|
|
198
199
|
self,
|
199
200
|
) -> str:
|
200
201
|
"""
|
201
|
-
Return the
|
202
|
+
Return the value for the attribute from class instance.
|
202
203
|
|
203
|
-
:returns:
|
204
|
+
:returns: Value for the attribute from class instance.
|
204
205
|
"""
|
205
206
|
|
206
207
|
return self.__cache_name
|
@@ -231,7 +232,7 @@ class Timers:
|
|
231
232
|
cache = caches[unique]
|
232
233
|
timer = timers[unique]
|
233
234
|
|
234
|
-
ready = cache.
|
235
|
+
ready = cache.since >= timer
|
235
236
|
|
236
237
|
if ready and update:
|
237
238
|
self.update(unique)
|
@@ -278,7 +279,7 @@ class Timers:
|
|
278
279
|
timers = self.__timers
|
279
280
|
caches = self.__cache_dict
|
280
281
|
|
281
|
-
if unique in
|
282
|
+
if unique in timers:
|
282
283
|
raise ValueError('unique')
|
283
284
|
|
284
285
|
timers[unique] = float(minimum)
|
@@ -34,7 +34,7 @@ class Times:
|
|
34
34
|
|
35
35
|
:param source: Time in various forms that will be parsed.
|
36
36
|
:param anchor: Optional relative time; for snap notation.
|
37
|
-
:param format: Optional format
|
37
|
+
:param format: Optional format when source is timestamp.
|
38
38
|
:param tzname: Name of the timezone associated to source.
|
39
39
|
This is not relevant in timezone included in source.
|
40
40
|
"""
|
@@ -260,9 +260,9 @@ class Times:
|
|
260
260
|
self,
|
261
261
|
) -> datetime:
|
262
262
|
"""
|
263
|
-
Return the
|
263
|
+
Return the value for the attribute from class instance.
|
264
264
|
|
265
|
-
:returns:
|
265
|
+
:returns: Value for the attribute from class instance.
|
266
266
|
"""
|
267
267
|
|
268
268
|
return self.__source
|
@@ -403,7 +403,7 @@ class Times:
|
|
403
403
|
"""
|
404
404
|
Return the timestamp using provided format for instance.
|
405
405
|
|
406
|
-
:param format: Optional format
|
406
|
+
:param format: Optional format when source is timestamp.
|
407
407
|
:param tzname: Name of the timezone associated to source.
|
408
408
|
This is not relevant in timezone included in source.
|
409
409
|
:returns: Timestamp using provided format for instance.
|
@@ -109,9 +109,9 @@ class Window:
|
|
109
109
|
self,
|
110
110
|
) -> SCHEDULE:
|
111
111
|
"""
|
112
|
-
Return the
|
112
|
+
Return the value for the attribute from class instance.
|
113
113
|
|
114
|
-
:returns:
|
114
|
+
:returns: Value for the attribute from class instance.
|
115
115
|
"""
|
116
116
|
|
117
117
|
return copy(self.__schedule)
|
@@ -122,9 +122,9 @@ class Window:
|
|
122
122
|
self,
|
123
123
|
) -> Times:
|
124
124
|
"""
|
125
|
-
Return the
|
125
|
+
Return the value for the attribute from class instance.
|
126
126
|
|
127
|
-
:returns:
|
127
|
+
:returns: Value for the attribute from class instance.
|
128
128
|
"""
|
129
129
|
|
130
130
|
return Times(self.__start)
|
@@ -135,9 +135,9 @@ class Window:
|
|
135
135
|
self,
|
136
136
|
) -> Times:
|
137
137
|
"""
|
138
|
-
Return the
|
138
|
+
Return the value for the attribute from class instance.
|
139
139
|
|
140
|
-
:returns:
|
140
|
+
:returns: Value for the attribute from class instance.
|
141
141
|
"""
|
142
142
|
|
143
143
|
return Times(self.__stop)
|
@@ -148,9 +148,9 @@ class Window:
|
|
148
148
|
self,
|
149
149
|
) -> Times:
|
150
150
|
"""
|
151
|
-
Return the
|
151
|
+
Return the value for the attribute from class instance.
|
152
152
|
|
153
|
-
:returns:
|
153
|
+
:returns: Value for the attribute from class instance.
|
154
154
|
"""
|
155
155
|
|
156
156
|
return Times(self.__anchor)
|
@@ -161,9 +161,9 @@ class Window:
|
|
161
161
|
self,
|
162
162
|
) -> float:
|
163
163
|
"""
|
164
|
-
Return the
|
164
|
+
Return the value for the attribute from class instance.
|
165
165
|
|
166
|
-
:returns:
|
166
|
+
:returns: Value for the attribute from class instance.
|
167
167
|
"""
|
168
168
|
|
169
169
|
return self.__delay
|
@@ -174,9 +174,9 @@ class Window:
|
|
174
174
|
self,
|
175
175
|
) -> Times:
|
176
176
|
"""
|
177
|
-
Return the
|
177
|
+
Return the value for the attribute from class instance.
|
178
178
|
|
179
|
-
:returns:
|
179
|
+
:returns: Value for the attribute from class instance.
|
180
180
|
"""
|
181
181
|
|
182
182
|
return Times(self.__winext)
|
@@ -187,9 +187,9 @@ class Window:
|
|
187
187
|
self,
|
188
188
|
) -> Times:
|
189
189
|
"""
|
190
|
-
Return the
|
190
|
+
Return the value for the attribute from class instance.
|
191
191
|
|
192
|
-
:returns:
|
192
|
+
:returns: Value for the attribute from class instance.
|
193
193
|
"""
|
194
194
|
|
195
195
|
return Times(self.__wilast)
|
@@ -200,9 +200,9 @@ class Window:
|
|
200
200
|
self,
|
201
201
|
) -> bool:
|
202
202
|
"""
|
203
|
-
Return the
|
203
|
+
Return the value for the attribute from class instance.
|
204
204
|
|
205
|
-
:returns:
|
205
|
+
:returns: Value for the attribute from class instance.
|
206
206
|
"""
|
207
207
|
|
208
208
|
return self.__walked
|
@@ -0,0 +1 @@
|
|
1
|
+
0.7.3
|
@@ -1 +0,0 @@
|
|
1
|
-
0.7.2
|
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
|