bear-utils 0.8.5__tar.gz → 0.8.6__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.
- {bear_utils-0.8.5 → bear_utils-0.8.6}/.bumpversion.cfg +1 -1
- {bear_utils-0.8.5 → bear_utils-0.8.6}/PKG-INFO +2 -2
- {bear_utils-0.8.5 → bear_utils-0.8.6}/README.md +1 -1
- {bear_utils-0.8.5 → bear_utils-0.8.6}/pyproject.toml +1 -1
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/cli/shell/_base_command.py +13 -5
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/cli/shell/_base_shell.py +3 -3
- {bear_utils-0.8.5 → bear_utils-0.8.6}/.gitignore +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/.python-version +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/AGENTS.md +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/config/coverage.ini +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/config/default.toml +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/config/git-changelog.toml +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/config/pytest.ini +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/config/ruff.toml +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/config/vscode/launch.json +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/config/vscode/settings.json +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/config/vscode/tasks.json +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/directory_structure.txt +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/maskfile.md +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/noxfile.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/__main__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/_internal/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/_internal/cli.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/_internal/debug.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/ai/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/ai/ai_helpers/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/ai/ai_helpers/_common.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/ai/ai_helpers/_config.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/ai/ai_helpers/_parsers.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/ai/ai_helpers/_types.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/cache/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/cli/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/cli/commands.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/cli/prompt_helpers.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/cli/shell/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/cli/shell/_common.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/config/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/config/config_manager.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/config/dir_manager.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/config/settings_manager.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/constants/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/constants/_exceptions.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/constants/_lazy_typing.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/constants/date_related.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/constants/logger_protocol.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/constants/time_related.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/database/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/database/_db_manager.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/events/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/events/events_class.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/events/events_module.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/extras/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/extras/_async_helpers.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/extras/_tools.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/extras/platform_utils.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/extras/responses/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/extras/responses/function_response.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/extras/wrappers/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/extras/wrappers/add_methods.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/files/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/files/file_handlers/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/files/file_handlers/_base_file_handler.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/files/file_handlers/file_handler_factory.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/files/file_handlers/json_file_handler.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/files/file_handlers/log_file_handler.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/files/file_handlers/toml_file_handler.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/files/file_handlers/txt_file_handler.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/files/file_handlers/yaml_file_handler.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/files/ignore_parser.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/graphics/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/graphics/bear_gradient.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/graphics/image_helpers.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/gui/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/gui/gui_tools/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/gui/gui_tools/_settings.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/gui/gui_tools/_types.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/gui/gui_tools/qt_app.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/gui/gui_tools/qt_color_picker.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/gui/gui_tools/qt_file_handler.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/gui/gui_tools/qt_input_dialog.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/logger_manager/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/logger_manager/_common.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/logger_manager/_console_junk.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/logger_manager/_styles.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/logger_manager/loggers/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/logger_manager/loggers/_base_logger.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/logger_manager/loggers/_base_logger.pyi +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/logger_manager/loggers/_buffer_logger.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/logger_manager/loggers/_console_logger.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/logger_manager/loggers/_console_logger.pyi +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/logger_manager/loggers/_file_logger.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/logger_manager/loggers/_level_sin.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/logger_manager/loggers/_logger.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/logger_manager/loggers/_sub_logger.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/logger_manager/loggers/_sub_logger.pyi +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/monitoring/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/monitoring/_common.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/monitoring/host_monitor.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/time/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/tests/__init__.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/tests/test_add_ord_suffix.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/tests/test_clipboard.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/tests/test_default_shell.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/tests/test_function_response.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/tests/test_gradient.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/tests/test_logger.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/tests/test_platform_utils.py +0 -0
- {bear_utils-0.8.5 → bear_utils-0.8.6}/uv.lock +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: bear-utils
|
3
|
-
Version: 0.8.
|
3
|
+
Version: 0.8.6
|
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.6
|
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
|
|
@@ -1,4 +1,4 @@
|
|
1
|
-
# Bear Utils v# Bear Utils v0.8.
|
1
|
+
# Bear Utils v# Bear Utils v0.8.6
|
2
2
|
|
3
3
|
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.
|
4
4
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
[project]
|
2
2
|
name = "bear-utils"
|
3
|
-
version = "0.8.
|
3
|
+
version = "0.8.6"
|
4
4
|
description = "Various utilities for Bear programmers, including a rich logging utility, a disk cache, and a SQLite database wrapper amongst other things."
|
5
5
|
authors = [{ name = "chaz", email = "bright.lid5647@fastmail.com" }]
|
6
6
|
readme = "README.md"
|
@@ -1,5 +1,5 @@
|
|
1
1
|
from subprocess import CompletedProcess
|
2
|
-
from typing import TYPE_CHECKING, Any, ClassVar,
|
2
|
+
from typing import TYPE_CHECKING, Any, ClassVar, Self
|
3
3
|
|
4
4
|
if TYPE_CHECKING:
|
5
5
|
from subprocess import CompletedProcess
|
@@ -50,9 +50,9 @@ class BaseShellCommand[T: str]:
|
|
50
50
|
@property
|
51
51
|
def cmd(self) -> str:
|
52
52
|
"""Return the full command as a string"""
|
53
|
-
cmd_parts = [self.command_name, self.sub_command, *self.args]
|
54
|
-
cmd_parts = [part for part in cmd_parts if part]
|
55
|
-
joined:
|
53
|
+
cmd_parts: list[str] = [self.command_name, self.sub_command, *self.args]
|
54
|
+
cmd_parts: list[str] = [part for part in cmd_parts if part]
|
55
|
+
joined: str = " ".join(cmd_parts).strip()
|
56
56
|
if self.suffix:
|
57
57
|
return f"{joined} {self.suffix}"
|
58
58
|
return joined
|
@@ -64,9 +64,17 @@ class BaseShellCommand[T: str]:
|
|
64
64
|
with shell_session(**kwargs) as session:
|
65
65
|
result: CompletedProcess[str] = session.add(self.cmd).run()
|
66
66
|
if result is not None:
|
67
|
-
self.result =
|
67
|
+
self.result = result
|
68
68
|
return self
|
69
69
|
|
70
|
+
def get_result(self) -> CompletedProcess[str]:
|
71
|
+
"""Get the result of the command execution"""
|
72
|
+
if self.result is None:
|
73
|
+
self.do()
|
74
|
+
if self.result is None:
|
75
|
+
raise RuntimeError("Command execution failed for some reason.")
|
76
|
+
return self.result
|
77
|
+
|
70
78
|
def get(self) -> str:
|
71
79
|
"""Get the result of the command execution"""
|
72
80
|
if self.result is None:
|
@@ -180,7 +180,7 @@ class SimpleShellSession:
|
|
180
180
|
self.reset_buffer()
|
181
181
|
return self.result
|
182
182
|
|
183
|
-
def run(self, cmd: str | BaseShellCommand | None = None, *args) -> CompletedProcess[str]
|
183
|
+
def run(self, cmd: str | BaseShellCommand | None = None, *args) -> CompletedProcess[str]:
|
184
184
|
"""Run the accumulated command history"""
|
185
185
|
if self.empty_history and cmd is None:
|
186
186
|
raise ValueError("No commands to run")
|
@@ -191,12 +191,12 @@ class SimpleShellSession:
|
|
191
191
|
)
|
192
192
|
|
193
193
|
if self.has_history and cmd is None:
|
194
|
-
result: CompletedProcess[str]
|
194
|
+
result: CompletedProcess[str] = self._run(self.cmd)
|
195
195
|
elif self.empty_history and cmd is not None:
|
196
196
|
self.cmd_buffer.write(f"{cmd} ")
|
197
197
|
if args:
|
198
198
|
self.cmd_buffer.write(" ".join(map(str, args)))
|
199
|
-
result: CompletedProcess[str]
|
199
|
+
result: CompletedProcess[str] = self._run(self.cmd)
|
200
200
|
else:
|
201
201
|
raise ValueError("Unexpected state")
|
202
202
|
self.reset_buffer()
|
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
|
{bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/files/file_handlers/_base_file_handler.py
RENAMED
File without changes
|
{bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/files/file_handlers/file_handler_factory.py
RENAMED
File without changes
|
{bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/files/file_handlers/json_file_handler.py
RENAMED
File without changes
|
{bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/files/file_handlers/log_file_handler.py
RENAMED
File without changes
|
{bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/files/file_handlers/toml_file_handler.py
RENAMED
File without changes
|
{bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/files/file_handlers/txt_file_handler.py
RENAMED
File without changes
|
{bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/files/file_handlers/yaml_file_handler.py
RENAMED
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
|
{bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/logger_manager/loggers/_base_logger.pyi
RENAMED
File without changes
|
{bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/logger_manager/loggers/_buffer_logger.py
RENAMED
File without changes
|
{bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/logger_manager/loggers/_console_logger.py
RENAMED
File without changes
|
{bear_utils-0.8.5 → bear_utils-0.8.6}/src/bear_utils/logger_manager/loggers/_console_logger.pyi
RENAMED
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
|