baska-explorer 3.0.1__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.
- baska_explorer/__init__.py +2 -0
- baska_explorer/__main__.py +5 -0
- baska_explorer/cli.py +37 -0
- baska_explorer/explorer.sh +1407 -0
- baska_explorer-3.0.1.dist-info/METADATA +251 -0
- baska_explorer-3.0.1.dist-info/RECORD +10 -0
- baska_explorer-3.0.1.dist-info/WHEEL +5 -0
- baska_explorer-3.0.1.dist-info/entry_points.txt +4 -0
- baska_explorer-3.0.1.dist-info/licenses/LICENSE +57 -0
- baska_explorer-3.0.1.dist-info/top_level.txt +1 -0
baska_explorer/cli.py
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"""Local launcher for the bundled Terminal Explorer Bash script.
|
|
2
|
+
|
|
3
|
+
Installing this package never runs an installer, downloads remote code, or
|
|
4
|
+
modifies system packages. External Bash/fzf dependencies remain user-managed.
|
|
5
|
+
"""
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
from importlib import resources
|
|
9
|
+
import shutil
|
|
10
|
+
import subprocess
|
|
11
|
+
import sys
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
def main(argv: list[str] | None = None) -> int:
|
|
15
|
+
args = list(sys.argv[1:] if argv is None else argv)
|
|
16
|
+
if not sys.platform.startswith("linux"):
|
|
17
|
+
print("Terminal Explorer supports Linux and Termux only; Windows is not supported.", file=sys.stderr)
|
|
18
|
+
return 2
|
|
19
|
+
|
|
20
|
+
bash = shutil.which("bash")
|
|
21
|
+
if not bash:
|
|
22
|
+
print("Bash is required. Install bash with your system package manager.", file=sys.stderr)
|
|
23
|
+
return 127
|
|
24
|
+
|
|
25
|
+
try:
|
|
26
|
+
script = resources.files("baska_explorer").joinpath("explorer.sh")
|
|
27
|
+
with resources.as_file(script) as path:
|
|
28
|
+
return subprocess.call([bash, str(path), *args])
|
|
29
|
+
except KeyboardInterrupt:
|
|
30
|
+
return 130
|
|
31
|
+
except OSError as exc:
|
|
32
|
+
print(f"Unable to launch Terminal Explorer: {exc}", file=sys.stderr)
|
|
33
|
+
return 127
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
if __name__ == "__main__":
|
|
37
|
+
sys.exit(main())
|