machineconfig 5.20__py3-none-any.whl → 5.22__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.

Files changed (26) hide show
  1. machineconfig/cluster/sessions_managers/zellij_local.py +1 -3
  2. machineconfig/jobs/installer/custom_dev/brave.py +0 -6
  3. machineconfig/jobs/installer/package_groups.py +12 -12
  4. machineconfig/profile/shell.py +1 -1
  5. machineconfig/scripts/python/cloud_repo_sync.py +21 -22
  6. machineconfig/scripts/python/croshell.py +2 -4
  7. machineconfig/scripts/python/devops.py +18 -9
  8. machineconfig/scripts/python/devops_status.py +521 -0
  9. machineconfig/scripts/python/devops_update_repos.py +1 -3
  10. machineconfig/scripts/python/fire_jobs.py +15 -50
  11. machineconfig/scripts/python/fire_jobs_args_helper.py +4 -1
  12. machineconfig/scripts/python/fire_jobs_route_helper.py +46 -0
  13. machineconfig/scripts/python/helpers/repo_sync_helpers.py +0 -40
  14. machineconfig/scripts/python/onetimeshare.py +0 -1
  15. machineconfig/scripts/python/sessions.py +7 -10
  16. machineconfig/scripts/python/sessions_multiprocess.py +56 -0
  17. machineconfig/setup_linux/repos.sh +1 -29
  18. machineconfig/setup_windows/repos.ps1 +0 -12
  19. machineconfig/utils/files/read.py +4 -6
  20. machineconfig/utils/notifications.py +1 -1
  21. machineconfig/utils/ssh.py +2 -13
  22. {machineconfig-5.20.dist-info → machineconfig-5.22.dist-info}/METADATA +1 -1
  23. {machineconfig-5.20.dist-info → machineconfig-5.22.dist-info}/RECORD +26 -24
  24. {machineconfig-5.20.dist-info → machineconfig-5.22.dist-info}/WHEEL +0 -0
  25. {machineconfig-5.20.dist-info → machineconfig-5.22.dist-info}/entry_points.txt +0 -0
  26. {machineconfig-5.20.dist-info → machineconfig-5.22.dist-info}/top_level.txt +0 -0
@@ -453,17 +453,15 @@ def created_zellij_layout(layout_config: LayoutConfig, output_dir: Optional[str]
453
453
 
454
454
 
455
455
  def run_zellij_layout(layout_config: LayoutConfig):
456
- layout_path = created_zellij_layout(layout_config, None)
456
+ layout_path = created_zellij_layout(layout_config=layout_config, output_dir=None)
457
457
  session_name = layout_config["layoutName"]
458
458
  try:
459
459
  from machineconfig.cluster.sessions_managers.utils.enhanced_command_runner import enhanced_zellij_session_start
460
-
461
460
  enhanced_zellij_session_start(session_name, layout_path)
462
461
  except ImportError:
463
462
  # Fallback to original implementation
464
463
  cmd = f"zellij delete-session --force {session_name}; zellij --layout {layout_path} a -b {session_name}"
465
464
  import subprocess
466
-
467
465
  subprocess.run(cmd, shell=True, check=True)
468
466
  console.print(f"[bold green]🚀 Zellij layout is running[/bold green] [yellow]@[/yellow] [bold cyan]{session_name}[/bold cyan]")
469
467
 
@@ -9,12 +9,6 @@ from rich.panel import Panel
9
9
  from machineconfig.utils.schemas.installer.installer_types import InstallerData
10
10
 
11
11
 
12
- # config_dict: InstallerData = {
13
- # "appName": "Brave",
14
- # "repoURL": "CMD",
15
- # "doc": "Privacy-focused web browser with built-in ad blocking",
16
- # }
17
-
18
12
 
19
13
  def main(installer_data: InstallerData, version: Optional[str]) -> None:
20
14
  console = Console()
@@ -75,8 +75,6 @@ PACKAGES_DOC_CONVERSION = [
75
75
  "mermaid-cli",
76
76
  "html2markdown",
77
77
  "pandoc",
78
- "cpz",
79
- "rmz",
80
78
  ]
81
79
 
82
80
  # Media & Entertainment - Music players and media tools
@@ -90,6 +88,8 @@ PACKAGES_MEDIA = [
90
88
 
91
89
  # File Sharing & Cloud - File sharing, transfer, backup, sync, and QR tools
92
90
  PACKAGES_FILE_SHARING = [
91
+ "cpz",
92
+ "rmz",
93
93
  "ffsend",
94
94
  "portal",
95
95
  "qrcp",
@@ -104,6 +104,7 @@ PACKAGES_FILE_SHARING = [
104
104
  "restic",
105
105
  "syncthing",
106
106
  "cloudreve",
107
+ "ots",
107
108
  ]
108
109
 
109
110
 
@@ -121,11 +122,11 @@ PACKAGES_DEV_UTILS = [
121
122
  "rust-analyzer",
122
123
  "evcxr",
123
124
  "geckodriver",
124
- "hyperfine",
125
125
  ]
126
126
 
127
127
  # Code Analysis, Git & Docs - Code analysis, statistics, documentation, and Git tools
128
128
  PACKAGES_CODE_ANALYSIS = [
129
+ "hyperfine",
129
130
  "kondo",
130
131
  "tokei",
131
132
  "navi",
@@ -142,9 +143,6 @@ PACKAGES_PRODUCTIVITY = [
142
143
  "openpomodoro-cli",
143
144
  "just",
144
145
  "rustdesk",
145
- "ots",
146
- "lolcatjs",
147
- "figlet-cli",
148
146
  ]
149
147
 
150
148
  # Miscellaneous Tools - Other tools
@@ -237,8 +235,14 @@ PACKAGES_TERMINAL_SHELL = [
237
235
  "mprocs",
238
236
  "mcfly",
239
237
  "starship",
238
+ "lolcatjs",
239
+ "figlet-cli",
240
+ ]
241
+ # Web Sharing - Share terminal over web
242
+ PACKAGES_WEB_TERMINAL = [
243
+ "gotty",
244
+ "ttyd",
240
245
  ]
241
-
242
246
 
243
247
 
244
248
  # Cloud & Utilities - Cloud storage, file watching, web terminal, and presentation tools
@@ -250,11 +254,7 @@ PACKAGES_CLOUD_UTILS = [
250
254
  "speedtest",
251
255
  ]
252
256
 
253
- # Web Sharing - Share terminal over web
254
- PACKAGES_WEB_TERMINAL = [
255
- "gotty",
256
- "ttyd",
257
- ]
257
+
258
258
 
259
259
 
260
260
  # Main ESSENTIAL package list - combines all subgroups
@@ -13,7 +13,7 @@ from rich.panel import Panel
13
13
 
14
14
  system = platform.system()
15
15
  sep = ";" if system == "Windows" else ":" # PATH separator, this is special for PATH object, not to be confused with PathExtended.sep (normal paths), usually / or \
16
- PATH = os.environ["PATH"].split(sep) # this is a list of paths in PATH variable, not a crocodile.file_management.P object.
16
+ PATH = os.environ["PATH"].split(sep)
17
17
  console = Console()
18
18
  BOX_WIDTH = 100 # Define BOX_WIDTH or get it from a config
19
19
 
@@ -1,12 +1,9 @@
1
- """utils"""
2
-
3
- from pathlib import Path
1
+ import sys
4
2
  import git
5
3
  from machineconfig.utils.io import read_ini
6
4
  from machineconfig.utils.path_extended import PathExtended
7
5
  from machineconfig.utils.terminal import Response
8
6
 
9
- from machineconfig.scripts.python.helpers.repo_sync_helpers import fetch_dotfiles
10
7
  from machineconfig.utils.source_of_truth import CONFIG_PATH, DEFAULTS_PATH
11
8
  from machineconfig.utils.options import choose_from_options
12
9
  from machineconfig.utils.code import get_shell_file_executing_python_script, write_shell_script_to_file
@@ -15,13 +12,18 @@ import subprocess
15
12
  from typing import Optional, Literal
16
13
  from rich.console import Console
17
14
  from rich.panel import Panel
15
+ import typer
18
16
 
19
17
  console = Console()
20
18
 
21
- _ = fetch_dotfiles
22
-
23
19
 
24
- def main(cloud: Optional[str] = None, path: Optional[str] = None, message: Optional[str] = None, action: Literal["ask", "pushLocalMerge", "overwriteLocal", "InspectRepos", "RemoveLocalRclone"] = "ask", pwd: Optional[str] = None):
20
+ def main(
21
+ cloud: Optional[str] = typer.Option(None, "--cloud", "-c", help="Cloud storage profile name. If not provided, uses default from config."),
22
+ path: Optional[str] = typer.Option(None, "--path", "-p", help="Path to the local repository. Defaults to current working directory."),
23
+ message: Optional[str] = typer.Option(None, "--message", "-m", help="Commit message for local changes."),
24
+ on_conflict: Literal["ask", "pushLocalMerge", "overwriteLocal", "InspectRepos", "RemoveLocalRclone"] = typer.Option("ask", "--on-conflict", "-oc", help="Action to take on merge conflict. Default is 'ask'."),
25
+ pwd: Optional[str] = typer.Option(None, "--password", help="Password for encryption/decryption of the remote repository."),
26
+ ):
25
27
  if cloud is None:
26
28
  try:
27
29
  cloud_resolved = read_ini(DEFAULTS_PATH)["general"]["rclone_config_name"]
@@ -31,8 +33,6 @@ def main(cloud: Optional[str] = None, path: Optional[str] = None, message: Optio
31
33
  return ""
32
34
  else:
33
35
  cloud_resolved = cloud
34
-
35
- # repo_root = PathExtended(args.repo).expanduser().absolute()
36
36
  repo_local_root = PathExtended.cwd() if path is None else PathExtended(path).expanduser().absolute()
37
37
  repo_local_obj = git.Repo(repo_local_root, search_parent_directories=True)
38
38
  repo_local_root = PathExtended(repo_local_obj.working_dir) # cwd might have been in a sub directory of repo_root, so its better to redefine it.
@@ -143,7 +143,7 @@ git commit -am "finished merging"
143
143
  print(f"• 4️⃣ {option4:75} 👉 {shell_file_4}")
144
144
 
145
145
  program_content = None
146
- match action:
146
+ match on_conflict:
147
147
  case "ask":
148
148
  choice = choose_from_options(multi=False, msg="Choose one option", options=[option1, option2, option3, option4], fzf=False)
149
149
  if choice == option1:
@@ -165,7 +165,7 @@ git commit -am "finished merging"
165
165
  case "RemoveLocalRclone":
166
166
  program_content = program_4
167
167
  case _:
168
- raise ValueError(f"Unknown action: {action}")
168
+ raise ValueError(f"Unknown action: {on_conflict}")
169
169
  # PROGRAM_PATH.write_text(program_content, encoding="utf-8")
170
170
  subprocess.run(program_content, shell=True, check=True)
171
171
 
@@ -173,17 +173,16 @@ git commit -am "finished merging"
173
173
 
174
174
 
175
175
  def args_parser():
176
- # console.print(Panel("🔄 Repository Synchronization Utility", title_align="left", border_style="blue"))
177
- # parser = argparse.ArgumentParser(description="Secure Repo CLI.")
178
- # parser.add_argument("path", nargs="?", type=str, help="Repository path, defaults to cwd.", default=None)
179
- # parser.add_argument("--cloud", "-c", help="rclone cloud profile name.", default=None)
180
- # parser.add_argument("--message", "-m", help="Commit Message", default=f"new message {randstr()}")
181
- # parser.add_argument("--pwd", "-p", help="Password for encryption", default=None)
182
- # parser.add_argument("--action", "-a", help="Action to take if merge fails.", choices=["ask", "pushLocalMerge", "overwriteLocal", "InspectRepos", "RemoveLocalRclone"], default="ask")
183
- # args = parser.parse_args()
184
- # main(cloud=args.cloud, path=args.path, message=args.message, action=args.action)
185
- import typer
186
- typer.run(main)
176
+ # Check if no arguments provided (excluding the script name)
177
+ if len(sys.argv) == 1:
178
+ app = typer.Typer(add_completion=False, help="Sync a local git repository with a remote encrypted cloud copy.")
179
+ app.command()(main)
180
+ app(["--help"])
181
+ return
182
+
183
+ app = typer.Typer(add_completion=False, no_args_is_help=True, help="Sync a local git repository with a remote encrypted cloud copy.")
184
+ app.command()(main)
185
+ app()
187
186
 
188
187
 
189
188
  if __name__ == "__main__":
@@ -20,10 +20,8 @@ console = Console()
20
20
 
21
21
  def add_print_header_pycode(path: str, title: str):
22
22
  return f"""
23
- try:
24
- from crocodile.file_management import P as PathExtended
25
- except ImportError:
26
- from machineconfig.utils.path_extended import PathExtended
23
+
24
+ from machineconfig.utils.path_extended import PathExtended
27
25
  pycode = PathExtended(r'{path}').read_text(encoding="utf-8")
28
26
  pycode = pycode.split("except Exception: print(pycode)")[2]
29
27
 
@@ -1,11 +1,11 @@
1
1
  """devops with emojis"""
2
2
 
3
+ import typer
4
+ from typing import Literal, Annotated, Optional, get_args
5
+
3
6
  import machineconfig.scripts.python.share_terminal as share_terminal
4
7
  import machineconfig.scripts.python.repos as repos
5
8
  from machineconfig.jobs.installer.package_groups import PACKAGE_GROUPS
6
- # import machineconfig.scripts.python.dotfile as dotfile_module
7
- import typer
8
- from typing import Literal, Annotated, Optional, get_args
9
9
 
10
10
 
11
11
  app = typer.Typer(help="🛠️ DevOps operations", no_args_is_help=True)
@@ -44,19 +44,24 @@ def interactive():
44
44
  @self_app.command()
45
45
  def status():
46
46
  """📊 STATUS of machine, shell profile, apps, symlinks, dotfiles, etc."""
47
- pass
47
+ import machineconfig.scripts.python.devops_status as helper
48
+ helper.main()
48
49
  @self_app.command()
49
50
  def clone():
50
- """📋 CLONE machienconfig locally for faster execution and nightly updates. """
51
+ """📋 CLONE machienconfig locally and incorporate to shell profile for faster execution and nightly updates."""
51
52
  import platform
52
53
  from machineconfig.utils.code import run_shell_script
54
+ from machineconfig.profile.shell import create_default_shell_profile
53
55
  if platform.system() == "Windows":
54
56
  from machineconfig.setup_windows import REPOS
57
+ create_default_shell_profile(method="copy")
55
58
  else:
56
59
  from machineconfig.setup_linux import REPOS
60
+ create_default_shell_profile(method="reference")
57
61
  run_shell_script(REPOS.read_text(encoding="utf-8"))
58
62
 
59
63
 
64
+
60
65
  @config_apps.command(no_args_is_help=True)
61
66
  def private(method: Literal["symlink", "copy"] = typer.Option(..., "--method", "-m", help="Method to use for linking files"),
62
67
  on_conflict: Literal["throwError", "overwriteSelfManaged", "backupSelfManaged", "overwriteDefaultPath", "backupDefaultPath"] = typer.Option("throwError", "--on-conflict", "-o", help="Action to take on conflict"),
@@ -75,10 +80,14 @@ def public(method: Literal["symlink", "copy"] = typer.Option(..., "--method", "-
75
80
  import machineconfig.profile.create_frontend as create_frontend
76
81
  create_frontend.main_public_from_parser(method=method, on_conflict=on_conflict, which=which, interactive=interactive)
77
82
 
78
- # @config_apps.command(no_args_is_help=True)
79
- # def dotfile():
80
- # """🔗 Manage dotfiles."""
81
- # dotfile_module.main()
83
+ @config_apps.command(no_args_is_help=True)
84
+ def dotfile(file: Annotated[str, typer.Argument(help="file/folder path.")],
85
+ overwrite: Annotated[bool, typer.Option("--overwrite", "-o", help="Overwrite.")] = False,
86
+ dest: Annotated[str, typer.Option("--dest", "-d", help="destination folder")] = "",
87
+ ):
88
+ """🔗 Manage dotfiles."""
89
+ import machineconfig.scripts.python.dotfile as dotfile_module
90
+ dotfile_module.main(file=file, overwrite=overwrite, dest=dest)
82
91
 
83
92
 
84
93
  @config_apps.command(no_args_is_help=True)