machineconfig 6.37__py3-none-any.whl → 6.38__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.
Potentially problematic release.
This version of machineconfig might be problematic. Click here for more details.
- machineconfig/scripts/python/cloud.py +5 -0
- machineconfig/scripts/python/cloud_helpers/cloud_sync.py +4 -4
- machineconfig/scripts/python/croshell.py +18 -6
- machineconfig/scripts/python/devops.py +4 -0
- machineconfig/scripts/python/devops_helpers/cli_repos.py +5 -5
- machineconfig/scripts/python/devops_helpers/cli_utils.py +79 -0
- machineconfig/scripts/python/repos_helpers/action.py +6 -6
- machineconfig/scripts/python/repos_helpers/entrypoint.py +1 -2
- machineconfig/utils/files/art/fat_croco.txt +10 -0
- machineconfig/utils/files/art/halfwit_croco.txt +9 -0
- machineconfig/utils/files/art/happy_croco.txt +22 -0
- machineconfig/utils/files/art/water_croco.txt +11 -0
- machineconfig/utils/files/headers.py +4 -10
- machineconfig/utils/installer_utils/installer_abc.py +3 -2
- {machineconfig-6.37.dist-info → machineconfig-6.38.dist-info}/METADATA +1 -1
- {machineconfig-6.37.dist-info → machineconfig-6.38.dist-info}/RECORD +19 -14
- {machineconfig-6.37.dist-info → machineconfig-6.38.dist-info}/WHEEL +0 -0
- {machineconfig-6.37.dist-info → machineconfig-6.38.dist-info}/entry_points.txt +0 -0
- {machineconfig-6.37.dist-info → machineconfig-6.38.dist-info}/top_level.txt +0 -0
|
@@ -73,8 +73,8 @@ def main(
|
|
|
73
73
|
cmd_line = f"{rclone_cmd[:65]}..."
|
|
74
74
|
console.print(Panel(f"{title}\n{cmd_line}", title="[bold blue]Command[/bold blue]", expand=False))
|
|
75
75
|
|
|
76
|
-
#
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
76
|
+
# import subprocess
|
|
77
|
+
# subprocess.run(txt, shell=True, check=True)
|
|
78
|
+
from machineconfig.utils.code import run_shell_script
|
|
79
|
+
run_shell_script(txt)
|
|
80
80
|
|
|
@@ -10,9 +10,10 @@ from machineconfig.utils.path_extended import PathExtended
|
|
|
10
10
|
from machineconfig.utils.accessories import randstr
|
|
11
11
|
|
|
12
12
|
from machineconfig.utils.options import choose_from_options
|
|
13
|
-
# from machineconfig.utils.ve import get_ve_activate_line
|
|
14
13
|
from rich.console import Console
|
|
15
14
|
from rich.panel import Panel
|
|
15
|
+
# from machineconfig.utils.ve import get_ve_path_and_ipython_profile
|
|
16
|
+
# from pathlib import Path
|
|
16
17
|
# from rich.text import Text
|
|
17
18
|
|
|
18
19
|
console = Console()
|
|
@@ -63,10 +64,11 @@ except Exception as e:
|
|
|
63
64
|
|
|
64
65
|
|
|
65
66
|
def croshell(
|
|
66
|
-
path: Annotated[Optional[str], typer.Argument(help="
|
|
67
|
+
path: Annotated[Optional[str], typer.Argument(help="path of file to read.")] = "",
|
|
67
68
|
python: Annotated[bool, typer.Option("--python", "-p", help="flag to use python over IPython.")] = False,
|
|
68
69
|
profile: Annotated[Optional[str], typer.Option("--profile", "-P", help="ipython profile to use, defaults to default profile.")] = None,
|
|
69
70
|
jupyter: Annotated[bool, typer.Option("--jupyter", "-j", help="run in jupyter interactive console")] = False,
|
|
71
|
+
vscode: Annotated[bool, typer.Option("--vscode", "-c", help="open the script in vscode")] = False,
|
|
70
72
|
streamlit_viewer: Annotated[bool, typer.Option("--stViewer", "-s", help="view in streamlit app")] = False,
|
|
71
73
|
visidata: Annotated[bool, typer.Option("--visidata", "-V", help="open data file in visidata")] = False,
|
|
72
74
|
local: Annotated[bool, typer.Option("--local", "-l", help="run in local mode, not in virtual env.")]= False,
|
|
@@ -104,7 +106,6 @@ def croshell(
|
|
|
104
106
|
program = get_read_data_pycode(str(file_obj))
|
|
105
107
|
text = f"📄 Reading data from: {file_obj.name}"
|
|
106
108
|
console.print(Panel(text, title="[bold blue]Info[/bold blue]"))
|
|
107
|
-
|
|
108
109
|
else: # if nothing is specified, then run in interactive mode.
|
|
109
110
|
text = "⌨️ Entering interactive mode"
|
|
110
111
|
console.print(Panel(text, title="[bold blue]Info[/bold blue]"))
|
|
@@ -124,7 +125,7 @@ from pathlib import Path
|
|
|
124
125
|
|
|
125
126
|
"""
|
|
126
127
|
|
|
127
|
-
pyfile = PathExtended.tmp().joinpath(f"tmp_scripts/python/croshell/{randstr()}.py")
|
|
128
|
+
pyfile = PathExtended.tmp().joinpath(f"tmp_scripts/python/croshell/{randstr()}/script.py")
|
|
128
129
|
pyfile.parent.mkdir(parents=True, exist_ok=True)
|
|
129
130
|
|
|
130
131
|
title = "Reading Data"
|
|
@@ -137,7 +138,16 @@ from pathlib import Path
|
|
|
137
138
|
if visidata:
|
|
138
139
|
fire_line = f"uv run --with visidata,pyarrow vd {str(file_obj)}"
|
|
139
140
|
elif jupyter:
|
|
140
|
-
fire_line = f"
|
|
141
|
+
fire_line = f"uv run --with 'machineconfig[plot]>=6.36' jupyter-lab {str(pyfile)}"
|
|
142
|
+
elif vscode:
|
|
143
|
+
fire_line = f"""
|
|
144
|
+
cd {str(pyfile.parent)}
|
|
145
|
+
uv init --python 3.14
|
|
146
|
+
uv venv
|
|
147
|
+
uv add "machineconfig[plot]>=6.36"
|
|
148
|
+
# code serve-web
|
|
149
|
+
code --new-window {str(pyfile)}
|
|
150
|
+
"""
|
|
141
151
|
else:
|
|
142
152
|
if interpreter == "ipython": profile = f" --profile {ipython_profile} --no-banner"
|
|
143
153
|
else: profile = ""
|
|
@@ -150,7 +160,9 @@ from pathlib import Path
|
|
|
150
160
|
console.print(Panel("❌ Could not determine the local machineconfig repo root. Please ensure the `REPO_ROOT` in `source_of_truth.py` is correctly set to the local path of the machineconfig repo, or do not use the `--local` flag.", title="Error", border_style="red"))
|
|
151
161
|
return
|
|
152
162
|
else: ve_line = """--with "machineconfig[plot]>=6.36" """
|
|
153
|
-
|
|
163
|
+
# ve_path_maybe, ipython_profile_maybe = get_ve_path_and_ipython_profile(Path.cwd())
|
|
164
|
+
# --python 3.14
|
|
165
|
+
fire_line = f"uv run {ve_line} {interpreter} {interactivity} {profile} {str(pyfile)}"
|
|
154
166
|
|
|
155
167
|
from machineconfig.utils.code import run_shell_script
|
|
156
168
|
run_shell_script(fire_line, clean_env=False)
|
|
@@ -8,6 +8,7 @@ import machineconfig.scripts.python.devops_helpers.cli_config as cli_config
|
|
|
8
8
|
import machineconfig.scripts.python.devops_helpers.cli_self as cli_self
|
|
9
9
|
import machineconfig.scripts.python.devops_helpers.cli_data as cli_data
|
|
10
10
|
import machineconfig.scripts.python.devops_helpers.cli_nw as cli_network
|
|
11
|
+
from machineconfig.scripts.python.devops_helpers.cli_utils import get_app as get_app_utils
|
|
11
12
|
|
|
12
13
|
|
|
13
14
|
def install(which: Annotated[Optional[str], typer.Argument(..., help="Comma-separated list of program names to install, or group name if --group flag is set.")] = None,
|
|
@@ -39,6 +40,9 @@ def get_app():
|
|
|
39
40
|
app_nw = cli_network.get_app()
|
|
40
41
|
app.add_typer(app_nw, name="network")
|
|
41
42
|
app.add_typer(app_nw, name="n", hidden=True)
|
|
43
|
+
app_utils = get_app_utils()
|
|
44
|
+
app.add_typer(app_utils, name="utils")
|
|
45
|
+
app.add_typer(app_utils, name="u", hidden=True)
|
|
42
46
|
return app
|
|
43
47
|
|
|
44
48
|
def main():
|
|
@@ -20,27 +20,27 @@ CloudOption = Annotated[Optional[str], typer.Option("--cloud", "-c", help="☁
|
|
|
20
20
|
def push(directory: DirectoryArgument = None, recursive: RecursiveOption = False, no_sync: NoSyncOption = False) -> None:
|
|
21
21
|
"""🚀 Push changes across repositories."""
|
|
22
22
|
from machineconfig.scripts.python.repos_helpers.entrypoint import git_operations
|
|
23
|
-
git_operations(directory, pull=False, commit=False, push=True, recursive=recursive,
|
|
23
|
+
git_operations(directory, pull=False, commit=False, push=True, recursive=recursive, auto_uv_sync=not no_sync)
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
def pull(directory: DirectoryArgument = None, recursive: RecursiveOption = False, no_sync: NoSyncOption = False) -> None:
|
|
27
27
|
"""⬇️ Pull changes across repositories."""
|
|
28
28
|
from machineconfig.scripts.python.repos_helpers.entrypoint import git_operations
|
|
29
29
|
|
|
30
|
-
git_operations(directory, pull=True, commit=False, push=False, recursive=recursive,
|
|
30
|
+
git_operations(directory, pull=True, commit=False, push=False, recursive=recursive, auto_uv_sync=not no_sync)
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
def commit(directory: DirectoryArgument = None, recursive: RecursiveOption = False, no_sync: NoSyncOption = False) -> None:
|
|
34
34
|
"""💾 Commit changes across repositories."""
|
|
35
35
|
from machineconfig.scripts.python.repos_helpers.entrypoint import git_operations
|
|
36
|
-
|
|
37
|
-
git_operations(directory, pull=False, commit=True, push=False, recursive=recursive, no_sync=no_sync)
|
|
36
|
+
git_operations(directory, pull=False, commit=True, push=False, recursive=recursive, auto_uv_sync=not no_sync)
|
|
38
37
|
|
|
39
38
|
|
|
40
39
|
def sync(directory: DirectoryArgument = None, recursive: RecursiveOption = False, no_sync: NoSyncOption = False) -> None:
|
|
41
40
|
"""🔄 Pull, commit, and push changes across repositories."""
|
|
42
41
|
from machineconfig.scripts.python.repos_helpers.entrypoint import git_operations
|
|
43
|
-
|
|
42
|
+
print(f"no_sync is {no_sync}")
|
|
43
|
+
git_operations(directory, pull=True, commit=True, push=True, recursive=recursive, auto_uv_sync=not no_sync)
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
def capture(directory: DirectoryArgument = None, cloud: CloudOption = None) -> None:
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
import typer
|
|
4
|
+
from typing import Annotated, Optional
|
|
5
|
+
from pathlib import Path
|
|
6
|
+
import subprocess
|
|
7
|
+
import requests
|
|
8
|
+
|
|
9
|
+
def download(url: Annotated[Optional[str], typer.Argument(..., help="The URL to download the file from." )] = None,
|
|
10
|
+
decompress: Annotated[bool, typer.Option("--decompress", "-d", help="Decompress the file if it's an archive.")] = False,
|
|
11
|
+
output: Annotated[Optional[str], typer.Option("--output", "-o", help="The output file path.")] = None) -> None:
|
|
12
|
+
if url is None:
|
|
13
|
+
typer.echo("❌ Error: URL is required.", err=True)
|
|
14
|
+
raise typer.Exit(code=1)
|
|
15
|
+
|
|
16
|
+
typer.echo(f"📥 Downloading from: {url}")
|
|
17
|
+
|
|
18
|
+
download_path = Path(output) if output else Path(url.split("/")[-1])
|
|
19
|
+
|
|
20
|
+
try:
|
|
21
|
+
response = requests.get(url, allow_redirects=True, stream=True, timeout=60)
|
|
22
|
+
response.raise_for_status()
|
|
23
|
+
|
|
24
|
+
total_size = int(response.headers.get('content-length', 0))
|
|
25
|
+
|
|
26
|
+
with open(download_path, 'wb') as f:
|
|
27
|
+
if total_size == 0:
|
|
28
|
+
f.write(response.content)
|
|
29
|
+
else:
|
|
30
|
+
downloaded = 0
|
|
31
|
+
chunk_size = 8192
|
|
32
|
+
for chunk in response.iter_content(chunk_size=chunk_size):
|
|
33
|
+
if chunk:
|
|
34
|
+
f.write(chunk)
|
|
35
|
+
downloaded += len(chunk)
|
|
36
|
+
progress = (downloaded / total_size) * 100
|
|
37
|
+
typer.echo(f"\r⏬ Progress: {progress:.1f}% ({downloaded}/{total_size} bytes)", nl=False)
|
|
38
|
+
typer.echo()
|
|
39
|
+
|
|
40
|
+
typer.echo(f"✅ Downloaded to: {download_path}")
|
|
41
|
+
except requests.exceptions.RequestException as e:
|
|
42
|
+
typer.echo(f"❌ Download failed: {e}", err=True)
|
|
43
|
+
raise typer.Exit(code=1)
|
|
44
|
+
except OSError as e:
|
|
45
|
+
typer.echo(f"❌ File write error: {e}", err=True)
|
|
46
|
+
raise typer.Exit(code=1)
|
|
47
|
+
|
|
48
|
+
if decompress:
|
|
49
|
+
typer.echo(f"📦 Decompressing: {download_path}")
|
|
50
|
+
|
|
51
|
+
output_dir = download_path.parent if output else Path.cwd()
|
|
52
|
+
|
|
53
|
+
try:
|
|
54
|
+
_result = subprocess.run(
|
|
55
|
+
["ouch", "decompress", str(download_path), "--dir", str(output_dir)],
|
|
56
|
+
check=True,
|
|
57
|
+
capture_output=True,
|
|
58
|
+
text=True
|
|
59
|
+
)
|
|
60
|
+
typer.echo(f"✅ Decompressed to: {output_dir}")
|
|
61
|
+
|
|
62
|
+
if download_path.exists():
|
|
63
|
+
download_path.unlink()
|
|
64
|
+
typer.echo(f"🗑️ Removed archive: {download_path}")
|
|
65
|
+
|
|
66
|
+
except subprocess.CalledProcessError as e:
|
|
67
|
+
typer.echo(f"❌ Decompression failed: {e.stderr}", err=True)
|
|
68
|
+
raise typer.Exit(code=1)
|
|
69
|
+
except FileNotFoundError:
|
|
70
|
+
typer.echo("❌ Error: ouch command not found. Please install ouch.", err=True)
|
|
71
|
+
typer.echo("💡 Install with: cargo install ouch", err=True)
|
|
72
|
+
raise typer.Exit(code=1)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
def get_app() -> typer.Typer:
|
|
76
|
+
app = typer.Typer(help="🛠️ [u] utilities operations", no_args_is_help=True, add_completion=True)
|
|
77
|
+
app.command(name="download", no_args_is_help=True, help="[d] Download a file from a URL and optionally decompress it.")(download)
|
|
78
|
+
app.command(name="d", no_args_is_help=True, hidden=True)(download)
|
|
79
|
+
return app
|
|
@@ -57,7 +57,7 @@ class GitOperationSummary:
|
|
|
57
57
|
self.repos_without_remotes: list[PathExtended] = []
|
|
58
58
|
|
|
59
59
|
|
|
60
|
-
def git_action(path: PathExtended, action: GitAction, mess: Optional[str]
|
|
60
|
+
def git_action(path: PathExtended, action: GitAction, mess: Optional[str], r: bool, auto_uv_sync: bool) -> GitOperationResult:
|
|
61
61
|
"""Perform git actions using Python instead of shell scripts. Returns detailed operation result."""
|
|
62
62
|
from git.exc import InvalidGitRepositoryError
|
|
63
63
|
from git.repo import Repo
|
|
@@ -67,7 +67,7 @@ def git_action(path: PathExtended, action: GitAction, mess: Optional[str] = None
|
|
|
67
67
|
except InvalidGitRepositoryError:
|
|
68
68
|
pprint(f"⚠️ Skipping {path} because it is not a git repository.")
|
|
69
69
|
if r:
|
|
70
|
-
results = [git_action(path=sub_path, action=action, mess=mess, r=r,
|
|
70
|
+
results = [git_action(path=sub_path, action=action, mess=mess, r=r, auto_uv_sync=auto_uv_sync) for sub_path in path.search()]
|
|
71
71
|
# For recursive calls, we need to aggregate results somehow
|
|
72
72
|
# For now, return success if all recursive operations succeeded
|
|
73
73
|
all_successful = all(result.success for result in results)
|
|
@@ -154,7 +154,7 @@ def git_action(path: PathExtended, action: GitAction, mess: Optional[str] = None
|
|
|
154
154
|
elif action == GitAction.pull:
|
|
155
155
|
# Use the enhanced update function with uv sync support
|
|
156
156
|
try:
|
|
157
|
-
update_repository(repo, auto_uv_sync=
|
|
157
|
+
update_repository(repo, auto_uv_sync=auto_uv_sync, allow_password_prompt=False)
|
|
158
158
|
print("✅ Pull completed")
|
|
159
159
|
return GitOperationResult(
|
|
160
160
|
repo_path=path,
|
|
@@ -341,7 +341,7 @@ def perform_git_operations(repos_root: PathExtended, pull: bool, commit: bool, p
|
|
|
341
341
|
|
|
342
342
|
# Now perform the actual operations
|
|
343
343
|
if pull:
|
|
344
|
-
result = git_action(path=a_path, action=GitAction.pull, r=recursive,
|
|
344
|
+
result = git_action(path=a_path, action=GitAction.pull, mess=None, r=recursive, auto_uv_sync=auto_uv_sync)
|
|
345
345
|
summary.pulls_attempted += 1
|
|
346
346
|
if result.success:
|
|
347
347
|
summary.pulls_successful += 1
|
|
@@ -350,7 +350,7 @@ def perform_git_operations(repos_root: PathExtended, pull: bool, commit: bool, p
|
|
|
350
350
|
summary.failed_operations.append(result)
|
|
351
351
|
|
|
352
352
|
if commit:
|
|
353
|
-
result = git_action(a_path, action=GitAction.commit, r=recursive,
|
|
353
|
+
result = git_action(a_path, action=GitAction.commit, mess=None, r=recursive, auto_uv_sync=auto_uv_sync)
|
|
354
354
|
summary.commits_attempted += 1
|
|
355
355
|
if result.success:
|
|
356
356
|
if result.had_changes:
|
|
@@ -362,7 +362,7 @@ def perform_git_operations(repos_root: PathExtended, pull: bool, commit: bool, p
|
|
|
362
362
|
summary.failed_operations.append(result)
|
|
363
363
|
|
|
364
364
|
if push:
|
|
365
|
-
result = git_action(a_path, action=GitAction.push, r=recursive,
|
|
365
|
+
result = git_action(a_path, action=GitAction.push, mess=None, r=recursive, auto_uv_sync=auto_uv_sync)
|
|
366
366
|
summary.pushes_attempted += 1
|
|
367
367
|
if result.success:
|
|
368
368
|
summary.pushes_successful += 1
|
|
@@ -20,11 +20,10 @@ def git_operations(
|
|
|
20
20
|
commit: bool,
|
|
21
21
|
push: bool,
|
|
22
22
|
recursive: bool,
|
|
23
|
-
|
|
23
|
+
auto_uv_sync: bool,
|
|
24
24
|
) -> None:
|
|
25
25
|
|
|
26
26
|
repos_root = resolve_directory(directory)
|
|
27
|
-
auto_uv_sync = not no_sync
|
|
28
27
|
from machineconfig.scripts.python.repos_helpers.action import perform_git_operations
|
|
29
28
|
from machineconfig.utils.path_extended import PathExtended
|
|
30
29
|
perform_git_operations(
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
_ ___ /^^\ /^\ /^^\_
|
|
2
|
+
_ _@)@) \ ,,/ '` ~ `'~~ ', `\.
|
|
3
|
+
_/o\_ _ _ _/~`.`...'~\ ./~~..,'`','',.,' ' ~:
|
|
4
|
+
/ `,'.~,~.~ . , . , ~|, ,/ .,' , ,. .. ,,. `, ~\_
|
|
5
|
+
( ' _' _ '_` _ ' . , `\_/ .' ..' ' ` ` `.. `, \_
|
|
6
|
+
~V~ V~ V~ V~ ~\ ` ' . ' , ' .,.,''`.,.''`.,.``. ', \_
|
|
7
|
+
_/\ /\ /\ /\_/, . ' , `_/~\_ .' .,. ,, , _/~\_ `. `. '., \_
|
|
8
|
+
< ~ ~ '~`'~'`, ., . `_: ::: \_ ' `_/ ::: \_ `.,' . ', \_
|
|
9
|
+
\ ' `_ '`_ _ ',/ _::_::_ \ _ _/ _::_::_ \ `.,'.,`., \-,-,-,_,_,
|
|
10
|
+
`'~~ `'~~ `'~~ `'~~ \(_)(_)(_)/ `~~' \(_)(_)(_)/ ~'`\_.._,._,'_;_;_;_;_;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
.--. .--.
|
|
2
|
+
/ \/ \
|
|
3
|
+
| .-. .-. \
|
|
4
|
+
|/_ |/_ | \
|
|
5
|
+
|| `\|| `\| `----.
|
|
6
|
+
|\0_/ \0_/ --, \_
|
|
7
|
+
.--"""""-. / (` \ `-.
|
|
8
|
+
/ \-----'-. \ \
|
|
9
|
+
\ () () /`\ \
|
|
10
|
+
| .___.-' | \
|
|
11
|
+
\ /` \| / ;
|
|
12
|
+
`-.___ ___.' .-.`.---.| \
|
|
13
|
+
\| ``-..___,.-'`\| / / / | `\
|
|
14
|
+
` \| ,`/ / / , /
|
|
15
|
+
` |\ / / |\/
|
|
16
|
+
, .'`-; ' \/
|
|
17
|
+
, |\-' .' , .-'`
|
|
18
|
+
.-|\--;`` .-' |\.'
|
|
19
|
+
( `"'-.|\ (___,.--'`'
|
|
20
|
+
`-. `"` _.--'
|
|
21
|
+
`. _.-'`-.
|
|
22
|
+
`''---''`` `."
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
_.---._ .---.
|
|
2
|
+
__...---' .---. `---'-. `.
|
|
3
|
+
~ -~ -.-''__.--' _.'( | )`. `. `._ :
|
|
4
|
+
-.~~ .'__-'_ .--'' ._`---'_.-. `. `-`.
|
|
5
|
+
~ ~_~-~-~_ ~ -._ -._``---. -. `-._ `.
|
|
6
|
+
~- ~ ~ -_ -~ ~ -.._ _ _ _ ..-_ `. `-._``--.._
|
|
7
|
+
~~-~ ~-_ _~ ~-~ ~ -~ _~~_-~ -._ `-. -. `-._``--.._.--''. ~ -~_
|
|
8
|
+
~~ -~_-~ _~- _~~ _~-_~ ~-_~~ ~-.___ -._ `-.__ `. `. ~ -_~
|
|
9
|
+
~~ _~- ~~- -_~ ~- ~ - _~~- _~~ ~---...__ _ ._ .` `. ~-_~
|
|
10
|
+
~ ~- _~~- _-_~ ~-_ ~-~ ~_-~ _~- ~_~-_~ ~--.....--~ -~_ ~
|
|
11
|
+
~ ~ - ~ ~ ~~ - ~~- ~~- ~- ~ -~ ~ ~ -~~- ~- ~-~
|
|
@@ -6,7 +6,6 @@ import random
|
|
|
6
6
|
from pathlib import Path
|
|
7
7
|
from rich import pretty
|
|
8
8
|
from rich.console import Console
|
|
9
|
-
from typing import Optional
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
def print_header():
|
|
@@ -38,18 +37,13 @@ def print_logo(logo: str):
|
|
|
38
37
|
if random.choice([True, True, False]): font_box_color(logo)
|
|
39
38
|
else: character_color(logo)
|
|
40
39
|
else:
|
|
41
|
-
print("\n" + "🚫 " + "-" * 70 + " 🚫")
|
|
42
|
-
print("🔍 Missing ASCII art dependencies. Install with: iwr bit.ly/cfgasciiartwindows | iex")
|
|
43
|
-
print("🚫 " + "-" * 70 + " 🚫\n")
|
|
40
|
+
# print("\n" + "🚫 " + "-" * 70 + " 🚫")
|
|
41
|
+
# print("🔍 Missing ASCII art dependencies. Install with: iwr bit.ly/cfgasciiartwindows | iex")
|
|
42
|
+
# print("🚫 " + "-" * 70 + " 🚫\n")
|
|
44
43
|
_default_art = Path(random.choice(glob.glob(str(Path(__file__).parent.joinpath("art", "*")))))
|
|
45
44
|
print(_default_art.read_text())
|
|
46
45
|
elif platform.system() in ["Linux", "Darwin"]: # Explicitly handle both Linux and macOS
|
|
47
|
-
|
|
48
|
-
path_dirs = os.environ['PATH'].split(os.pathsep)
|
|
49
|
-
for path_dir in path_dirs:
|
|
50
|
-
path_to_executable = os.path.join(path_dir, executable_name)
|
|
51
|
-
if os.path.isfile(path_to_executable) and os.access(path_to_executable, os.X_OK): return path_to_executable
|
|
52
|
-
return None
|
|
46
|
+
from machineconfig.utils.installer_utils.installer_abc import is_executable_in_path
|
|
53
47
|
avail_cowsay = is_executable_in_path("cowsay")
|
|
54
48
|
avail_lolcat = is_executable_in_path("lolcat")
|
|
55
49
|
avail_boxes = is_executable_in_path("boxes")
|
|
@@ -141,11 +141,12 @@ def check_tool_exists(tool_name: str) -> bool:
|
|
|
141
141
|
return npm_check
|
|
142
142
|
else:
|
|
143
143
|
raise NotImplementedError(f"platform {platform.system()} not implemented")
|
|
144
|
-
|
|
144
|
+
|
|
145
|
+
def is_executable_in_path(name: str) -> bool:
|
|
145
146
|
import os
|
|
146
147
|
path_dirs = os.environ['PATH'].split(os.pathsep)
|
|
147
148
|
for path_dir in path_dirs:
|
|
148
|
-
path_to_executable = os.path.join(path_dir,
|
|
149
|
+
path_to_executable = os.path.join(path_dir, name)
|
|
149
150
|
if os.path.isfile(path_to_executable) and os.access(path_to_executable, os.X_OK): return True
|
|
150
151
|
return False
|
|
151
152
|
|
|
@@ -121,9 +121,9 @@ machineconfig/scripts/linux/other/start_docker,sha256=_yDN_PPqgzSUnPT7dmniMTpL4I
|
|
|
121
121
|
machineconfig/scripts/linux/other/switch_ip,sha256=NQfeKMBSbFY3eP6M-BadD-TQo5qMP96DTp77KHk2tU8,613
|
|
122
122
|
machineconfig/scripts/python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
123
123
|
machineconfig/scripts/python/agents.py,sha256=f5UxgXjGlEypoNFqK0uHKO0UkbV_wUmPiPzotL2yapM,10677
|
|
124
|
-
machineconfig/scripts/python/cloud.py,sha256=
|
|
125
|
-
machineconfig/scripts/python/croshell.py,sha256=
|
|
126
|
-
machineconfig/scripts/python/devops.py,sha256=
|
|
124
|
+
machineconfig/scripts/python/cloud.py,sha256=jwftTQGhIP39wIKHB1lQbcbmo2dMnWoTcs-Wly3Ql5U,1263
|
|
125
|
+
machineconfig/scripts/python/croshell.py,sha256=9tNsAtPxAiq3i9smFBPXenDjRXZRjudXN4DQabXvBvo,7562
|
|
126
|
+
machineconfig/scripts/python/devops.py,sha256=NMiGkw5w3svn7mgxkfCd9jTiVlqQp6GglU8BmclYBQ8,2393
|
|
127
127
|
machineconfig/scripts/python/devops_navigator.py,sha256=4O9_-ACeP748NcMjWQXZF7mBQpMPxqCGhLvPG3DMi4Q,236
|
|
128
128
|
machineconfig/scripts/python/entry.py,sha256=Az7dK1eXHGW5l46Yg10Cd88VChCdhvLAzO3e1A3r56A,2176
|
|
129
129
|
machineconfig/scripts/python/fire_jobs.py,sha256=O5DrckUGLxGblOcLf_iXU31pmCSpTg-c0hQZxQKD1os,13591
|
|
@@ -164,7 +164,7 @@ machineconfig/scripts/python/cloud_helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW
|
|
|
164
164
|
machineconfig/scripts/python/cloud_helpers/cloud_copy.py,sha256=qh96_QWxsaRPpgLDZaMPIUyHfkr1dTMb2bwvalY_kiA,8691
|
|
165
165
|
machineconfig/scripts/python/cloud_helpers/cloud_helpers.py,sha256=GA-bxXouUmknk9fyQAsPT-Xl3RG9-yBed71a2tu9Pig,4914
|
|
166
166
|
machineconfig/scripts/python/cloud_helpers/cloud_mount.py,sha256=DEZHwOgFcAVoI-NrBflFLbAjijOYZYq_D5M8xJQdtSQ,6487
|
|
167
|
-
machineconfig/scripts/python/cloud_helpers/cloud_sync.py,sha256
|
|
167
|
+
machineconfig/scripts/python/cloud_helpers/cloud_sync.py,sha256=0HYhr60U-pAfFucgmJ2TtEB7CkeDMNufi0QcpS9VdIQ,3481
|
|
168
168
|
machineconfig/scripts/python/cloud_helpers/helpers2.py,sha256=aPGz_3WqZJaqmn_bGMtFFmDlLytnOS5KWacZMgXTDJw,7310
|
|
169
169
|
machineconfig/scripts/python/cloud_helpers/helpers5.py,sha256=dPBvA9Tcyx9TMgM6On49A1CueGMhBdRzikDnlJGf3J0,1123
|
|
170
170
|
machineconfig/scripts/python/croshell_helpers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -178,10 +178,11 @@ machineconfig/scripts/python/devops_helpers/cli_config.py,sha256=B48SZzei0WG04Gq
|
|
|
178
178
|
machineconfig/scripts/python/devops_helpers/cli_config_dotfile.py,sha256=rjTys4FNf9_feP9flWM7Zvq17dxWmetSiGaHPxp25nk,2737
|
|
179
179
|
machineconfig/scripts/python/devops_helpers/cli_data.py,sha256=2OWwp86-ncpGoSP9IblW7Jjej-wc-PuS8KRZ5xh0l1c,1774
|
|
180
180
|
machineconfig/scripts/python/devops_helpers/cli_nw.py,sha256=1slGev50V3sHlVSt6mnFSV9faIzrnvtwXmJxnCnVJJ0,4131
|
|
181
|
-
machineconfig/scripts/python/devops_helpers/cli_repos.py,sha256=
|
|
181
|
+
machineconfig/scripts/python/devops_helpers/cli_repos.py,sha256=DzOyxN-IFNT-LT7tJumHGqasJ5hVjTcrpSoBDD65ywA,12401
|
|
182
182
|
machineconfig/scripts/python/devops_helpers/cli_self.py,sha256=iMHmfK1uIXot9hbM44Ocy8jr5_QgayrO7SvQ8PMIL2E,5739
|
|
183
183
|
machineconfig/scripts/python/devops_helpers/cli_share_server.py,sha256=q9pFJ6AxPuygMr3onMNOKEuuQHbVE_6Qoyo7xRT5FX0,4196
|
|
184
184
|
machineconfig/scripts/python/devops_helpers/cli_terminal.py,sha256=k_PzXaiGyE0vXr0Ii1XcJz2A7UvyPJrR31TRWt4RKRI,6019
|
|
185
|
+
machineconfig/scripts/python/devops_helpers/cli_utils.py,sha256=hxQ2dgHPPJjFOK6KnVy-2Mjg60YKalvbVFGiq3kqtRA,3300
|
|
185
186
|
machineconfig/scripts/python/devops_helpers/devops_backup_retrieve.py,sha256=8VpnWytbJYdZZfeLmULgGeGuV5BlHrzdcbGtSsmU-EA,5598
|
|
186
187
|
machineconfig/scripts/python/devops_helpers/devops_status.py,sha256=PJVPhfhXq8der6Xd-_fjZfnizfM-RGfJApkRGhGBmNo,20525
|
|
187
188
|
machineconfig/scripts/python/devops_helpers/devops_update_repos.py,sha256=TLYhvMMDJCqLNsv1h4a0MtxYqQHWkRRvKnERyXd8MAs,10133
|
|
@@ -238,11 +239,11 @@ machineconfig/scripts/python/nw/ssh_debug_linux.py,sha256=VSFhyzYQeLIoSwsUFJFW1W
|
|
|
238
239
|
machineconfig/scripts/python/nw/ssh_debug_windows.py,sha256=2prJs3PMsoAUu5LlZhHIKGVgqj7h6OviGEjAMJLJ7LI,29986
|
|
239
240
|
machineconfig/scripts/python/nw/wifi_conn.py,sha256=4GdLhgma9GRmZ6OFg3oxOX-qY3sr45njPckozlpM_A0,15566
|
|
240
241
|
machineconfig/scripts/python/nw/wsl_windows_transfer.py,sha256=1ab9l-8MtAxofW5nGH9G2-BjlszaiLETu6WBECcNNhA,3546
|
|
241
|
-
machineconfig/scripts/python/repos_helpers/action.py,sha256=
|
|
242
|
+
machineconfig/scripts/python/repos_helpers/action.py,sha256=M1Col8F4JEc20FCPSiELQ3PckbOL6i7YpxzfuAEtmSc,14894
|
|
242
243
|
machineconfig/scripts/python/repos_helpers/clone.py,sha256=UULEG5xJuXlPGU0nqXH6U45jA9DOFqLw8B4iPytCwOQ,5471
|
|
243
244
|
machineconfig/scripts/python/repos_helpers/count_lines.py,sha256=Q5c7b-DxvTlQmljoic7niTuiAVyFlwYvkVQ7uRJHiTo,16009
|
|
244
245
|
machineconfig/scripts/python/repos_helpers/count_lines_frontend.py,sha256=SBVtfnL_EkBiN2GhgFHPOgBUXjWe5xtqB1bXyhM-f0M,607
|
|
245
|
-
machineconfig/scripts/python/repos_helpers/entrypoint.py,sha256=
|
|
246
|
+
machineconfig/scripts/python/repos_helpers/entrypoint.py,sha256=O6ges-eMnXroIi14PszUWGD1-ITP4T0x7hk060rFT1k,2810
|
|
246
247
|
machineconfig/scripts/python/repos_helpers/record.py,sha256=FQo0swuJZOp0I2XGK-t1OQU4zJHmQ2z9zTpDD30Tmg4,11001
|
|
247
248
|
machineconfig/scripts/python/repos_helpers/sync.py,sha256=CLLWy2n2gY9beXPF-mblOQ6R7cKoenkJjMiX7tHQsBk,3091
|
|
248
249
|
machineconfig/scripts/python/repos_helpers/update.py,sha256=cUIMUMm-50HrY6fzxSMZnFplhToVjVPZMm1j_otTha4,11060
|
|
@@ -408,22 +409,26 @@ machineconfig/utils/cloud/onedrive/setup_oauth.py,sha256=ZTVkqgrwbV_EoPvyT8dyOTU
|
|
|
408
409
|
machineconfig/utils/cloud/onedrive/transaction.py,sha256=m-aNcnWj_gfZVvJOSpkdIqjZxU_3nXx2CA-qKbQgP3I,26232
|
|
409
410
|
machineconfig/utils/files/ascii_art.py,sha256=cNJaJC07vx94fS44-tzgfbfBeCwXVrgpnWGBLUnfC38,5212
|
|
410
411
|
machineconfig/utils/files/dbms.py,sha256=B7Mns8g774kfeXZwcuGWUpRnSgiOtS6khn8faRH5rQs,11390
|
|
411
|
-
machineconfig/utils/files/headers.py,sha256=
|
|
412
|
+
machineconfig/utils/files/headers.py,sha256=E5wBiGcGxKcDkvg0tjz8gIQ3Gyw4m6d0miG2WQ1Vscw,3388
|
|
412
413
|
machineconfig/utils/files/read.py,sha256=QDxLEIYi0NcgAys97IVB6IUl4S9CiFP6TKGxUxRBJOM,4330
|
|
414
|
+
machineconfig/utils/files/art/fat_croco.txt,sha256=Gz-qK0YZT4pnPA16hlsCVZN3HrBAPW_1hEv3IZTy01Q,637
|
|
415
|
+
machineconfig/utils/files/art/halfwit_croco.txt,sha256=To3-lWfcnonx2Ap71lVYyJ6PTK04G78L3uCM10-hCRk,437
|
|
416
|
+
machineconfig/utils/files/art/happy_croco.txt,sha256=VwuSikjKVmdc_Kvd0IyclxVOYo1v4ZBaD_i1XOv7hRo,967
|
|
417
|
+
machineconfig/utils/files/art/water_croco.txt,sha256=5SPK6W3TQe6mO9eFbDIZ4n1rNAjVbfEfQEQOMsf0rQ8,623
|
|
413
418
|
machineconfig/utils/files/ouch/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
414
419
|
machineconfig/utils/files/ouch/decompress.py,sha256=7qPaEkMerBBXzeZyFn8hLODHZJv1aty-yGgwBxLgVys,1413
|
|
415
420
|
machineconfig/utils/installer_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
416
421
|
machineconfig/utils/installer_utils/github_release_bulk.py,sha256=WJf_qZlF02SmIc6C7o1h4Gy4gAaJAfeAS8O9s2Itj-k,6535
|
|
417
422
|
machineconfig/utils/installer_utils/installer.py,sha256=aqoAUv2gQoiIrg9ErxLh_kZWyFk3dOL4HEVxXEyAmW4,11178
|
|
418
|
-
machineconfig/utils/installer_utils/installer_abc.py,sha256=
|
|
423
|
+
machineconfig/utils/installer_utils/installer_abc.py,sha256=cXNDIhq1itdGUCxososxfJo029eMlVOj6hu8GY22gC4,11672
|
|
419
424
|
machineconfig/utils/installer_utils/installer_class.py,sha256=apLMLmpZfHbj4I5ttgwg0ZIp66B5vx2nPtuhEobGdWM,17186
|
|
420
425
|
machineconfig/utils/schemas/fire_agents/fire_agents_input.py,sha256=Xbi59rU35AzR7HZZ8ZQ8aUu_FjSgijNqc8Sme0rCk2Y,2050
|
|
421
426
|
machineconfig/utils/schemas/installer/installer_types.py,sha256=QClRY61QaduBPJoSpdmTIdgS9LS-RvE-QZ-D260tD3o,1214
|
|
422
427
|
machineconfig/utils/schemas/layouts/layout_types.py,sha256=TcqlZdGVoH8htG5fHn1KWXhRdPueAcoyApppZsPAPto,2020
|
|
423
428
|
machineconfig/utils/schemas/repos/repos_types.py,sha256=ECVr-3IVIo8yjmYmVXX2mnDDN1SLSwvQIhx4KDDQHBQ,405
|
|
424
429
|
machineconfig/utils/ssh_utils/utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
425
|
-
machineconfig-6.
|
|
426
|
-
machineconfig-6.
|
|
427
|
-
machineconfig-6.
|
|
428
|
-
machineconfig-6.
|
|
429
|
-
machineconfig-6.
|
|
430
|
+
machineconfig-6.38.dist-info/METADATA,sha256=6e6Ug8k0c-VCksk17REAfgAGp_aGkxYune9TgFCbC5U,2928
|
|
431
|
+
machineconfig-6.38.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
432
|
+
machineconfig-6.38.dist-info/entry_points.txt,sha256=M0jwN_brZdXWhmNVeXLvdKxfkv8WhhXFZYcuKBA9qnk,418
|
|
433
|
+
machineconfig-6.38.dist-info/top_level.txt,sha256=porRtB8qms8fOIUJgK-tO83_FeH6Bpe12oUVC670teA,14
|
|
434
|
+
machineconfig-6.38.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|