machineconfig 5.30__py3-none-any.whl → 5.32__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 (83) hide show
  1. machineconfig/scripts/linux/{wifi_conn → cloud} +1 -1
  2. machineconfig/scripts/python/agents.py +6 -0
  3. machineconfig/scripts/python/ai/initai.py +0 -9
  4. machineconfig/scripts/python/cloud.py +12 -0
  5. machineconfig/scripts/python/{cloud_copy.py → cloud_helpers/cloud_copy.py} +3 -3
  6. machineconfig/scripts/python/{cloud_sync.py → cloud_helpers/cloud_sync.py} +3 -10
  7. machineconfig/scripts/python/{helpers → cloud_helpers}/helpers2.py +1 -1
  8. machineconfig/scripts/python/croshell_helpers/__init__.py +0 -0
  9. machineconfig/scripts/python/devops.py +13 -122
  10. machineconfig/scripts/python/devops_helpers/cli_config.py +43 -0
  11. machineconfig/scripts/python/devops_helpers/cli_data.py +18 -0
  12. machineconfig/scripts/python/devops_helpers/cli_nw.py +39 -0
  13. machineconfig/scripts/python/{repos.py → devops_helpers/cli_repos.py} +52 -16
  14. machineconfig/scripts/python/devops_helpers/cli_self.py +41 -0
  15. machineconfig/scripts/python/devops_helpers/devops_backup_retrieve.py +1 -1
  16. machineconfig/scripts/python/devops_helpers/devops_update_repos.py +1 -1
  17. machineconfig/scripts/python/devops_navigator.py +806 -0
  18. machineconfig/scripts/python/fire_jobs.py +2 -2
  19. machineconfig/scripts/python/ftpx.py +1 -1
  20. machineconfig/scripts/python/helpers_fire_command/fire_jobs_route_helper.py +1 -1
  21. machineconfig/scripts/python/helpers_repos/__init__.py +0 -0
  22. machineconfig/scripts/python/{secure_repo.py → helpers_repos/secure_repo.py} +1 -1
  23. machineconfig/scripts/python/interactive.py +2 -2
  24. machineconfig/scripts/python/nw/__init__.py +0 -0
  25. machineconfig/scripts/python/repos_helpers/{repos_helper_action.py → action.py} +1 -1
  26. machineconfig/scripts/python/repos_helpers/{repos_helper.py → entrypoint.py} +2 -2
  27. machineconfig/scripts/python/{helpers/repo_sync_helpers.py → repos_helpers/sync.py} +0 -20
  28. machineconfig/scripts/python/sessions.py +2 -2
  29. machineconfig/scripts/python/sessions_helpers/__init__.py +0 -0
  30. machineconfig/scripts/python/{sessions_multiprocess.py → sessions_helpers/sessions_multiprocess.py} +1 -1
  31. machineconfig/scripts/windows/{initai.ps1 → cloud.ps1} +1 -1
  32. machineconfig/utils/code.py +13 -3
  33. {machineconfig-5.30.dist-info → machineconfig-5.32.dist-info}/METADATA +1 -1
  34. {machineconfig-5.30.dist-info → machineconfig-5.32.dist-info}/RECORD +65 -72
  35. machineconfig-5.32.dist-info/entry_points.txt +9 -0
  36. machineconfig/scripts/linux/choose_wezterm_theme +0 -3
  37. machineconfig/scripts/linux/cloud_copy +0 -2
  38. machineconfig/scripts/linux/cloud_mount +0 -2
  39. machineconfig/scripts/linux/cloud_sync +0 -2
  40. machineconfig/scripts/linux/gh_models +0 -2
  41. machineconfig/scripts/linux/initai +0 -2
  42. machineconfig/scripts/linux/scheduler +0 -2
  43. machineconfig/scripts/linux/start_slidev +0 -2
  44. machineconfig/scripts/python/gh_models.py +0 -104
  45. machineconfig/scripts/python/helpers_fire/fire_q.py +0 -19
  46. machineconfig/scripts/python/snapshot.py +0 -25
  47. machineconfig/scripts/python/start_terminals.py +0 -121
  48. machineconfig/scripts/windows/choose_wezterm_theme.ps1 +0 -1
  49. machineconfig/scripts/windows/cloud_copy.ps1 +0 -1
  50. machineconfig/scripts/windows/cloud_mount.ps1 +0 -1
  51. machineconfig/scripts/windows/cloud_sync.ps1 +0 -1
  52. machineconfig/scripts/windows/wifi_conn.ps1 +0 -2
  53. machineconfig-5.30.dist-info/entry_points.txt +0 -17
  54. /machineconfig/scripts/python/{helpers → cloud_helpers}/__init__.py +0 -0
  55. /machineconfig/scripts/python/{helpers → cloud_helpers}/cloud_helpers.py +0 -0
  56. /machineconfig/scripts/python/{cloud_mount.py → cloud_helpers/cloud_mount.py} +0 -0
  57. /machineconfig/scripts/python/{helpers → cloud_helpers}/helpers5.py +0 -0
  58. /machineconfig/scripts/python/{pomodoro.py → croshell_helpers/pomodoro.py} +0 -0
  59. /machineconfig/scripts/python/{scheduler.py → croshell_helpers/scheduler.py} +0 -0
  60. /machineconfig/scripts/python/{start_slidev.py → croshell_helpers/start_slidev.py} +0 -0
  61. /machineconfig/scripts/python/{viewer.py → croshell_helpers/viewer.py} +0 -0
  62. /machineconfig/scripts/python/{viewer_template.py → croshell_helpers/viewer_template.py} +0 -0
  63. /machineconfig/scripts/{windows/select_pwsh_theme.ps1 → python/devops_helpers/choose_pwsh_theme.ps1} +0 -0
  64. /machineconfig/scripts/python/{choose_wezterm_theme.py → devops_helpers/choose_wezterm_theme.py} +0 -0
  65. /machineconfig/scripts/python/{dotfile.py → devops_helpers/cli_config_dotfile.py} +0 -0
  66. /machineconfig/scripts/python/{share_terminal.py → devops_helpers/cli_terminal.py} +0 -0
  67. /machineconfig/scripts/python/{helpers → helpers_fire}/helpers4.py +0 -0
  68. /machineconfig/scripts/python/{cloud_repo_sync.py → helpers_repos/cloud_repo_sync.py} +0 -0
  69. /machineconfig/scripts/{linux → python/nw}/mount_drive +0 -0
  70. /machineconfig/scripts/{linux → python/nw}/mount_nfs +0 -0
  71. /machineconfig/scripts/python/{mount_nfs.py → nw/mount_nfs.py} +0 -0
  72. /machineconfig/scripts/{linux → python/nw}/mount_nw_drive +0 -0
  73. /machineconfig/scripts/python/{mount_nw_drive.py → nw/mount_nw_drive.py} +0 -0
  74. /machineconfig/scripts/{linux → python/nw}/mount_smb +0 -0
  75. /machineconfig/scripts/python/{mount_ssh.py → nw/mount_ssh.py} +0 -0
  76. /machineconfig/scripts/python/{onetimeshare.py → nw/onetimeshare.py} +0 -0
  77. /machineconfig/scripts/python/{wifi_conn.py → nw/wifi_conn.py} +0 -0
  78. /machineconfig/scripts/python/{wsl_windows_transfer.py → nw/wsl_windows_transfer.py} +0 -0
  79. /machineconfig/scripts/python/repos_helpers/{repos_helper_clone.py → clone.py} +0 -0
  80. /machineconfig/scripts/python/repos_helpers/{repos_helper_record.py → record.py} +0 -0
  81. /machineconfig/scripts/python/repos_helpers/{repos_helper_update.py → update.py} +0 -0
  82. {machineconfig-5.30.dist-info → machineconfig-5.32.dist-info}/WHEEL +0 -0
  83. {machineconfig-5.30.dist-info → machineconfig-5.32.dist-info}/top_level.txt +0 -0
@@ -1,25 +0,0 @@
1
- # def main():
2
- # print("\n" + "=" * 50)
3
- # print("📸 Welcome to the Snapshot Tool")
4
- # print("=" * 50 + "\n")
5
-
6
- # parser = argparse.ArgumentParser(description='📷 Capture snapshots using your webcam.')
7
- # parser.add_argument("--to_text", "-t", help="📝 Convert the snapshot to text using OCR.", action="store_true")
8
- # args = parser.parse_args()
9
-
10
- # print("📷 Capturing image from webcam...")
11
- # img_path = capture_from_webcam(show=False, wait=False, save=True)
12
- # print(f"✅ Image captured and saved at: {img_path}\n")
13
-
14
- # if args.to_text:
15
- # print("🔍 Converting image to text using Tesseract OCR...")
16
- # q = Terminal().run(f"cd ~/AppData/Local/Tesseract-OCR; pytesseract '{img_path}'", shell="pwsh").capture().op
17
- # print("📝 Extracted Text:")
18
- # print("-" * 50)
19
- # print(q)
20
- # print("-" * 50 + "\n")
21
- # else:
22
- # print("📂 Image saved successfully. No text extraction requested.\n")
23
-
24
- # if __name__ == '__main__':
25
- # main()
@@ -1,121 +0,0 @@
1
- """Script to start terminals on windows and wsl"""
2
-
3
- from machineconfig.utils.options import choose_from_options, get_ssh_hosts
4
- import platform
5
- from itertools import cycle
6
- from typing import Literal, Optional, Annotated
7
- import typer
8
-
9
-
10
- COLOR_SCHEMES = ["Campbell", "Campbell Powershell", "Solarized Dark", "Ubuntu-ColorScheme", "Retro"]
11
- THEMES_ITER = cycle(COLOR_SCHEMES)
12
- INIT_COMMANDS = ["ls", "lf", "cpufetch", "fastfetch", "btm"]
13
- INIT_COMMANDS_ITER = cycle(INIT_COMMANDS)
14
- SIZE_ITER = cycle([0.6, 0.4, 0.3])
15
- ORIENTATION = ["vertical", "horizontal"]
16
- ORIENTATION_ITER = cycle(ORIENTATION)
17
- ORIENTATION_TYPE = Literal["vertical", "horizontal"]
18
-
19
- THIS_MACHINE = "this"
20
- THIS_MACHINE_WSL = "thiswsl"
21
- THIS_MACHINE_HOSTNAME = platform.node()
22
- THIS_MACHINE_HOSTNAME_WSL = f"{THIS_MACHINE_HOSTNAME}wsl"
23
-
24
-
25
- def main_windows_and_wsl(window: int, hosts: list[str], orientation: ORIENTATION_TYPE = "vertical", mprocs: bool = False):
26
- print("\n🔧 Configuring terminal layout for Windows and WSL...")
27
- orientation_oposite = "horizontal" if orientation == "vertical" else "vertical"
28
- orientation_swap = "up" if orientation == "horizontal" else "left"
29
- orientation_opposite_move_focus = "up" if orientation_oposite == "horizontal" else "left"
30
- orientation_opposite_move_focus_other = "down" if orientation_oposite == "horizontal" else "right"
31
- sleep = 3
32
- sep = f"\nsleep {sleep}; wt --window {window}" # or '`;'
33
- ssh_cmd = "-t 'mprocs'" if mprocs else "" # 'wsl_ssh_windows_port_forwarding.ps1'
34
- split_per_machine = 1 / len(hosts)
35
- size = 0.3
36
- known_hosts = get_ssh_hosts()
37
- if len(hosts) == 1:
38
- print("🖥️ Single host detected. Configuring layout...")
39
- if "wsl" in hosts[0] or f"{hosts[0]}wsl" in known_hosts: # its a windows machine with wsl
40
- host_wind = hosts[0] if "wsl" not in hosts[0] else hosts[0].split("wsl")[0]
41
- host_linux = f"{host_wind}wsl"
42
- cmd = f"""
43
- wt --window {window} --title {hosts[0]} powershell -Command "ssh {host_linux} {ssh_cmd}" `; split-pane --{orientation} --title {hosts[0]}wsl --size 0.5 powershell -Command "ssh {host_wind} `; split-pane --{orientation_oposite} --size 0.5 powershell "
44
- """
45
- else: # its a windows machine without wsl
46
- cmd = f"""wt --window {window} --title {hosts[0]} powershell -Command "ssh {hosts[0]} {ssh_cmd}" `; split-pane --{orientation} --title {hosts[0]}wsl --size 0.1 powershell """
47
-
48
- elif len(hosts) > 1:
49
- print("🖥️ Multiple hosts detected. Configuring layout...")
50
- pane_cmd = f'powershell -Command "ssh {hosts[0]} {ssh_cmd}" ' if hosts[0] != THIS_MACHINE else ""
51
- cmd = f"""wt --window {window} --title {hosts[0]} {pane_cmd} """
52
- for a_host in hosts[1:]:
53
- if a_host != THIS_MACHINE:
54
- pane_cmd = f'powershell -Command "ssh {a_host} {ssh_cmd}" '
55
- else:
56
- pane_cmd = "powershell"
57
- cmd += f"""{sep} split-pane --{orientation_oposite} --title {a_host}Windows --size {split_per_machine} {pane_cmd} """
58
- for idx, a_host in enumerate(hosts[::-1]):
59
- if f"{a_host}wsl" not in known_hosts and a_host != THIS_MACHINE:
60
- continue
61
- pane_cmd = f'powershell -Command "ssh {a_host}wsl"' if a_host != THIS_MACHINE else "wsl"
62
- if idx == 0:
63
- tmp = ""
64
- else:
65
- tmp = f"move-focus {orientation_opposite_move_focus}" if idx % 2 == 1 else f"move-focus {orientation_opposite_move_focus_other}"
66
- cmd += f"""{sep} {tmp} split-pane --{orientation} --title {a_host}wsl --size {size} {pane_cmd} """
67
- cmd += f"""{sep} swap-pane {orientation_swap} """
68
- else:
69
- raise NotImplementedError(f"❌ len(hosts) = {len(hosts)}. Only 1 or 2 hosts are supported.")
70
- print("✅ Terminal layout configured successfully!\n")
71
- return cmd
72
-
73
-
74
- def main(
75
- panes: Annotated[Optional[int], typer.Option("--panes", "-p", help="🔲 The number of panes to open.")] = 4,
76
- vertical: Annotated[bool, typer.Option("--vertical", "-V", help="↕️ Switch orientation to vertical from default horizontal.")] = False,
77
- window: Annotated[int, typer.Option("--window", "-w", help="🪟 The window ID to use.")] = 0,
78
- hosts: Annotated[Optional[list[str]], typer.Option("--hosts", "-H", help="🌐 The hosts to connect to.")] = None,
79
- ) -> None:
80
- print("\n" + "=" * 50)
81
- print("🖥️ Welcome to the Terminal Starter Tool")
82
- print("=" * 50 + "\n")
83
-
84
- if panes:
85
- print("🔲 Configuring panes...")
86
- cmd = f"wt --window {window} --colorScheme '{next(THEMES_ITER)}' pwsh -NoExit -Command '{next(INIT_COMMANDS_ITER)}' "
87
- cmd += f" `; new-tab --colorScheme '{next(THEMES_ITER)}' --profile pwsh --title 't2' --tabColor '#f59218' "
88
- cmd += f" `; new-tab --colorScheme '{next(THEMES_ITER)}' --profile pwsh --title 't3' --tabColor '#009999' "
89
- for idx in range(panes):
90
- if idx % 2 == 0:
91
- cmd += f" `; move-focus down split-pane --horizontal --size {next(SIZE_ITER)} --colorScheme '{next(THEMES_ITER)}' pwsh -NoExit -Command '{next(INIT_COMMANDS_ITER)}' "
92
- else:
93
- cmd += f" `; move-focus up split-pane --vertical --size {next(SIZE_ITER)} --colorScheme '{next(THEMES_ITER)}' pwsh -NoExit -Command '{next(INIT_COMMANDS_ITER)}' "
94
-
95
- else:
96
- if hosts is None:
97
- print("🌐 No hosts provided. Displaying options...")
98
- hosts = choose_from_options(msg="Select hosts:", options=get_ssh_hosts() + [THIS_MACHINE], multi=True, fzf=True)
99
- else:
100
- print("🌐 Using provided hosts:", hosts)
101
- assert isinstance(hosts, list)
102
- cmd = main_windows_and_wsl(window=window, hosts=hosts, orientation="vertical" if vertical else "horizontal")
103
-
104
- print("\n📋 Generated Command:")
105
- print("-" * 50)
106
- print(cmd)
107
- print("-" * 50 + "\n")
108
-
109
- # PROGRAM_PATH.write_text(cmd, encoding="utf-8")
110
- import subprocess
111
-
112
- subprocess.run(cmd, shell=True)
113
- print("✅ Command saved successfully!\n")
114
-
115
-
116
- def arg_parser() -> None:
117
- typer.run(main)
118
-
119
-
120
- if __name__ == "__main__":
121
- arg_parser()
@@ -1 +0,0 @@
1
- uv run --python 3.13 --no-dev --project $HOME/code/machineconfig choose_wezterm_theme $args[0]
@@ -1 +0,0 @@
1
- uv run --python 3.13 --no-dev --project $HOME/code/machineconfig cloud_copy $args
@@ -1 +0,0 @@
1
- uv run --python 3.13 --no-dev --project $HOME/code/machineconfig cloud_mount $args
@@ -1 +0,0 @@
1
- uv run --python 3.13 --no-dev --project $HOME/code/machineconfig cloud_sync $args
@@ -1,2 +0,0 @@
1
-
2
- uv run --python 3.13 --no-dev --project $HOME/code/machineconfig wifi_conn $args
@@ -1,17 +0,0 @@
1
- [console_scripts]
2
- agents = machineconfig.scripts.python.agents:main_from_parser
3
- choose_wezterm_theme = machineconfig.scripts.python.choose_wezterm_theme:main
4
- cloud_copy = machineconfig.scripts.python.cloud_copy:arg_parser
5
- cloud_mount = machineconfig.scripts.python.cloud_mount:arg_parser
6
- cloud_sync = machineconfig.scripts.python.cloud_sync:arg_parser
7
- croshell = machineconfig.scripts.python.croshell:arg_parser
8
- devops = machineconfig.scripts.python.devops:app
9
- fire = machineconfig.scripts.python.fire_jobs:main_from_parser
10
- ftpx = machineconfig.scripts.python.ftpx:main_from_parser
11
- initai = machineconfig.scripts.python.ai.initai:main
12
- kill_process = machineconfig.utils.procs:main
13
- mount_nfs = machineconfig.scripts.python.mount_nfs:main
14
- mount_nw_drive = machineconfig.scripts.python.mount_nw_drive:main
15
- sessions = machineconfig.scripts.python.sessions:main_from_parser
16
- start_slidev = machineconfig.scripts.python.start_slidev:arg_parser
17
- wifi_conn = machineconfig.scripts.python.wifi_conn:arg_parser
File without changes
File without changes
File without changes