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.
@@ -0,0 +1,2 @@
1
+ """Terminal Explorer package: Python launchers for the Bash application."""
2
+ __version__ = "3.0.1"
@@ -0,0 +1,5 @@
1
+ """Run Terminal Explorer using python -m baska_explorer."""
2
+ from .cli import main
3
+
4
+ if __name__ == "__main__":
5
+ raise SystemExit(main())
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())