tacklebox-cli 0.4.1__tar.gz → 0.4.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.
- {tacklebox_cli-0.4.1 → tacklebox_cli-0.4.3}/PKG-INFO +4 -4
- {tacklebox_cli-0.4.1 → tacklebox_cli-0.4.3}/tacklebox/commands/clipboard.py +12 -6
- {tacklebox_cli-0.4.1 → tacklebox_cli-0.4.3}/tacklebox/version.py +2 -2
- {tacklebox_cli-0.4.1 → tacklebox_cli-0.4.3}/.gitignore +0 -0
- {tacklebox_cli-0.4.1 → tacklebox_cli-0.4.3}/LICENSE.md +0 -0
- {tacklebox_cli-0.4.1 → tacklebox_cli-0.4.3}/pyproject.toml +0 -0
- {tacklebox_cli-0.4.1 → tacklebox_cli-0.4.3}/tacklebox/__init__.py +0 -0
- {tacklebox_cli-0.4.1 → tacklebox_cli-0.4.3}/tacklebox/commands/__init__.py +0 -0
- {tacklebox_cli-0.4.1 → tacklebox_cli-0.4.3}/tacklebox/commands/find_desktop_entry.py +0 -0
- {tacklebox_cli-0.4.1 → tacklebox_cli-0.4.3}/tacklebox/commands/prepend_to_file.py +0 -0
- {tacklebox_cli-0.4.1 → tacklebox_cli-0.4.3}/tacklebox/commands/version.py +0 -0
- {tacklebox_cli-0.4.1 → tacklebox_cli-0.4.3}/tacklebox/entrypoint.py +0 -0
- {tacklebox_cli-0.4.1 → tacklebox_cli-0.4.3}/tacklebox/sync.py +0 -0
- {tacklebox_cli-0.4.1 → tacklebox_cli-0.4.3}/tacklebox/utils.py +0 -0
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tacklebox-cli
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.3
|
|
4
4
|
Summary: A small collection of CLI utilities.
|
|
5
5
|
Project-URL: Homepage, https://c.csw.im/cswimr/tacklebox
|
|
6
6
|
Project-URL: Issues, https://c.csw.im/cswimr/tacklebox/issues
|
|
7
|
-
Project-URL: Source Archive, https://c.csw.im/cswimr/tacklebox/archive/
|
|
7
|
+
Project-URL: Source Archive, https://c.csw.im/cswimr/tacklebox/archive/d62432a7c631e0b612f20744c68f03c88dbc5313.tar.gz
|
|
8
8
|
Author-email: cswimr <seaswimmerthefsh@gmail.com>
|
|
9
9
|
License-Expression: MIT
|
|
10
10
|
License-File: LICENSE.md
|
|
@@ -20,14 +20,14 @@ Description-Content-Type: text/markdown
|
|
|
20
20
|
[<img alt="Actions Status" src="https://c.csw.im/cswimr/tacklebox/badges/workflows/actions.yml/badge.svg?style=plastic">](https://c.csw.im/cswimr/tacklebox/actions?workflow=actions.yml)
|
|
21
21
|
[<img alt="PyPI - Version" src="https://img.shields.io/pypi/v/tacklebox-cli?style=plastic">](https://pypi.org/project/tacklebox-cli/)
|
|
22
22
|
[<img alt="PyPI - Python Version" src="https://img.shields.io/pypi/pyversions/tacklebox-cli?style=plastic">](https://pypi.org/project/tacklebox-cli/)
|
|
23
|
-
[<img alt="PyPI - License" src="https://img.shields.io/pypi/l/tacklebox-cli?style=plastic">](https://c.csw.im/cswimr/tacklebox/src/tag/0.4.
|
|
23
|
+
[<img alt="PyPI - License" src="https://img.shields.io/pypi/l/tacklebox-cli?style=plastic">](https://c.csw.im/cswimr/tacklebox/src/tag/0.4.3/LICENSE.md)
|
|
24
24
|
tacklebox-cli offers a suite of useful CLI tools.
|
|
25
25
|
|
|
26
26
|
## Usage
|
|
27
27
|
|
|
28
28
|
### tacklebox copy / paste
|
|
29
29
|
|
|
30
|
-
Cross-platform clipboard management tool. Uses system tools such as `wl-copy` on Linux Wayland or `clip.exe` on Windows, and [OSC 52](https://www.reddit.com/r/vim/comments/k1ydpn/a_guide_on_how_to_copy_text_from_anywhere/) escape codes when **copying** over SSH or when no other tools are available. See [`copy_with_tooling()`](https://c.csw.im/cswimr/tacklebox/src/tag/0.4.
|
|
30
|
+
Cross-platform clipboard management tool. Uses system tools such as `wl-copy` on Linux Wayland or `clip.exe` on Windows, and [OSC 52](https://www.reddit.com/r/vim/comments/k1ydpn/a_guide_on_how_to_copy_text_from_anywhere/) escape codes when **copying** over SSH or when no other tools are available. See [`copy_with_tooling()`](https://c.csw.im/cswimr/tacklebox/src/tag/0.4.3/tacklebox/commands/clipboard.py) for all supported tools.
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
33
|
$ echo "a" | tacklebox copy --trim && tacklebox paste
|
|
@@ -7,7 +7,7 @@ from base64 import b64encode
|
|
|
7
7
|
from enum import Enum
|
|
8
8
|
from typing import Annotated, Literal
|
|
9
9
|
|
|
10
|
-
from typer import Argument, Exit, Option, Typer
|
|
10
|
+
from typer import Argument, Exit, Option, Typer
|
|
11
11
|
|
|
12
12
|
from tacklebox.utils import get_environment, stderr, stdout
|
|
13
13
|
|
|
@@ -33,7 +33,7 @@ def _try_command(mode: ClipboardMode, cmd: list[str], verbose: bool = False, dat
|
|
|
33
33
|
"""
|
|
34
34
|
if shutil.which(cmd[0]) is None:
|
|
35
35
|
if verbose:
|
|
36
|
-
|
|
36
|
+
stderr.print(f"{cmd[0]} not found in PATH.")
|
|
37
37
|
return False, None
|
|
38
38
|
|
|
39
39
|
if cmd[0] == "clip.exe":
|
|
@@ -45,20 +45,26 @@ def _try_command(mode: ClipboardMode, cmd: list[str], verbose: bool = False, dat
|
|
|
45
45
|
result = subprocess.run(
|
|
46
46
|
cmd,
|
|
47
47
|
input=data.encode(encoder) if data else None,
|
|
48
|
-
|
|
48
|
+
# in PASTE mode, we need stdout, but we don't care about it in COPY mode
|
|
49
|
+
# this fixes a bug where `wl-copy` sometimes hangs when stdout is piped
|
|
50
|
+
capture_output=True if mode == ClipboardMode.PASTE else False,
|
|
49
51
|
env=get_environment(),
|
|
50
52
|
timeout=30,
|
|
51
53
|
)
|
|
52
54
|
if result.returncode == 0:
|
|
53
55
|
if verbose:
|
|
54
|
-
|
|
56
|
+
stderr.print(f"{mode.value} using {' '.join(cmd)}")
|
|
55
57
|
return True, result.stdout.decode(encoder) if result.stdout else None
|
|
56
58
|
except subprocess.TimeoutExpired:
|
|
57
59
|
if verbose:
|
|
58
|
-
|
|
60
|
+
stderr.print(
|
|
61
|
+
f"{cmd[0]} timed out",
|
|
62
|
+
)
|
|
59
63
|
except OSError as e:
|
|
60
64
|
if verbose:
|
|
61
|
-
|
|
65
|
+
stderr.print(
|
|
66
|
+
f"{cmd[0]} execution failed: {e}",
|
|
67
|
+
)
|
|
62
68
|
return False, None
|
|
63
69
|
|
|
64
70
|
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.4.
|
|
22
|
-
__version_tuple__ = version_tuple = (0, 4,
|
|
21
|
+
__version__ = version = '0.4.3'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 4, 3)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
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
|