machineconfig 3.88__py3-none-any.whl → 3.89__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/jobs/python_generic_installers/config.json +1 -1
- machineconfig/jobs/python_linux_installers/config.json +1 -1
- machineconfig/scripts/python/devops.py +1 -1
- machineconfig/scripts/python/devops_devapps_install.py +4 -4
- machineconfig/utils/options.py +6 -6
- machineconfig/utils/path_extended.py +19 -19
- {machineconfig-3.88.dist-info → machineconfig-3.89.dist-info}/METADATA +1 -1
- {machineconfig-3.88.dist-info → machineconfig-3.89.dist-info}/RECORD +11 -11
- {machineconfig-3.88.dist-info → machineconfig-3.89.dist-info}/WHEEL +0 -0
- {machineconfig-3.88.dist-info → machineconfig-3.89.dist-info}/entry_points.txt +0 -0
- {machineconfig-3.88.dist-info → machineconfig-3.89.dist-info}/top_level.txt +0 -0
|
@@ -456,7 +456,7 @@
|
|
|
456
456
|
},
|
|
457
457
|
{
|
|
458
458
|
"appName": "starship",
|
|
459
|
-
"repoURL": "starship/starship",
|
|
459
|
+
"repoURL": "https://github.com/starship/starship",
|
|
460
460
|
"doc": "⭐️ The minimal, blazing-fast, and infinitely customizable prompt for any shell!",
|
|
461
461
|
"filenameTemplate": {
|
|
462
462
|
"amd64": {
|
|
@@ -28,7 +28,7 @@ def main(which: Optional[Options] = None):
|
|
|
28
28
|
options = options_list
|
|
29
29
|
if which is None:
|
|
30
30
|
try:
|
|
31
|
-
choice_key = choose_from_options(msg="", options=options, header="🛠️ DEVOPS", default=options[0], multi=False)
|
|
31
|
+
choice_key = choose_from_options(msg="", options=options, header="🛠️ DEVOPS", default=options[0], multi=False, fzf=False)
|
|
32
32
|
except KeyboardInterrupt:
|
|
33
33
|
console.print(Panel("❌ Operation cancelled by user", title_align="left", border_style="red", width=BOX_WIDTH))
|
|
34
34
|
return
|
|
@@ -53,8 +53,8 @@ def main(which: Annotated[Optional[str], typer.Argument(help=f"Choose a category
|
|
|
53
53
|
print(a_message)
|
|
54
54
|
return None
|
|
55
55
|
|
|
56
|
-
# interactive installation
|
|
57
|
-
installers = get_installers(system=system(), dev=
|
|
56
|
+
# interactive installation - get all installers including dev ones
|
|
57
|
+
installers = get_installers(system=system(), dev=True)
|
|
58
58
|
|
|
59
59
|
# Check installed programs with progress indicator
|
|
60
60
|
with Progress(SpinnerColumn(), TextColumn("[progress.description]{task.description}")) as progress:
|
|
@@ -66,7 +66,7 @@ def main(which: Annotated[Optional[str], typer.Argument(help=f"Choose a category
|
|
|
66
66
|
|
|
67
67
|
options += list(get_args(WHICH_CAT))
|
|
68
68
|
# print("s"*1000)
|
|
69
|
-
program_names = choose_from_options(multi=True, msg="", options=options, header="🚀 CHOOSE DEV APP", default="AllEssentials")
|
|
69
|
+
program_names = choose_from_options(multi=True, msg="", options=options, header="🚀 CHOOSE DEV APP", default="AllEssentials", fzf=True)
|
|
70
70
|
|
|
71
71
|
total_commands = ""
|
|
72
72
|
installation_messages: list[str] = []
|
|
@@ -119,7 +119,7 @@ def get_programs_by_category(program_name: WHICH_CAT):
|
|
|
119
119
|
options_system = {**options_system_1, **options_system_2}
|
|
120
120
|
else:
|
|
121
121
|
raise NotImplementedError(f"❌ System {system()} not supported")
|
|
122
|
-
program_names = choose_from_options(multi=True, msg="", options=sorted(list(options_system.keys())), header="🚀 CHOOSE DEV APP")
|
|
122
|
+
program_names = choose_from_options(multi=True, msg="", options=sorted(list(options_system.keys())), header="🚀 CHOOSE DEV APP", fzf=True)
|
|
123
123
|
program = ""
|
|
124
124
|
for name in program_names:
|
|
125
125
|
print(f"""
|
machineconfig/utils/options.py
CHANGED
|
@@ -51,13 +51,13 @@ def choose_from_options[T](msg: str, options: Iterable[T], multi: Literal[True],
|
|
|
51
51
|
def choose_from_options[T](msg: str, options: Iterable[T], multi: bool, custom_input: bool = True, header: str = "", tail: str = "", prompt: str = "", default: Optional[T] = None, fzf: bool = False, ) -> Union[T, list[T]]:
|
|
52
52
|
# TODO: replace with https://github.com/tmbo/questionary
|
|
53
53
|
# # also see https://github.com/charmbracelet/gum
|
|
54
|
-
tool_name = "fzf"
|
|
55
54
|
options_strings: list[str] = [str(x) for x in options]
|
|
56
55
|
default_string = str(default) if default is not None else None
|
|
57
56
|
console = Console()
|
|
58
|
-
|
|
57
|
+
fzf_exists = check_tool_exists("fzf")
|
|
58
|
+
# print("\n" * 10, f"{fzf=}, {fzf_exists=}", "\n" * 10)
|
|
59
|
+
if fzf and fzf_exists:
|
|
59
60
|
from pyfzf.pyfzf import FzfPrompt
|
|
60
|
-
|
|
61
61
|
fzf_prompt = FzfPrompt()
|
|
62
62
|
nl = "\n"
|
|
63
63
|
choice_string_multi: list[str] = fzf_prompt.prompt(choices=options_strings, fzf_options=("--multi" if multi else "") + f' --prompt "{prompt.replace(nl, " ")}" ') # --border-label={msg.replace(nl, ' ')}")
|
|
@@ -86,9 +86,9 @@ def choose_from_options[T](msg: str, options: Iterable[T], multi: bool, custom_i
|
|
|
86
86
|
|
|
87
87
|
console.print(txt_panel)
|
|
88
88
|
if default is not None:
|
|
89
|
-
choice_string = input(f"{prompt}\nEnter option number or hit enter for default choice: ")
|
|
89
|
+
choice_string = input(f"{prompt}\nEnter option number/name or hit enter for default choice: ")
|
|
90
90
|
else:
|
|
91
|
-
choice_string = input(f"{prompt}\nEnter option number: ")
|
|
91
|
+
choice_string = input(f"{prompt}\nEnter option number/name: ")
|
|
92
92
|
|
|
93
93
|
if choice_string == "":
|
|
94
94
|
if default_string is None:
|
|
@@ -112,7 +112,7 @@ def choose_from_options[T](msg: str, options: Iterable[T], multi: bool, custom_i
|
|
|
112
112
|
# raise ValueError(f"Unknown choice. {choice_string}") from ie
|
|
113
113
|
console.print(Panel(f"❓ Unknown choice: '{choice_string}'", title="Error", expand=False))
|
|
114
114
|
return choose_from_options(msg=msg, options=options, header=header, tail=tail, prompt=prompt, default=default, fzf=fzf, multi=multi, custom_input=custom_input)
|
|
115
|
-
except TypeError as te: # int(choice_string) failed due to # either the number is invalid, or the input is custom.
|
|
115
|
+
except (TypeError, ValueError) as te: # int(choice_string) failed due to # either the number is invalid, or the input is custom.
|
|
116
116
|
if choice_string in options_strings: # string input
|
|
117
117
|
choice_idx = options_strings.index(choice_one) # type: ignore
|
|
118
118
|
choice_one = list(options)[choice_idx]
|
|
@@ -861,6 +861,7 @@ class PathExtended(type(Path()), Path): # type: ignore # pylint: disable=E0241
|
|
|
861
861
|
transfers: int = 10,
|
|
862
862
|
root: Optional[str] = "myhome",
|
|
863
863
|
) -> "PathExtended":
|
|
864
|
+
_ = transfers
|
|
864
865
|
to_del = []
|
|
865
866
|
localpath = self.expanduser().absolute() if not self.exists() else self
|
|
866
867
|
if zip:
|
|
@@ -873,21 +874,17 @@ class PathExtended(type(Path()), Path): # type: ignore # pylint: disable=E0241
|
|
|
873
874
|
rp = localpath.get_remote_path(root=root, os_specific=os_specific, rel2home=rel2home, strict=strict) # if rel2home else (P(root) / localpath if root is not None else localpath)
|
|
874
875
|
else:
|
|
875
876
|
rp = PathExtended(remotepath)
|
|
876
|
-
rclone_cmd = f"""rclone copyto '{localpath.as_posix()}' '{cloud}:{rp.as_posix()}' {"--progress" if verbose else ""} --transfers={transfers}"""
|
|
877
|
-
from machineconfig.utils.terminal import Terminal
|
|
878
877
|
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
shell_to_use = "powershell" if sys.platform == "win32" else "bash"
|
|
882
|
-
res = Terminal(stdout=None if verbose else subprocess.PIPE).run(rclone_cmd, shell=shell_to_use).capture()
|
|
878
|
+
from rclone_python import rclone
|
|
879
|
+
rclone.copyto(in_path=localpath.as_posix(), out_path=f"{cloud}:{rp.as_posix()}", )
|
|
883
880
|
_ = [item.delete(sure=True) for item in to_del]
|
|
884
|
-
assert res.is_successful(strict_err=False, strict_returcode=True), res.print(capture=False, desc="Cloud Storage Operation")
|
|
885
881
|
if verbose:
|
|
886
882
|
print(f"{'⬆️' * 5} UPLOAD COMPLETED.")
|
|
887
883
|
if share:
|
|
888
884
|
if verbose:
|
|
889
885
|
print("🔗 SHARING FILE")
|
|
890
886
|
shell_to_use = "powershell" if sys.platform == "win32" else "bash"
|
|
887
|
+
from machineconfig.utils.terminal import Terminal
|
|
891
888
|
res = Terminal().run(f"""rclone link '{cloud}:{rp.as_posix()}'""", shell=shell_to_use).capture()
|
|
892
889
|
tmp = res.op2path(strict_err=False, strict_returncode=False)
|
|
893
890
|
if tmp is None:
|
|
@@ -916,6 +913,7 @@ class PathExtended(type(Path()), Path): # type: ignore # pylint: disable=E0241
|
|
|
916
913
|
overwrite: bool = True,
|
|
917
914
|
merge: bool = False,
|
|
918
915
|
):
|
|
916
|
+
_ = verbose, transfers
|
|
919
917
|
if remotepath is None:
|
|
920
918
|
remotepath = self.get_remote_path(root=root, os_specific=os_specific, rel2home=rel2home, strict=strict)
|
|
921
919
|
remotepath += ".zip" if unzip else ""
|
|
@@ -925,16 +923,11 @@ class PathExtended(type(Path()), Path): # type: ignore # pylint: disable=E0241
|
|
|
925
923
|
localpath = self.expanduser().absolute()
|
|
926
924
|
localpath += ".zip" if unzip else ""
|
|
927
925
|
localpath += ".enc" if decrypt else ""
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
print(
|
|
933
|
-
shell_to_use = "powershell" if sys.platform == "win32" else "bash"
|
|
934
|
-
res = Terminal(stdout=None if verbose else subprocess.PIPE).run(rclone_cmd, shell=shell_to_use)
|
|
935
|
-
success = res.is_successful(strict_err=False, strict_returcode=True)
|
|
936
|
-
if not success:
|
|
937
|
-
res.print(capture=False, desc="Cloud Storage Operation")
|
|
926
|
+
from rclone_python import rclone
|
|
927
|
+
try:
|
|
928
|
+
rclone.copyto(in_path=f"{cloud}:{remotepath.as_posix()}", out_path=localpath.as_posix(), )
|
|
929
|
+
except Exception as e:
|
|
930
|
+
print("to_cloud error", e)
|
|
938
931
|
return None
|
|
939
932
|
if decrypt:
|
|
940
933
|
localpath = localpath.decrypt(key=key, pwd=pwd, inplace=True)
|
|
@@ -946,17 +939,23 @@ class PathExtended(type(Path()), Path): # type: ignore # pylint: disable=E0241
|
|
|
946
939
|
tmp_path_obj = self.expanduser().absolute()
|
|
947
940
|
tmp_path_obj.parent.mkdir(parents=True, exist_ok=True)
|
|
948
941
|
tmp1, tmp2 = tmp_path_obj.as_posix(), self.get_remote_path(root=root, os_specific=os_specific).as_posix()
|
|
949
|
-
|
|
942
|
+
if sync_up:
|
|
943
|
+
source = tmp1
|
|
944
|
+
target = f"{cloud}:{tmp2 if rel2home else tmp1}"
|
|
945
|
+
else:
|
|
946
|
+
source = f"{cloud}:{tmp2 if rel2home else tmp1}" # in bisync direction is irrelavent.
|
|
947
|
+
target = tmp1
|
|
948
|
+
|
|
950
949
|
if not sync_down and not sync_up:
|
|
951
950
|
_ = print(f"SYNCING 🔄️ {source} {'<>' * 7} {target}`") if verbose else None
|
|
952
951
|
rclone_cmd = f"""rclone bisync '{source}' '{target}' --resync --remove-empty-dirs """
|
|
953
952
|
else:
|
|
954
953
|
print(f"SYNCING 🔄️ {source} {'>' * 15} {target}`")
|
|
955
954
|
rclone_cmd = f"""rclone sync '{source}' '{target}' """
|
|
955
|
+
|
|
956
956
|
rclone_cmd += f" --progress --transfers={transfers} --verbose"
|
|
957
957
|
rclone_cmd += " --delete-during" if delete else ""
|
|
958
958
|
from machineconfig.utils.terminal import Terminal
|
|
959
|
-
|
|
960
959
|
if verbose:
|
|
961
960
|
print(rclone_cmd)
|
|
962
961
|
shell_to_use = "powershell" if sys.platform == "win32" else "bash"
|
|
@@ -965,4 +964,5 @@ class PathExtended(type(Path()), Path): # type: ignore # pylint: disable=E0241
|
|
|
965
964
|
if not success:
|
|
966
965
|
res.print(capture=False, desc="Cloud Storage Operation")
|
|
967
966
|
return None
|
|
967
|
+
|
|
968
968
|
return self
|
|
@@ -83,13 +83,13 @@ machineconfig/jobs/python_custom_installers/scripts/linux/vscode.sh,sha256=8S0nZ
|
|
|
83
83
|
machineconfig/jobs/python_custom_installers/scripts/linux/warp-cli.sh,sha256=PVNLeYWdh3XEFllCVZDYIHBI42btjGlH5jbyXjJGz-Y,3033
|
|
84
84
|
machineconfig/jobs/python_custom_installers/scripts/linux/wezterm.sh,sha256=m697rRoIIVk-f8JdI1YQmphk-JWpMc5IYbD5YaQ3SeQ,1874
|
|
85
85
|
machineconfig/jobs/python_generic_installers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
86
|
-
machineconfig/jobs/python_generic_installers/config.json,sha256=
|
|
86
|
+
machineconfig/jobs/python_generic_installers/config.json,sha256=8oxCQANAy5lFVGUPNjavZT0ro8Su-dGj1fJael3Ohbc,19949
|
|
87
87
|
machineconfig/jobs/python_generic_installers/config.json.bak,sha256=dkrLpAs-xJ1gvpFd42yuWGoRkkE1MG-8fAhrMNrxt34,20678
|
|
88
88
|
machineconfig/jobs/python_generic_installers/dev/config.archive.json,sha256=1rZO1-5lxtbVGuXXoTTuvWjs54xlHHIAIIZYDAy8FSA,823
|
|
89
89
|
machineconfig/jobs/python_generic_installers/dev/config.json,sha256=ItwFXaLlIGwBS2SfmYwsqYU86fAKQmCfLD7vaneZgPA,26928
|
|
90
90
|
machineconfig/jobs/python_generic_installers/dev/config.json.bak,sha256=dKzCQNuQigcuTGw1uvhHkhG-kvp2UPHpv0X6XOTYtBE,29760
|
|
91
91
|
machineconfig/jobs/python_linux_installers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
92
|
-
machineconfig/jobs/python_linux_installers/config.json,sha256=
|
|
92
|
+
machineconfig/jobs/python_linux_installers/config.json,sha256=N0kk9WSUzIbKiLl5a4qRoR0LB4qGGjzLXIlWYMcm8mY,4658
|
|
93
93
|
machineconfig/jobs/python_linux_installers/config.json.bak,sha256=rn2mss51IgiAKKmhPdQ0nmTC_aPFm-6rIfHdCBlEFBE,5324
|
|
94
94
|
machineconfig/jobs/python_linux_installers/archive/config.json,sha256=bpfrVl1Zcmb6FwrIh413bV_o2_e4NVA8RESZil10wZk,370
|
|
95
95
|
machineconfig/jobs/python_linux_installers/archive/config.json.bak,sha256=haf6H05bW2AC-CptfZBeNeMoQK60w8iWmCZ2aDiL4O0,302
|
|
@@ -165,11 +165,11 @@ machineconfig/scripts/python/cloud_mount.py,sha256=RFMzRUep2D5HtVXANIi-pab3EkI-W
|
|
|
165
165
|
machineconfig/scripts/python/cloud_repo_sync.py,sha256=GBhdUu9BJwhLYmhxxtvqJGLy7xKdQcnH9kkL4jcbzEE,9502
|
|
166
166
|
machineconfig/scripts/python/cloud_sync.py,sha256=RWGpAfJ9fnN18yNBSgN44dzA38Hmd4879JL5r2pcyrM,3514
|
|
167
167
|
machineconfig/scripts/python/croshell.py,sha256=tYc8MUVcbvSH8JZxc273z9Kr8LitoKxI7ZdFN-_Ms-s,8945
|
|
168
|
-
machineconfig/scripts/python/devops.py,sha256=
|
|
168
|
+
machineconfig/scripts/python/devops.py,sha256=GD1FLfp76E5bhcs9XhC3Fa6XfMOdfv_qu8kMBOjVtXE,5669
|
|
169
169
|
machineconfig/scripts/python/devops_add_identity.py,sha256=JfN3ZrYMCgmt4ks_VCfnV9BIIHAsOYO3E0W0wZ15FR8,3791
|
|
170
170
|
machineconfig/scripts/python/devops_add_ssh_key.py,sha256=KaoX83KltBsmutfKhSfZjd7nP_R1hJ2OLAWRhbswO7o,6889
|
|
171
171
|
machineconfig/scripts/python/devops_backup_retrieve.py,sha256=jZe5Vki7E2GCMG8hvqUZeOONFC4cNzISoGzq_dMG4GA,5601
|
|
172
|
-
machineconfig/scripts/python/devops_devapps_install.py,sha256=
|
|
172
|
+
machineconfig/scripts/python/devops_devapps_install.py,sha256=kPq8lARp0JEEoaUNfcfO6rFHHYV3x-SBJ0ogzCwDPHQ,9987
|
|
173
173
|
machineconfig/scripts/python/devops_update_repos.py,sha256=c5qBc9cuTGDEqDHufkjDT4d_vvJsswv3tlqk9MAulYk,8063
|
|
174
174
|
machineconfig/scripts/python/dotfile.py,sha256=SRcX-9Ak1jRvF-killBTTm2IWcsNxfiLucH6ZsytAFA,2202
|
|
175
175
|
machineconfig/scripts/python/fire_agents.py,sha256=Hn27ZGWBRlu3mDyJPf_qg_m0i3AbWbWpA-Ce1VeZjUY,9207
|
|
@@ -400,8 +400,8 @@ machineconfig/utils/installer.py,sha256=_sjaIqqHN-7n3mYD-iOIli6Bn2792EjOwE-JC528
|
|
|
400
400
|
machineconfig/utils/io.py,sha256=6LuQMT7CG26atx5_0P30Ru0zHgLwuvpKHfZLUWIjS-U,2873
|
|
401
401
|
machineconfig/utils/links.py,sha256=riNUrG8aGElRszdOPOic4M2AyOcpdcth_-y8JEiZpJ4,10253
|
|
402
402
|
machineconfig/utils/notifications.py,sha256=vvdsY5IX6XEiILTnt5lNyHxhCi0ljdGX2T_67VRfrG4,9009
|
|
403
|
-
machineconfig/utils/options.py,sha256=
|
|
404
|
-
machineconfig/utils/path_extended.py,sha256=
|
|
403
|
+
machineconfig/utils/options.py,sha256=aEFeVbHfbX0d3VjjZcUAQA0jSOsKhKhr7P0kGHYhPd0,9284
|
|
404
|
+
machineconfig/utils/path_extended.py,sha256=nTETtTxzNaxdrapIH3WzkR__b-1k6Lx7SpRAXqmIJN4,51793
|
|
405
405
|
machineconfig/utils/path_helper.py,sha256=jqOf3TAlw5cqSp4HBAlOqjAR_bzC8_fvjA-_-CooI6Y,8030
|
|
406
406
|
machineconfig/utils/procs.py,sha256=KjEbrwfbdoi5IBM518scxMDVi7NxTZLHuYiKmwdGlzg,11393
|
|
407
407
|
machineconfig/utils/scheduler.py,sha256=bUHDviS_HE9_6LaA1k9Nnfz5rr2FJIfrk5qO2FJ-oUs,15119
|
|
@@ -422,8 +422,8 @@ machineconfig/utils/schemas/fire_agents/fire_agents_input.py,sha256=CCs5ebomW1ac
|
|
|
422
422
|
machineconfig/utils/schemas/installer/installer_types.py,sha256=iAzcALc9z_FAQE9iuGHfX6Z0B1_n3Gt6eC0d6heYik0,599
|
|
423
423
|
machineconfig/utils/schemas/layouts/layout_types.py,sha256=M1ZFCz_kjRZPhxM19rIYUDR5lDDpwa09odR_ihtIFq0,1932
|
|
424
424
|
machineconfig/utils/schemas/repos/repos_types.py,sha256=ECVr-3IVIo8yjmYmVXX2mnDDN1SLSwvQIhx4KDDQHBQ,405
|
|
425
|
-
machineconfig-3.
|
|
426
|
-
machineconfig-3.
|
|
427
|
-
machineconfig-3.
|
|
428
|
-
machineconfig-3.
|
|
429
|
-
machineconfig-3.
|
|
425
|
+
machineconfig-3.89.dist-info/METADATA,sha256=x-Ql6nmdV_7gD4-vAs9QZ3LR4kIv7KXml5BDnYrsmic,6998
|
|
426
|
+
machineconfig-3.89.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
427
|
+
machineconfig-3.89.dist-info/entry_points.txt,sha256=rSx_9gXd2stziS1OkNy__jF647hrRxRiF6zolLUELc4,1153
|
|
428
|
+
machineconfig-3.89.dist-info/top_level.txt,sha256=porRtB8qms8fOIUJgK-tO83_FeH6Bpe12oUVC670teA,14
|
|
429
|
+
machineconfig-3.89.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|