bluer-options 5.159.1__tar.gz → 5.164.1__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.
- {bluer_options-5.159.1/bluer_options.egg-info → bluer_options-5.164.1}/PKG-INFO +1 -1
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/__init__.py +1 -1
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/logger/__init__.py +1 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/logger/config.py +22 -8
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/timer.py +15 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1/bluer_options.egg-info}/PKG-INFO +1 -1
- {bluer_options-5.159.1 → bluer_options-5.164.1}/LICENSE +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/MANIFEST.in +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/README.md +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/alias.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/assert.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/bluer_options.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/bool.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/browse.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/code.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/env/backup.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/env/dot/cat.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/env/dot/cp.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/env/dot/edit.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/env/dot/load.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/env/dot/seed.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/env/dot.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/env.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/eval.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/generic_task.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/help.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/install.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/list.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/logging.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/open.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/options.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/pause.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/plugins.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/pylint.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/pytest.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/repeat.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/seed.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/sleep.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/source.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/string.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/terminal.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/test.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/wait.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/.bash/watch.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/__main__.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/assets/example1.sh +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/config.env +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/elapsed_timer.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/env/__init__.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/env/functions.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/help/__init__.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/help/__main__.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/help/functions.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/help/parsing.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/host/__init__.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/host/__main__.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/host/functions.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/list/__init__.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/list/__main__.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/options/__init__.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/options/__main__.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/options/classes.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/string/__init__.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/string/__main__.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/string/constants.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/string/functions.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/terminal/__init__.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/terminal/__main__.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/terminal/functions.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options/urls.py +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options.egg-info/SOURCES.txt +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options.egg-info/dependency_links.txt +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options.egg-info/requires.txt +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/bluer_options.egg-info/top_level.txt +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/pyproject.toml +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/requirements.txt +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/setup.cfg +0 -0
- {bluer_options-5.159.1 → bluer_options-5.164.1}/setup.py +0 -0
|
@@ -87,6 +87,23 @@ def log_dict(
|
|
|
87
87
|
break
|
|
88
88
|
|
|
89
89
|
|
|
90
|
+
def log_list_as_str(
|
|
91
|
+
title: str,
|
|
92
|
+
list_of_items: list,
|
|
93
|
+
item_name_plural: str = "item(s)",
|
|
94
|
+
max_count: int = 5,
|
|
95
|
+
) -> str:
|
|
96
|
+
return "{} {} {}: {}".format(
|
|
97
|
+
title,
|
|
98
|
+
len(list_of_items),
|
|
99
|
+
item_name_plural,
|
|
100
|
+
", ".join(
|
|
101
|
+
list_of_items[:max_count]
|
|
102
|
+
+ (["..."] if len(list_of_items) > max_count else [])
|
|
103
|
+
),
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
|
|
90
107
|
def log_list(
|
|
91
108
|
logger: Logger,
|
|
92
109
|
title: str,
|
|
@@ -98,14 +115,11 @@ def log_list(
|
|
|
98
115
|
):
|
|
99
116
|
if not itemize:
|
|
100
117
|
logger.info(
|
|
101
|
-
|
|
102
|
-
title,
|
|
103
|
-
|
|
104
|
-
item_name_plural,
|
|
105
|
-
|
|
106
|
-
list_of_items[:max_count]
|
|
107
|
-
+ (["..."] if len(list_of_items) > max_count else [])
|
|
108
|
-
),
|
|
118
|
+
log_list_as_str(
|
|
119
|
+
title=title,
|
|
120
|
+
list_of_items=list_of_items,
|
|
121
|
+
item_name_plural=item_name_plural,
|
|
122
|
+
max_count=max_count,
|
|
109
123
|
)
|
|
110
124
|
)
|
|
111
125
|
return
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import time
|
|
2
|
+
|
|
2
3
|
from bluer_options import string
|
|
4
|
+
from bluer_options.logger import logger
|
|
3
5
|
|
|
4
6
|
|
|
5
7
|
class Timer:
|
|
@@ -7,6 +9,7 @@ class Timer:
|
|
|
7
9
|
self,
|
|
8
10
|
period: int,
|
|
9
11
|
name: str,
|
|
12
|
+
log: bool = False,
|
|
10
13
|
):
|
|
11
14
|
self.count = 0
|
|
12
15
|
self.hot = False
|
|
@@ -15,6 +18,18 @@ class Timer:
|
|
|
15
18
|
self.name = name
|
|
16
19
|
self.start_time = time.time()
|
|
17
20
|
|
|
21
|
+
if log:
|
|
22
|
+
logger.info(
|
|
23
|
+
"{}: {} every {}.".format(
|
|
24
|
+
self.__class__.__name__,
|
|
25
|
+
name,
|
|
26
|
+
string.pretty_duration(
|
|
27
|
+
period,
|
|
28
|
+
include_ms=True,
|
|
29
|
+
),
|
|
30
|
+
)
|
|
31
|
+
)
|
|
32
|
+
|
|
18
33
|
def reset(self):
|
|
19
34
|
self.hot = False
|
|
20
35
|
self.last_hot = time.time()
|
|
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
|