bear-utils 0.7.22__py3-none-any.whl → 0.7.23__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.
- bear_utils/cli/shell/_base_command.py +1 -0
- bear_utils/extras/_tools.py +8 -0
- bear_utils/logging/logger_manager/_console_junk.py +1 -1
- bear_utils/logging/logger_manager/loggers/_base_logger.py +0 -3
- bear_utils/logging/logger_manager/loggers/_console_logger.py +3 -5
- {bear_utils-0.7.22.dist-info → bear_utils-0.7.23.dist-info}/METADATA +2 -2
- {bear_utils-0.7.22.dist-info → bear_utils-0.7.23.dist-info}/RECORD +8 -8
- {bear_utils-0.7.22.dist-info → bear_utils-0.7.23.dist-info}/WHEEL +0 -0
@@ -50,6 +50,7 @@ class BaseShellCommand[T: str]:
|
|
50
50
|
def cmd(self) -> str:
|
51
51
|
"""Return the full command as a string"""
|
52
52
|
cmd_parts = [self.command_name, self.sub_command, *self.args]
|
53
|
+
cmd_parts = [part for part in cmd_parts if part]
|
53
54
|
joined: LiteralString = " ".join(cmd_parts).strip()
|
54
55
|
if self.suffix:
|
55
56
|
return f"{joined} {self.suffix}"
|
bear_utils/extras/_tools.py
CHANGED
@@ -74,6 +74,14 @@ class ClipboardManager:
|
|
74
74
|
case _:
|
75
75
|
raise RuntimeError(f"Unsupported platform: {platform}")
|
76
76
|
|
77
|
+
def _copy_cmd(self) -> ShellCommand[str]:
|
78
|
+
"""Get the copy command based on the platform."""
|
79
|
+
return self._copy
|
80
|
+
|
81
|
+
def _paste_cmd(self) -> ShellCommand[str]:
|
82
|
+
"""Get the paste command based on the platform."""
|
83
|
+
return self._paste
|
84
|
+
|
77
85
|
def get_history(self) -> deque:
|
78
86
|
"""Get the clipboard history.
|
79
87
|
|
@@ -153,9 +153,7 @@ class BaseLogger(SingletonBase):
|
|
153
153
|
print(
|
154
154
|
f"ConsoleLogger: Error printing exception traceback. Message: {msg} Exception: {exc_info} Error: {e}"
|
155
155
|
)
|
156
|
-
|
157
156
|
self._print(msg, end, style=kwargs.pop("style", None))
|
158
|
-
|
159
157
|
if extra:
|
160
158
|
self._print(msg=extra, end=end, json=True, indent=4)
|
161
159
|
|
@@ -207,7 +205,6 @@ class BaseLogger(SingletonBase):
|
|
207
205
|
exc_tuple = sys.exc_info()
|
208
206
|
else:
|
209
207
|
exc_tuple = exc_info
|
210
|
-
|
211
208
|
if exc_tuple:
|
212
209
|
exc_type, exc_value, exc_traceback = exc_tuple
|
213
210
|
if exc_type is not None and exc_value is not None and exc_traceback is not None:
|
@@ -156,8 +156,8 @@ class ConsoleLogger(Logger, BaseLogger):
|
|
156
156
|
self.log(
|
157
157
|
extra.get("log_level", DEBUG),
|
158
158
|
msg,
|
159
|
-
extra,
|
160
159
|
*args,
|
160
|
+
extra=extra,
|
161
161
|
**kwargs,
|
162
162
|
)
|
163
163
|
|
@@ -243,12 +243,10 @@ class ConsoleLogger(Logger, BaseLogger):
|
|
243
243
|
fn, lno, func, sinfo = self.findCaller(stack_info, stacklevel)
|
244
244
|
except ValueError:
|
245
245
|
fn, lno, func, sinfo = "(unknown file)", 0, "(unknown function)", None
|
246
|
-
|
247
246
|
final_extra = extra or {}
|
248
|
-
|
249
247
|
if exc_info is not None:
|
250
|
-
exec_values
|
251
|
-
if exec_values
|
248
|
+
exec_values = self._extract_exception_values(exc_info)
|
249
|
+
if exec_values:
|
252
250
|
final_extra = {**final_extra, "exec_values": exec_values}
|
253
251
|
|
254
252
|
record = self.makeRecord(
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: bear-utils
|
3
|
-
Version: 0.7.
|
3
|
+
Version: 0.7.23
|
4
4
|
Summary: Various utilities for Bear programmers, including a rich logging utility, a disk cache, and a SQLite database wrapper amongst other things.
|
5
5
|
Author-email: chaz <bright.lid5647@fastmail.com>
|
6
6
|
Requires-Python: >=3.12
|
@@ -20,7 +20,7 @@ Requires-Dist: tinydb>=4.8.2
|
|
20
20
|
Requires-Dist: toml>=0.10.2
|
21
21
|
Description-Content-Type: text/markdown
|
22
22
|
|
23
|
-
# Bear Utils v# Bear Utils v0.7.
|
23
|
+
# Bear Utils v# Bear Utils v0.7.23
|
24
24
|
|
25
25
|
Personal set of tools and utilities for Python projects, focusing on modularity and ease of use. This library includes components for caching, database management, logging, time handling, file operations, CLI prompts, image processing, clipboard interaction, gradient utilities, event systems, and async helpers.
|
26
26
|
|
@@ -10,7 +10,7 @@ bear_utils/cli/__init__.py,sha256=H2QpLyHpQS_Yn3sF2px7n4KqT97LEe7Oyzafg2iHcpc,50
|
|
10
10
|
bear_utils/cli/commands.py,sha256=5ppEjvVV_g28WLaIFtKgz-ctzwoo-g-KpHTXNx9xBzo,3161
|
11
11
|
bear_utils/cli/prompt_helpers.py,sha256=dHs7qToSKWQEe_iPshDJglg48OdjJXbNHSCA_3rjmHg,6581
|
12
12
|
bear_utils/cli/shell/__init__.py,sha256=2s3oR6CqLKj1iyERy7YafWT3t3KzTr70Z1yaLKa6IiQ,42
|
13
|
-
bear_utils/cli/shell/_base_command.py,sha256=
|
13
|
+
bear_utils/cli/shell/_base_command.py,sha256=eqvYSXR_NqWqJm5meGTONYJGSG32q0AQDfTGums2hI0,2471
|
14
14
|
bear_utils/cli/shell/_base_shell.py,sha256=mZ67s_hEa-ouFwEYnW5ddwohKxE6rQ4OZqi5vth4-7U,16730
|
15
15
|
bear_utils/cli/shell/_common.py,sha256=_KQyL5lvqOfjonFIwlEOyp3K9G3TSOj19RhgVzfNNpg,669
|
16
16
|
bear_utils/config/__init__.py,sha256=HC_lWpmLF0kbPr5i1Wa2FLER2b446E_GecgU9EPmc04,353
|
@@ -30,7 +30,7 @@ bear_utils/events/events_class.py,sha256=vPDjWrbut8L3TFn7byyYFZpWYM5ADIqtW2Aeh-q
|
|
30
30
|
bear_utils/events/events_module.py,sha256=rv9NoCDFOaYY70EilrImG9ug90n_wpDBDz4XvxUYqdE,2291
|
31
31
|
bear_utils/extras/__init__.py,sha256=szflSapj7aGFc2j5sTitQFccXu-6_UdGG-eYuv6zVJI,607
|
32
32
|
bear_utils/extras/_async_helpers.py,sha256=cxq5d24NHkECmZqTVXEazv6K-XUa7skFnX6KQZb0Ycw,411
|
33
|
-
bear_utils/extras/_tools.py,sha256=
|
33
|
+
bear_utils/extras/_tools.py,sha256=OYzGEEp7F6H6qr1t1QlnHTnAb4JaH6p9_maSXeDGFFM,7681
|
34
34
|
bear_utils/extras/platform_utils.py,sha256=Ai7ow7S-_cKb5zFwFh8dkC8xmbMJFy-0_-w3NCERdEw,1362
|
35
35
|
bear_utils/extras/responses/__init__.py,sha256=U5InC9ec9OI-f_eCi78z8UJsqtgEA5PGBvu94yvgjnA,89
|
36
36
|
bear_utils/extras/responses/function_response.py,sha256=GJCYKKXC5U4lT-mBf40YZj5a6UIS3bCRn0qzwM-CETM,12718
|
@@ -61,13 +61,13 @@ bear_utils/logging/__init__.py,sha256=ZW1DjUziSivNlR5HW2i3HrWROZtODbw-GX73lZZ9Pu
|
|
61
61
|
bear_utils/logging/loggers.py,sha256=1bzD0t5D8po-Bto5aa33a3_KWpA7eGNNm1hUBVX8vKs,2840
|
62
62
|
bear_utils/logging/logger_manager/__init__.py,sha256=kbWW34QymkDzwmHnp5Ibd9F-8mzBblTVoX40giwdrgw,38
|
63
63
|
bear_utils/logging/logger_manager/_common.py,sha256=m72yhFmBBgZN7u3omI43AERKQyR9bVwgeHEfbgPJV4Y,1581
|
64
|
-
bear_utils/logging/logger_manager/_console_junk.py,sha256=
|
64
|
+
bear_utils/logging/logger_manager/_console_junk.py,sha256=2fwiYjZZps3GrH5An7aU3Bgvb_aAJiqNzTnKaku6m-0,4916
|
65
65
|
bear_utils/logging/logger_manager/_styles.py,sha256=3A30TrvPSOm1h2IfHgdDEUc0WP71zWZDGCHrCRofdjc,2523
|
66
66
|
bear_utils/logging/logger_manager/loggers/__init__.py,sha256=ashcnkvQIUQDLbUtU6QILkMjP_fMaeHAN1w7pHLWqQk,67
|
67
|
-
bear_utils/logging/logger_manager/loggers/_base_logger.py,sha256=
|
67
|
+
bear_utils/logging/logger_manager/loggers/_base_logger.py,sha256=SgFrqy1mqC-Lc9p4K13vddyoF77ybKDgsrbo22rhmeM,9509
|
68
68
|
bear_utils/logging/logger_manager/loggers/_base_logger.pyi,sha256=bLB1UFG9NkQZ1GwcfcXldqYz6I4xR3y-sFp9yRpLhlY,2675
|
69
69
|
bear_utils/logging/logger_manager/loggers/_buffer_logger.py,sha256=JEd2afChzAKkM1va-L8xVOi1cF9n9W1vGzkI49YEf40,1527
|
70
|
-
bear_utils/logging/logger_manager/loggers/_console_logger.py,sha256=
|
70
|
+
bear_utils/logging/logger_manager/loggers/_console_logger.py,sha256=RUFXg3ZhXljw9nAhlSmbzTWr3osddG15pLADvto5y08,9882
|
71
71
|
bear_utils/logging/logger_manager/loggers/_console_logger.pyi,sha256=mI38SrE5vu4LZih_Y4ABqYcH499eeY-CDJ4VRr5JA8o,1874
|
72
72
|
bear_utils/logging/logger_manager/loggers/_file_logger.py,sha256=d-G5xeaAk0q3bd29Nbp-PfOrToVLyEq_JDCqhAu7wus,4760
|
73
73
|
bear_utils/logging/logger_manager/loggers/_level_sin.py,sha256=HxAhuQSBhJHygTB8hcAIYLoPl6u0pUbF1BZ2aLFmEHI,1747
|
@@ -78,6 +78,6 @@ bear_utils/monitoring/__init__.py,sha256=9DKNIWTp_voLnaWgiP-wJ-o_N0hYixo-MzjUmg8
|
|
78
78
|
bear_utils/monitoring/_common.py,sha256=LYQFxgTP9fk0cH71IQTuGwBYYPWCqHP_mMRNecoD76M,657
|
79
79
|
bear_utils/monitoring/host_monitor.py,sha256=iawDGJWvByUnTanJvgiZMlqSJr3JpEWJdgA99A-fol0,13214
|
80
80
|
bear_utils/time/__init__.py,sha256=d9Ovv-Dlx5NWgnOl1hY-evznVm9hboS6ypNp1wDFxQQ,934
|
81
|
-
bear_utils-0.7.
|
82
|
-
bear_utils-0.7.
|
83
|
-
bear_utils-0.7.
|
81
|
+
bear_utils-0.7.23.dist-info/METADATA,sha256=wXfmG9H_JcV1OF_uoLJNbIxnVQ2ieEoMXUPa450yTtM,8629
|
82
|
+
bear_utils-0.7.23.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
83
|
+
bear_utils-0.7.23.dist-info/RECORD,,
|
File without changes
|