akashcli 4.6.4__tar.gz → 4.6.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.
- {akashcli-4.6.4 → akashcli-4.6.6}/PKG-INFO +1 -1
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/__init__.py +1 -1
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/cli.py +11 -3
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/relay.py +26 -28
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli.egg-info/PKG-INFO +1 -1
- {akashcli-4.6.4 → akashcli-4.6.6}/pyproject.toml +1 -1
- {akashcli-4.6.4 → akashcli-4.6.6}/README.md +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/_net.py +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/auth.py +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/client.py +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/config.py +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/crypto.py +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/env_manager.py +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/exceptions.py +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/exec.py +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/integrity.py +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/logger.py +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/models.py +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/p2p.py +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/packages.py +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/restore.py +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/snapshot_crypto.py +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/storage.py +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/terminal.py +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/uploader.py +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli/utils.py +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli.egg-info/SOURCES.txt +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli.egg-info/dependency_links.txt +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli.egg-info/entry_points.txt +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli.egg-info/requires.txt +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/akashcli.egg-info/top_level.txt +0 -0
- {akashcli-4.6.4 → akashcli-4.6.6}/setup.cfg +0 -0
|
@@ -155,10 +155,19 @@ app = typer.Typer(
|
|
|
155
155
|
no_args_is_help=False,
|
|
156
156
|
)
|
|
157
157
|
|
|
158
|
+
def raise_exit():
|
|
159
|
+
raise typer.Exit(0)
|
|
160
|
+
|
|
161
|
+
def _print_version(value: bool):
|
|
162
|
+
if value:
|
|
163
|
+
from . import __version__
|
|
164
|
+
print(f"akashcli v{__version__}")
|
|
165
|
+
raise typer.Exit(0)
|
|
166
|
+
|
|
158
167
|
@app.callback(invoke_without_command=True)
|
|
159
168
|
def _main(ctx: typer.Context,
|
|
160
169
|
version: bool = typer.Option(False, "--version", "-v", is_eager=True, expose_value=False,
|
|
161
|
-
callback=
|
|
170
|
+
callback=_print_version,
|
|
162
171
|
help="Show version and exit."),
|
|
163
172
|
help: bool = typer.Option(False, "--help", "-h", is_eager=True, expose_value=False,
|
|
164
173
|
callback=lambda v: (_print_help(), raise_exit()) if v else None,
|
|
@@ -168,8 +177,7 @@ def _main(ctx: typer.Context,
|
|
|
168
177
|
_print_help()
|
|
169
178
|
raise typer.Exit(0)
|
|
170
179
|
|
|
171
|
-
|
|
172
|
-
raise typer.Exit(0)
|
|
180
|
+
|
|
173
181
|
|
|
174
182
|
def _print_help():
|
|
175
183
|
C, G, Y, DM, RS = _C, _G, _Y, _DM, _RS
|
|
@@ -25,7 +25,7 @@ Wire protocol (all JSON frames over the relay WebSocket):
|
|
|
25
25
|
|
|
26
26
|
from __future__ import annotations
|
|
27
27
|
|
|
28
|
-
AKASH_VERSION = "4.6.
|
|
28
|
+
AKASH_VERSION = "4.6.6"
|
|
29
29
|
|
|
30
30
|
import base64
|
|
31
31
|
import json
|
|
@@ -290,31 +290,24 @@ def _handle_pty(ws, frame: dict) -> None:
|
|
|
290
290
|
import subprocess as _sp
|
|
291
291
|
import tempfile as _tmp
|
|
292
292
|
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
# On Android non-root, TIOCSCTTY is blocked by SELinux so bash prints:
|
|
296
|
-
# "cannot set terminal process group … no job control"
|
|
297
|
-
# Fix: launch bash with --rcfile pointing to a temp file that sources
|
|
298
|
-
# ~/.bashrc then runs `set +m` (disable job-control monitoring).
|
|
299
|
-
# This silences the warning while keeping the shell fully interactive.
|
|
300
|
-
_env = {**os.environ,
|
|
301
|
-
"TERM": "xterm-256color",
|
|
302
|
-
"COLUMNS": str(cols), "LINES": str(rows)}
|
|
293
|
+
shell_bin = os.environ.get("SHELL", "/bin/bash")
|
|
294
|
+
_env = {**os.environ, "TERM": "xterm-256color", "COLUMNS": str(cols), "LINES": str(rows)}
|
|
303
295
|
_bash_env_file = None
|
|
304
|
-
|
|
305
|
-
if
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
296
|
+
|
|
297
|
+
if command:
|
|
298
|
+
# Evaluate commands with flags/arguments through the shell
|
|
299
|
+
_shell_args = [shell_bin, "-c", command]
|
|
300
|
+
else:
|
|
301
|
+
_shell_args = [shell_bin]
|
|
302
|
+
if "bash" in shell_bin.lower():
|
|
303
|
+
try:
|
|
304
|
+
_fd, _bash_env_file = _tmp.mkstemp(prefix=".akash_rc_", suffix=".sh")
|
|
305
|
+
_rc = b'[ -f ~/.bashrc ] && . ~/.bashrc\nset +m\n'
|
|
306
|
+
os.write(_fd, _rc)
|
|
307
|
+
os.close(_fd)
|
|
308
|
+
_shell_args = [shell_bin, "--rcfile", _bash_env_file]
|
|
309
|
+
except Exception:
|
|
310
|
+
_bash_env_file = None
|
|
318
311
|
|
|
319
312
|
try:
|
|
320
313
|
proc = _sp.Popen(
|
|
@@ -919,9 +912,14 @@ _PTY_APPS = frozenset({
|
|
|
919
912
|
|
|
920
913
|
def _is_pty_cmd(cmd: str) -> bool:
|
|
921
914
|
"""Return True if cmd should run in PTY mode (TUI / interactive app)."""
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
915
|
+
parts = cmd.strip().lstrip("\\").split()
|
|
916
|
+
if not parts:
|
|
917
|
+
return False
|
|
918
|
+
first = parts[0].split("/")[-1]
|
|
919
|
+
# Commands with -c, -e, or file arguments are batch scripts, NOT interactive TUI sessions
|
|
920
|
+
if first in ("python", "python3", "ipython", "node", "ruby", "perl"):
|
|
921
|
+
if len(parts) > 1 and (parts[1] in ("-c", "-e") or not parts[1].startswith("-")):
|
|
922
|
+
return False
|
|
925
923
|
return first in _PTY_APPS
|
|
926
924
|
|
|
927
925
|
|
|
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
|