bear-utils 0.8.4__py3-none-any.whl → 0.8.5__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 +2 -1
- bear_utils/cli/shell/_base_shell.py +1 -1
- bear_utils/extras/responses/function_response.py +4 -4
- {bear_utils-0.8.4.dist-info → bear_utils-0.8.5.dist-info}/METADATA +2 -2
- {bear_utils-0.8.4.dist-info → bear_utils-0.8.5.dist-info}/RECORD +6 -6
- {bear_utils-0.8.4.dist-info → bear_utils-0.8.5.dist-info}/WHEEL +0 -0
@@ -1,3 +1,4 @@
|
|
1
|
+
from subprocess import CompletedProcess
|
1
2
|
from typing import TYPE_CHECKING, Any, ClassVar, LiteralString, Self, cast
|
2
3
|
|
3
4
|
if TYPE_CHECKING:
|
@@ -61,7 +62,7 @@ class BaseShellCommand[T: str]:
|
|
61
62
|
from ._base_shell import shell_session # noqa: PLC0415
|
62
63
|
|
63
64
|
with shell_session(**kwargs) as session:
|
64
|
-
result = session.add(self.cmd).run()
|
65
|
+
result: CompletedProcess[str] = session.add(self.cmd).run()
|
65
66
|
if result is not None:
|
66
67
|
self.result = cast("CompletedProcess[str]", result)
|
67
68
|
return self
|
@@ -147,7 +147,7 @@ class SimpleShellSession:
|
|
147
147
|
self.cmd_buffer.write(str(c))
|
148
148
|
return self
|
149
149
|
|
150
|
-
def _run(self, command: str) -> CompletedProcess[str]
|
150
|
+
def _run(self, command: str) -> CompletedProcess[str]:
|
151
151
|
"""Internal method to run the accumulated command"""
|
152
152
|
self.logger.verbose(f"Executing: {command}")
|
153
153
|
self.next_cmd()
|
@@ -269,15 +269,15 @@ class FunctionResponse(BaseModel):
|
|
269
269
|
if content is not None and error is None:
|
270
270
|
if isinstance(content, list):
|
271
271
|
for item in content:
|
272
|
-
logger.info(
|
272
|
+
logger.info(f"{self.name}: {item}" if self.name else item)
|
273
273
|
elif isinstance(content, str):
|
274
|
-
logger.info(
|
274
|
+
logger.info(f"{self.name}: {content}" if self.name else content)
|
275
275
|
elif error is not None and content is None:
|
276
276
|
if isinstance(error, list):
|
277
277
|
for err in error:
|
278
|
-
logger.error(
|
278
|
+
logger.error(f"{self.name}: {err}" if self.name else err)
|
279
279
|
elif isinstance(error, str):
|
280
|
-
logger.error(
|
280
|
+
logger.error(f"{self.name}: {error}" if self.name else error)
|
281
281
|
|
282
282
|
@overload
|
283
283
|
def done(self, to_dict: Literal[True], suppress: list[str] | None = None) -> dict[str, Any]: ...
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: bear-utils
|
3
|
-
Version: 0.8.
|
3
|
+
Version: 0.8.5
|
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.8.
|
23
|
+
# Bear Utils v# Bear Utils v0.8.5
|
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
|
|
@@ -14,8 +14,8 @@ bear_utils/cli/__init__.py,sha256=H2QpLyHpQS_Yn3sF2px7n4KqT97LEe7Oyzafg2iHcpc,50
|
|
14
14
|
bear_utils/cli/commands.py,sha256=5ppEjvVV_g28WLaIFtKgz-ctzwoo-g-KpHTXNx9xBzo,3161
|
15
15
|
bear_utils/cli/prompt_helpers.py,sha256=DVdg1f5yZElVyFNao6RTPfrc6mKy4PoXLgY6az-ejo8,6580
|
16
16
|
bear_utils/cli/shell/__init__.py,sha256=2s3oR6CqLKj1iyERy7YafWT3t3KzTr70Z1yaLKa6IiQ,42
|
17
|
-
bear_utils/cli/shell/_base_command.py,sha256=
|
18
|
-
bear_utils/cli/shell/_base_shell.py,sha256=
|
17
|
+
bear_utils/cli/shell/_base_command.py,sha256=I2yG1YBPXl2nKX5y3a2kokfdboD0-MGzJ1M7jtJaTUw,2534
|
18
|
+
bear_utils/cli/shell/_base_shell.py,sha256=l0lbFTqqF-gn5TEzGYu2SyDELbUj0qNDim1v6ycLg2c,16727
|
19
19
|
bear_utils/cli/shell/_common.py,sha256=_KQyL5lvqOfjonFIwlEOyp3K9G3TSOj19RhgVzfNNpg,669
|
20
20
|
bear_utils/config/__init__.py,sha256=HC_lWpmLF0kbPr5i1Wa2FLER2b446E_GecgU9EPmc04,353
|
21
21
|
bear_utils/config/config_manager.py,sha256=Xj0xOmY-wo_rwfcWiXyxNZWX9NknX_Jm9W56Gx8yyHQ,8244
|
@@ -37,7 +37,7 @@ bear_utils/extras/_async_helpers.py,sha256=cxq5d24NHkECmZqTVXEazv6K-XUa7skFnX6KQ
|
|
37
37
|
bear_utils/extras/_tools.py,sha256=kxJ1jaqx3PvLpc0CZUIV8XQUwjQGrNCRLoka11aNtoc,7672
|
38
38
|
bear_utils/extras/platform_utils.py,sha256=Ai7ow7S-_cKb5zFwFh8dkC8xmbMJFy-0_-w3NCERdEw,1362
|
39
39
|
bear_utils/extras/responses/__init__.py,sha256=XbE4VKemrKRwx9E5jqy__OiM_AAjA58ebnqQ2hytnT0,225
|
40
|
-
bear_utils/extras/responses/function_response.py,sha256=
|
40
|
+
bear_utils/extras/responses/function_response.py,sha256=D6123VaOaJeeSQ9Gp1gtrvCSv7HF5Iw7dZlGbxHVQDk,14121
|
41
41
|
bear_utils/extras/wrappers/__init__.py,sha256=crh4sKOLvuhNMVX5bJYjCFWtXtH7G47UgNPOHq3HXTk,43
|
42
42
|
bear_utils/extras/wrappers/add_methods.py,sha256=z2XZG2ZoYOB1MaGiLli4NRyyTeRgBy7tuYsiy8mTa9s,4422
|
43
43
|
bear_utils/files/__init__.py,sha256=mIdnFSXoDE64ElM43bN2m6KuafURnN82ki0pdqN8q2o,201
|
@@ -80,6 +80,6 @@ bear_utils/monitoring/__init__.py,sha256=9DKNIWTp_voLnaWgiP-wJ-o_N0hYixo-MzjUmg8
|
|
80
80
|
bear_utils/monitoring/_common.py,sha256=LYQFxgTP9fk0cH71IQTuGwBYYPWCqHP_mMRNecoD76M,657
|
81
81
|
bear_utils/monitoring/host_monitor.py,sha256=e0TYRJw9iDj5Ga6y3ck1TBFEeH42Cax5mQYaNU8yams,13241
|
82
82
|
bear_utils/time/__init__.py,sha256=d9Ovv-Dlx5NWgnOl1hY-evznVm9hboS6ypNp1wDFxQQ,934
|
83
|
-
bear_utils-0.8.
|
84
|
-
bear_utils-0.8.
|
85
|
-
bear_utils-0.8.
|
83
|
+
bear_utils-0.8.5.dist-info/METADATA,sha256=4YF2l-2KEa1Od0MDuFuU-L6U1R6CoaUemmLRrVEVSRk,8634
|
84
|
+
bear_utils-0.8.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
85
|
+
bear_utils-0.8.5.dist-info/RECORD,,
|
File without changes
|