machineconfig 2.0__py3-none-any.whl → 2.1__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 (235) hide show
  1. machineconfig/cluster/cloud_manager.py +0 -3
  2. machineconfig/cluster/data_transfer.py +0 -1
  3. machineconfig/cluster/file_manager.py +0 -1
  4. machineconfig/cluster/job_params.py +0 -3
  5. machineconfig/cluster/loader_runner.py +0 -3
  6. machineconfig/cluster/remote_machine.py +0 -1
  7. machineconfig/cluster/script_notify_upon_completion.py +0 -1
  8. machineconfig/cluster/sessions_managers/archive/create_zellij_template.py +3 -5
  9. machineconfig/cluster/sessions_managers/archive/session_managers.py +0 -1
  10. machineconfig/cluster/sessions_managers/enhanced_command_runner.py +17 -57
  11. machineconfig/cluster/sessions_managers/wt_local.py +36 -110
  12. machineconfig/cluster/sessions_managers/wt_local_manager.py +42 -112
  13. machineconfig/cluster/sessions_managers/wt_remote.py +23 -30
  14. machineconfig/cluster/sessions_managers/wt_remote_manager.py +20 -62
  15. machineconfig/cluster/sessions_managers/wt_utils/layout_generator.py +10 -15
  16. machineconfig/cluster/sessions_managers/wt_utils/process_monitor.py +27 -127
  17. machineconfig/cluster/sessions_managers/wt_utils/remote_executor.py +10 -43
  18. machineconfig/cluster/sessions_managers/wt_utils/session_manager.py +22 -101
  19. machineconfig/cluster/sessions_managers/wt_utils/status_reporter.py +11 -39
  20. machineconfig/cluster/sessions_managers/zellij_local.py +49 -102
  21. machineconfig/cluster/sessions_managers/zellij_local_manager.py +34 -78
  22. machineconfig/cluster/sessions_managers/zellij_remote.py +17 -24
  23. machineconfig/cluster/sessions_managers/zellij_remote_manager.py +7 -13
  24. machineconfig/cluster/sessions_managers/zellij_utils/example_usage.py +4 -2
  25. machineconfig/cluster/sessions_managers/zellij_utils/layout_generator.py +6 -6
  26. machineconfig/cluster/sessions_managers/zellij_utils/process_monitor.py +18 -88
  27. machineconfig/cluster/sessions_managers/zellij_utils/remote_executor.py +2 -6
  28. machineconfig/cluster/sessions_managers/zellij_utils/session_manager.py +12 -40
  29. machineconfig/cluster/sessions_managers/zellij_utils/status_reporter.py +3 -2
  30. machineconfig/cluster/templates/cli_click.py +0 -1
  31. machineconfig/cluster/templates/cli_gooey.py +0 -2
  32. machineconfig/cluster/templates/cli_trogon.py +0 -1
  33. machineconfig/cluster/templates/run_cloud.py +0 -1
  34. machineconfig/cluster/templates/run_cluster.py +0 -1
  35. machineconfig/cluster/templates/run_remote.py +0 -1
  36. machineconfig/cluster/templates/utils.py +26 -10
  37. machineconfig/jobs/__pycache__/__init__.cpython-313.pyc +0 -0
  38. machineconfig/jobs/linux/msc/cli_agents.sh +16 -0
  39. machineconfig/jobs/python/check_installations.py +1 -0
  40. machineconfig/jobs/python/create_bootable_media.py +0 -2
  41. machineconfig/jobs/python/python_ve_symlink.py +9 -11
  42. machineconfig/jobs/python/tasks.py +0 -1
  43. machineconfig/jobs/python/vscode/api.py +5 -5
  44. machineconfig/jobs/python/vscode/link_ve.py +13 -14
  45. machineconfig/jobs/python/vscode/select_interpreter.py +21 -22
  46. machineconfig/jobs/python/vscode/sync_code.py +9 -13
  47. machineconfig/jobs/python_custom_installers/__pycache__/__init__.cpython-313.pyc +0 -0
  48. machineconfig/jobs/python_custom_installers/archive/ngrok.py +13 -13
  49. machineconfig/jobs/python_custom_installers/dev/aider.py +7 -15
  50. machineconfig/jobs/python_custom_installers/dev/alacritty.py +9 -18
  51. machineconfig/jobs/python_custom_installers/dev/brave.py +10 -19
  52. machineconfig/jobs/python_custom_installers/dev/bypass_paywall.py +8 -15
  53. machineconfig/jobs/python_custom_installers/dev/code.py +14 -21
  54. machineconfig/jobs/python_custom_installers/dev/cursor.py +3 -14
  55. machineconfig/jobs/python_custom_installers/dev/docker_desktop.py +8 -7
  56. machineconfig/jobs/python_custom_installers/dev/espanso.py +15 -19
  57. machineconfig/jobs/python_custom_installers/dev/goes.py +5 -12
  58. machineconfig/jobs/python_custom_installers/dev/lvim.py +9 -17
  59. machineconfig/jobs/python_custom_installers/dev/nerdfont.py +12 -19
  60. machineconfig/jobs/python_custom_installers/dev/redis.py +12 -20
  61. machineconfig/jobs/python_custom_installers/dev/wezterm.py +12 -19
  62. machineconfig/jobs/python_custom_installers/dev/winget.py +5 -23
  63. machineconfig/jobs/python_custom_installers/docker.py +12 -21
  64. machineconfig/jobs/python_custom_installers/gh.py +11 -19
  65. machineconfig/jobs/python_custom_installers/hx.py +32 -16
  66. machineconfig/jobs/python_custom_installers/warp-cli.py +12 -20
  67. machineconfig/jobs/python_generic_installers/__pycache__/__init__.cpython-313.pyc +0 -0
  68. machineconfig/jobs/python_linux_installers/__pycache__/__init__.cpython-313.pyc +0 -0
  69. machineconfig/jobs/windows/archive/archive_pygraphviz.ps1 +1 -1
  70. machineconfig/jobs/windows/msc/cli_agents.bat +0 -0
  71. machineconfig/jobs/windows/msc/cli_agents.ps1 +0 -0
  72. machineconfig/jobs/windows/start_terminal.ps1 +1 -1
  73. machineconfig/profile/create.py +29 -22
  74. machineconfig/profile/create_hardlinks.py +26 -19
  75. machineconfig/profile/shell.py +51 -28
  76. machineconfig/scripts/__pycache__/__init__.cpython-313.pyc +0 -0
  77. machineconfig/scripts/cloud/init.sh +2 -2
  78. machineconfig/scripts/linux/checkout_versions +1 -1
  79. machineconfig/scripts/linux/choose_wezterm_theme +1 -1
  80. machineconfig/scripts/linux/cloud_copy +1 -1
  81. machineconfig/scripts/linux/cloud_manager +1 -1
  82. machineconfig/scripts/linux/cloud_mount +1 -1
  83. machineconfig/scripts/linux/cloud_repo_sync +1 -1
  84. machineconfig/scripts/linux/cloud_sync +1 -1
  85. machineconfig/scripts/linux/croshell +1 -1
  86. machineconfig/scripts/linux/devops +4 -6
  87. machineconfig/scripts/linux/fire +1 -1
  88. machineconfig/scripts/linux/fire_agents +3 -2
  89. machineconfig/scripts/linux/ftpx +1 -1
  90. machineconfig/scripts/linux/gh_models +1 -1
  91. machineconfig/scripts/linux/kill_process +1 -1
  92. machineconfig/scripts/linux/mcinit +1 -1
  93. machineconfig/scripts/linux/repos +1 -1
  94. machineconfig/scripts/linux/scheduler +1 -1
  95. machineconfig/scripts/linux/start_slidev +1 -1
  96. machineconfig/scripts/linux/start_terminals +1 -1
  97. machineconfig/scripts/linux/url2md +1 -1
  98. machineconfig/scripts/linux/warp-cli.sh +122 -0
  99. machineconfig/scripts/linux/wifi_conn +1 -1
  100. machineconfig/scripts/python/__pycache__/__init__.cpython-313.pyc +0 -0
  101. machineconfig/scripts/python/__pycache__/croshell.cpython-313.pyc +0 -0
  102. machineconfig/scripts/python/__pycache__/devops.cpython-313.pyc +0 -0
  103. machineconfig/scripts/python/__pycache__/devops_devapps_install.cpython-313.pyc +0 -0
  104. machineconfig/scripts/python/__pycache__/devops_update_repos.cpython-313.pyc +0 -0
  105. machineconfig/scripts/python/__pycache__/fire_jobs.cpython-313.pyc +0 -0
  106. machineconfig/scripts/python/ai/__init__.py +0 -0
  107. machineconfig/scripts/python/ai/__pycache__/__init__.cpython-313.pyc +0 -0
  108. machineconfig/scripts/python/ai/__pycache__/generate_files.cpython-313.pyc +0 -0
  109. machineconfig/scripts/python/ai/__pycache__/mcinit.cpython-313.pyc +0 -0
  110. machineconfig/scripts/python/ai/generate_files.py +84 -0
  111. machineconfig/scripts/python/ai/instructions/python/dev.instructions.md +2 -2
  112. machineconfig/scripts/python/ai/mcinit.py +7 -3
  113. machineconfig/scripts/python/ai/scripts/lint_and_type_check.sh +10 -5
  114. machineconfig/scripts/python/cloud_copy.py +1 -1
  115. machineconfig/scripts/python/cloud_mount.py +1 -1
  116. machineconfig/scripts/python/cloud_repo_sync.py +4 -4
  117. machineconfig/scripts/python/croshell.py +5 -3
  118. machineconfig/scripts/python/devops_add_identity.py +1 -1
  119. machineconfig/scripts/python/devops_add_ssh_key.py +1 -1
  120. machineconfig/scripts/python/devops_backup_retrieve.py +1 -1
  121. machineconfig/scripts/python/devops_update_repos.py +140 -52
  122. machineconfig/scripts/python/dotfile.py +1 -1
  123. machineconfig/scripts/python/fire_agents.py +28 -9
  124. machineconfig/scripts/python/fire_jobs.py +3 -4
  125. machineconfig/scripts/python/ftpx.py +2 -1
  126. machineconfig/scripts/python/helpers/__pycache__/__init__.cpython-313.pyc +0 -0
  127. machineconfig/scripts/python/helpers/__pycache__/helpers4.cpython-313.pyc +0 -0
  128. machineconfig/scripts/python/helpers/helpers2.py +2 -2
  129. machineconfig/scripts/python/helpers/helpers4.py +1 -2
  130. machineconfig/scripts/python/helpers/repo_sync_helpers.py +1 -1
  131. machineconfig/scripts/python/mount_nfs.py +1 -1
  132. machineconfig/scripts/python/mount_ssh.py +1 -1
  133. machineconfig/scripts/python/repos.py +1 -1
  134. machineconfig/scripts/python/start_slidev.py +1 -1
  135. machineconfig/scripts/python/wsl_windows_transfer.py +1 -1
  136. machineconfig/scripts/windows/checkout_version.ps1 +1 -3
  137. machineconfig/scripts/windows/choose_wezterm_theme.ps1 +1 -3
  138. machineconfig/scripts/windows/cloud_copy.ps1 +2 -6
  139. machineconfig/scripts/windows/cloud_manager.ps1 +1 -1
  140. machineconfig/scripts/windows/cloud_repo_sync.ps1 +1 -2
  141. machineconfig/scripts/windows/cloud_sync.ps1 +2 -2
  142. machineconfig/scripts/windows/croshell.ps1 +2 -2
  143. machineconfig/scripts/windows/devops.ps1 +1 -4
  144. machineconfig/scripts/windows/dotfile.ps1 +1 -3
  145. machineconfig/scripts/windows/fire.ps1 +1 -1
  146. machineconfig/scripts/windows/ftpx.ps1 +2 -2
  147. machineconfig/scripts/windows/gpt.ps1 +1 -1
  148. machineconfig/scripts/windows/kill_process.ps1 +1 -2
  149. machineconfig/scripts/windows/mcinit.ps1 +1 -1
  150. machineconfig/scripts/windows/mount_nfs.ps1 +1 -1
  151. machineconfig/scripts/windows/mount_ssh.ps1 +1 -1
  152. machineconfig/scripts/windows/pomodoro.ps1 +1 -1
  153. machineconfig/scripts/windows/py2exe.ps1 +1 -3
  154. machineconfig/scripts/windows/repos.ps1 +1 -1
  155. machineconfig/scripts/windows/scheduler.ps1 +1 -1
  156. machineconfig/scripts/windows/snapshot.ps1 +2 -2
  157. machineconfig/scripts/windows/start_slidev.ps1 +1 -1
  158. machineconfig/scripts/windows/start_terminals.ps1 +1 -1
  159. machineconfig/scripts/windows/wifi_conn.ps1 +1 -1
  160. machineconfig/scripts/windows/wsl_windows_transfer.ps1 +1 -3
  161. machineconfig/settings/lf/linux/lfrc +1 -1
  162. machineconfig/settings/linters/.ruff_cache/.gitignore +2 -0
  163. machineconfig/settings/linters/.ruff_cache/CACHEDIR.TAG +1 -0
  164. machineconfig/settings/lvim/windows/archive/config_additional.lua +1 -1
  165. machineconfig/settings/svim/linux/init.toml +1 -1
  166. machineconfig/settings/svim/windows/init.toml +1 -1
  167. machineconfig/setup_linux/web_shortcuts/croshell.sh +0 -54
  168. machineconfig/setup_linux/web_shortcuts/interactive.sh +6 -6
  169. machineconfig/setup_windows/web_shortcuts/all.ps1 +2 -2
  170. machineconfig/setup_windows/web_shortcuts/ascii_art.ps1 +1 -1
  171. machineconfig/setup_windows/web_shortcuts/croshell.ps1 +1 -1
  172. machineconfig/setup_windows/web_shortcuts/interactive.ps1 +5 -5
  173. machineconfig/setup_windows/wt_and_pwsh/install_fonts.ps1 +51 -15
  174. machineconfig/setup_windows/wt_and_pwsh/set_pwsh_theme.py +66 -12
  175. machineconfig/setup_windows/wt_and_pwsh/set_wt_settings.py +44 -36
  176. machineconfig/utils/ai/generate_file_checklist.py +8 -10
  177. machineconfig/utils/ai/url2md.py +4 -2
  178. machineconfig/utils/cloud/onedrive/setup_oauth.py +1 -0
  179. machineconfig/utils/cloud/onedrive/transaction.py +63 -98
  180. machineconfig/utils/code.py +60 -39
  181. machineconfig/utils/installer.py +27 -33
  182. machineconfig/utils/installer_utils/installer_abc.py +8 -7
  183. machineconfig/utils/installer_utils/installer_class.py +149 -70
  184. machineconfig/utils/links.py +22 -11
  185. machineconfig/utils/notifications.py +197 -0
  186. machineconfig/utils/options.py +29 -23
  187. machineconfig/utils/path.py +13 -6
  188. machineconfig/utils/path_reduced.py +485 -216
  189. machineconfig/utils/procs.py +47 -41
  190. machineconfig/utils/scheduling.py +0 -1
  191. machineconfig/utils/ssh.py +157 -76
  192. machineconfig/utils/terminal.py +82 -37
  193. machineconfig/utils/utils.py +12 -10
  194. machineconfig/utils/utils2.py +38 -48
  195. machineconfig/utils/utils5.py +183 -116
  196. machineconfig/utils/ve.py +9 -4
  197. {machineconfig-2.0.dist-info → machineconfig-2.1.dist-info}/METADATA +3 -2
  198. {machineconfig-2.0.dist-info → machineconfig-2.1.dist-info}/RECORD +200 -217
  199. machineconfig/jobs/__pycache__/__init__.cpython-311.pyc +0 -0
  200. machineconfig/jobs/python/__pycache__/__init__.cpython-311.pyc +0 -0
  201. machineconfig/jobs/python/__pycache__/python_ve_symlink.cpython-311.pyc +0 -0
  202. machineconfig/jobs/python/archive/python_tools.txt +0 -12
  203. machineconfig/jobs/python/vscode/__pycache__/select_interpreter.cpython-311.pyc +0 -0
  204. machineconfig/jobs/python_custom_installers/__pycache__/__init__.cpython-311.pyc +0 -0
  205. machineconfig/jobs/python_generic_installers/__pycache__/__init__.cpython-311.pyc +0 -0
  206. machineconfig/jobs/python_generic_installers/update.py +0 -3
  207. machineconfig/jobs/python_linux_installers/__pycache__/__init__.cpython-311.pyc +0 -0
  208. machineconfig/profile/__pycache__/__init__.cpython-311.pyc +0 -0
  209. machineconfig/profile/__pycache__/create.cpython-311.pyc +0 -0
  210. machineconfig/profile/__pycache__/shell.cpython-311.pyc +0 -0
  211. machineconfig/scripts/__pycache__/__init__.cpython-311.pyc +0 -0
  212. machineconfig/scripts/linux/activate_ve +0 -87
  213. machineconfig/scripts/python/__pycache__/__init__.cpython-311.pyc +0 -0
  214. machineconfig/scripts/python/__pycache__/cloud_copy.cpython-311.pyc +0 -0
  215. machineconfig/scripts/python/__pycache__/cloud_mount.cpython-311.pyc +0 -0
  216. machineconfig/scripts/python/__pycache__/cloud_sync.cpython-311.pyc +0 -0
  217. machineconfig/scripts/python/__pycache__/croshell.cpython-311.pyc +0 -0
  218. machineconfig/scripts/python/__pycache__/devops.cpython-311.pyc +0 -0
  219. machineconfig/scripts/python/__pycache__/devops_backup_retrieve.cpython-311.pyc +0 -0
  220. machineconfig/scripts/python/__pycache__/devops_devapps_install.cpython-311.pyc +0 -0
  221. machineconfig/scripts/python/__pycache__/devops_update_repos.cpython-311.pyc +0 -0
  222. machineconfig/scripts/python/__pycache__/fire_agents.cpython-311.pyc +0 -0
  223. machineconfig/scripts/python/__pycache__/fire_jobs.cpython-311.pyc +0 -0
  224. machineconfig/scripts/python/__pycache__/get_zellij_cmd.cpython-311.pyc +0 -0
  225. machineconfig/scripts/python/__pycache__/repos.cpython-311.pyc +0 -0
  226. machineconfig/scripts/python/ai/__pycache__/init.cpython-311.pyc +0 -0
  227. machineconfig/scripts/python/ai/__pycache__/mcinit.cpython-311.pyc +0 -0
  228. machineconfig/scripts/python/helpers/__pycache__/__init__.cpython-311.pyc +0 -0
  229. machineconfig/scripts/python/helpers/__pycache__/cloud_helpers.cpython-311.pyc +0 -0
  230. machineconfig/scripts/python/helpers/__pycache__/helpers2.cpython-311.pyc +0 -0
  231. machineconfig/scripts/python/helpers/__pycache__/helpers4.cpython-311.pyc +0 -0
  232. machineconfig/scripts/python/helpers/__pycache__/repo_sync_helpers.cpython-311.pyc +0 -0
  233. machineconfig/scripts/windows/activate_ve.ps1 +0 -54
  234. {machineconfig-2.0.dist-info → machineconfig-2.1.dist-info}/WHEEL +0 -0
  235. {machineconfig-2.0.dist-info → machineconfig-2.1.dist-info}/top_level.txt +0 -0
@@ -4,11 +4,11 @@ https://glitchbone.github.io/vscode-base16-term/#/3024
4
4
 
5
5
  """
6
6
 
7
-
8
- from machineconfig.utils.path_reduced import P as PathExtended
7
+ from machineconfig.utils.path_reduced import PathExtended as PathExtended
9
8
  from machineconfig.utils.utils import LIBRARY_ROOT
10
9
  from machineconfig.utils.installer_utils.installer_class import Installer
11
10
  import subprocess
11
+ from typing import Iterable
12
12
 
13
13
 
14
14
  nerd_fonts = {
@@ -17,13 +17,61 @@ nerd_fonts = {
17
17
  "filename_template_windows_amd_64": "CascadiaCode.zip",
18
18
  "filename_template_linux_amd_64": "CascadiaCode.zip",
19
19
  "strip_v": False,
20
- "exe_name": "nerd_fonts"
20
+ "exe_name": "nerd_fonts",
21
21
  }
22
22
 
23
23
 
24
- def install_nerd_fonts():
25
- print(f"\n{'='*80}\n📦 INSTALLING NERD FONTS 📦\n{'='*80}")
26
- # Step 1: download the required fonts that has all the glyphs and install them.
24
+ # Patterns to match any installed variant (NF, Nerd Font, Mono, Propo, style weights) of Cascadia/Caskaydia
25
+ # We'll compile them at runtime for flexibility. Keep them simple to avoid false positives.
26
+ REQUIRED_FONT_PATTERNS: tuple[str, ...] = (
27
+ r"caskaydiacove.*(nf|nerd ?font)",
28
+ r"cascadiacode.*(nf|nerd ?font)",
29
+ )
30
+
31
+
32
+ def _list_installed_fonts() -> list[str]:
33
+ """Return list of installed font file base names (without extension) on Windows.
34
+
35
+ Uses PowerShell to enumerate c:\\windows\\fonts because Python on *nix host can't rely on that path.
36
+ If PowerShell call fails (e.g. running on non-Windows), returns empty list so install proceeds.
37
+ """
38
+ try:
39
+ # Query only base names to make substring matching simpler; remove underscores like the PS script does.
40
+ cmd = [
41
+ "powershell.exe",
42
+ "-NoLogo",
43
+ "-NonInteractive",
44
+ "-Command",
45
+ "Get-ChildItem -Path C:/Windows/Fonts -File | Select-Object -ExpandProperty BaseName"
46
+ ]
47
+ res = subprocess.run(cmd, capture_output=True, text=True, check=True) # noqa: S603 S607 (trusted command)
48
+ fonts = [x.strip().replace("_", "") for x in res.stdout.splitlines() if x.strip() != ""]
49
+ return fonts
50
+ except Exception as exc: # noqa: BLE001
51
+ print(f"⚠️ Could not enumerate installed fonts (continuing with install). Reason: {exc}")
52
+ return []
53
+
54
+
55
+ def _missing_required_fonts(installed_fonts: Iterable[str]) -> list[str]:
56
+ import re
57
+
58
+ installed_norm = [f.lower().replace(" ", "") for f in installed_fonts]
59
+ missing: list[str] = []
60
+ for pattern in REQUIRED_FONT_PATTERNS:
61
+ regex = re.compile(pattern)
62
+ if not any(regex.search(f) for f in installed_norm):
63
+ missing.append(pattern)
64
+ return missing
65
+
66
+
67
+ def install_nerd_fonts() -> None:
68
+ print(f"\n{'=' * 80}\n📦 INSTALLING NERD FONTS 📦\n{'=' * 80}")
69
+ installed = _list_installed_fonts()
70
+ missing = _missing_required_fonts(installed)
71
+ if len(missing) == 0:
72
+ print("✅ Required Nerd Fonts already installed. Skipping download & install.")
73
+ return
74
+ print(f"🔍 Missing fonts detected: {', '.join(missing)}. Proceeding with installation...")
27
75
  print("🔍 Downloading Nerd Fonts package...")
28
76
  folder, _version_to_be_installed = Installer.from_dict(d=nerd_fonts, name="nerd_fonts").download(version=None)
29
77
 
@@ -35,20 +83,26 @@ def install_nerd_fonts():
35
83
  print("⚙️ Installing fonts via PowerShell...")
36
84
  file = PathExtended.tmpfile(suffix=".ps1")
37
85
  file.parent.mkdir(parents=True, exist_ok=True)
38
- content = LIBRARY_ROOT.joinpath("setup_windows/wt_and_pwsh/install_fonts.ps1").read_text(encoding="utf-8").replace(r".\fonts-to-be-installed", str(folder))
86
+ raw_content = LIBRARY_ROOT.joinpath("setup_windows/wt_and_pwsh/install_fonts.ps1").read_text(encoding="utf-8").replace(r".\fonts-to-be-installed", str(folder))
87
+ # PowerShell 5.1 can choke on certain unicode chars in some locales; keep ASCII only.
88
+ content = "".join(ch for ch in raw_content if ord(ch) < 128)
39
89
  file.write_text(content, encoding="utf-8")
40
- subprocess.run(rf"powershell.exe -executionpolicy Bypass -nologo -noninteractive -File {str(file)}", check=True)
90
+ try:
91
+ subprocess.run(rf"powershell.exe -executionpolicy Bypass -nologo -noninteractive -File {str(file)}", check=True)
92
+ except subprocess.CalledProcessError as cpe:
93
+ print(f"💥 Font installation script failed (continuing without abort): {cpe}")
94
+ return
41
95
 
42
96
  print("🗑️ Cleaning up temporary files...")
43
97
  folder.delete(sure=True)
44
- print(f"\n✅ Nerd Fonts installation complete! ✅\n{'='*80}")
98
+ print(f"\n✅ Nerd Fonts installation complete! ✅\n{'=' * 80}")
45
99
 
46
100
 
47
101
  def main():
48
- print(f"\n{'='*80}\n🎨 POWERSHELL THEME SETUP 🎨\n{'='*80}")
102
+ print(f"\n{'=' * 80}\n🎨 POWERSHELL THEME SETUP 🎨\n{'=' * 80}")
49
103
  install_nerd_fonts()
50
- print(f"\n✅ All PowerShell theme components installed successfully! ✅\n{'='*80}")
104
+ print(f"\n✅ All PowerShell theme components installed successfully! ✅\n{'=' * 80}")
51
105
 
52
106
 
53
- if __name__ == '__main__':
107
+ if __name__ == "__main__":
54
108
  pass
@@ -1,8 +1,7 @@
1
- """Set Windows Terminal Settings
2
- """
1
+ """Set Windows Terminal Settings"""
3
2
 
4
3
  from machineconfig.utils.utils2 import randstr, read_json
5
- from machineconfig.utils.path_reduced import P as PathExtended
4
+ from machineconfig.utils.path_reduced import PathExtended as PathExtended
6
5
  from machineconfig.utils.io_save import save_json
7
6
  import platform
8
7
  from machineconfig.utils.utils import LIBRARY_ROOT
@@ -26,13 +25,13 @@ All settings are available on GitHub: https://aka.ms/terminal-profiles-schema
26
25
  console = Console()
27
26
  system = platform.system() # Linux or Windows
28
27
 
29
- assert system == 'Windows', 'This script is only for Windows.'
28
+ assert system == "Windows", "This script is only for Windows."
30
29
 
31
30
 
32
31
  class TerminalSettings(object):
33
32
  def __init__(self):
34
33
  # Grabbing Terminal Settings file:
35
- print(f"\n{'='*80}\n🔍 INITIALIZING TERMINAL SETTINGS 🔍\n{'='*80}")
34
+ print(f"\n{'=' * 80}\n🔍 INITIALIZING TERMINAL SETTINGS 🔍\n{'=' * 80}")
36
35
  tmp = os.getenv("LOCALAPPDATA")
37
36
  if not isinstance(tmp, str):
38
37
  print("❌ ERROR: Could not find LOCALAPPDATA environment variable!")
@@ -69,15 +68,16 @@ class TerminalSettings(object):
69
68
 
70
69
  # 1- Customizing Powershell========================================================
71
70
  # as opposed to Windows Powershell
72
- def customize_powershell(self, nerd_font: bool=True):
71
+ def customize_powershell(self, nerd_font: bool = True):
73
72
  print("\n🛠️ Customizing PowerShell profile...")
74
- pwsh: dict[str, Any] = dict(name="PowerShell",
75
- commandline="pwsh",
76
- hidden=False,
77
- opacity=87,
78
- # guid="{" + str(uuid4()) + "}", # WT doesn't accept any GUID to identify pwsh
79
- startingDirectory="%USERPROFILE%", # "%USERPROFILE%", # None: inherent from parent process.
80
- )
73
+ pwsh: dict[str, Any] = dict(
74
+ name="PowerShell",
75
+ commandline="pwsh",
76
+ hidden=False,
77
+ opacity=87,
78
+ # guid="{" + str(uuid4()) + "}", # WT doesn't accept any GUID to identify pwsh
79
+ startingDirectory="%USERPROFILE%", # "%USERPROFILE%", # None: inherent from parent process.
80
+ )
81
81
  if nerd_font:
82
82
  print("🔤 Setting PowerShell font to CaskaydiaCove Nerd Font...")
83
83
  pwsh["font"] = dict(face="CaskaydiaCove Nerd Font") # because oh-my-posh uses glyphs from this font.
@@ -102,12 +102,12 @@ class TerminalSettings(object):
102
102
 
103
103
  def add_croshell(self):
104
104
  print("\n🐊 Adding croshell profile...")
105
- croshell = dict(name="croshell",
106
- guid="{" + str(uuid4()) + "}",
107
- # commandline=f"powershell.exe -Command \"{activate} ipython -i -c 'from crocodile.toolbox import *'\"",
108
- commandline=f'powershell.exe -Command "{LIBRARY_ROOT.as_posix()}/scripts/windows/croshell.ps1"',
109
- startingDirectory="%USERPROFILE%", # "%USERPROFILE%", # None: inherent from parent process.
110
- )
105
+ croshell = dict(
106
+ name="croshell",
107
+ guid="{" + str(uuid4()) + "}",
108
+ commandline=f'powershell.exe -Command "{LIBRARY_ROOT.as_posix()}/scripts/windows/croshell.ps1"',
109
+ startingDirectory="%USERPROFILE%", # "%USERPROFILE%", # None: inherent from parent process.
110
+ )
111
111
  # startingDirectory = None means: inheret from parent process, which will is the default, which point to /System32
112
112
  # Launching a new profile with ctr+shift+2 is equivalent to: wt --profile croshell -d . --new-tab
113
113
  for profile in self.profs:
@@ -122,12 +122,13 @@ class TerminalSettings(object):
122
122
  def add_ubuntu(self):
123
123
  print("\n🐧 Adding Ubuntu WSL profile...")
124
124
  # Add Ubunto if it is not there.
125
- ubuntu = dict(name="Ubuntu",
126
- commandline="wsl -d Ubuntu -- cd ~",
127
- hidden=False,
128
- guid="{" + str(uuid4()) + "}",
129
- startingDirectory="%USERPROFILE%", # "%USERPROFILE%", # None: inherent from parent process.
130
- )
125
+ ubuntu = dict(
126
+ name="Ubuntu",
127
+ commandline="wsl -d Ubuntu -- cd ~",
128
+ hidden=False,
129
+ guid="{" + str(uuid4()) + "}",
130
+ startingDirectory="%USERPROFILE%", # "%USERPROFILE%", # None: inherent from parent process.
131
+ )
131
132
  if not any(x.get("name") == "Ubuntu" for x in self.profs):
132
133
  self.profs.append(ubuntu)
133
134
  console.print(Panel("✅ Added Ubuntu WSL profile", title="[bold blue]Terminal Settings[/bold blue]", border_style="blue"))
@@ -141,19 +142,26 @@ class TerminalSettings(object):
141
142
  pwsh = croshell = ubuntu = wpwsh = cmd = azure = None
142
143
  for profile in self.profs:
143
144
  name = profile["name"]
144
- if name == "PowerShell": pwsh = profile
145
- elif name == "croshell": croshell = profile
146
- elif name == "Ubuntu": ubuntu = profile
147
- elif name == "Windows PowerShell": wpwsh = profile
148
- elif name == "Command Prompt": cmd = profile
149
- elif name == "Azure Cloud Shell": azure = profile
150
- else: others.append(profile)
145
+ if name == "PowerShell":
146
+ pwsh = profile
147
+ elif name == "croshell":
148
+ croshell = profile
149
+ elif name == "Ubuntu":
150
+ ubuntu = profile
151
+ elif name == "Windows PowerShell":
152
+ wpwsh = profile
153
+ elif name == "Command Prompt":
154
+ cmd = profile
155
+ elif name == "Azure Cloud Shell":
156
+ azure = profile
157
+ else:
158
+ others.append(profile)
151
159
  self.profs = [item for item in [pwsh, croshell, ubuntu, wpwsh, cmd, azure] + others if item is not None]
152
160
  console.print(Panel("✅ Profile order standardized", title="[bold blue]Terminal Settings[/bold blue]", border_style="blue"))
153
161
 
154
162
 
155
163
  def main():
156
- print(f"\n{'='*80}\n🖥️ WINDOWS TERMINAL SETUP 🖥️\n{'='*80}")
164
+ print(f"\n{'=' * 80}\n🖥️ WINDOWS TERMINAL SETUP 🖥️\n{'=' * 80}")
157
165
  shell = {"powershell": "pwsh.exe", "Windows Powershell": "powershell.exe"}["powershell"].split(".exe", maxsplit=1)[0]
158
166
  if shell == "pwsh":
159
167
  print("🚀 Starting Windows Terminal configuration with PowerShell...")
@@ -167,15 +175,15 @@ def main():
167
175
  ts.standardize_profiles_order()
168
176
 
169
177
  print("⌨️ Adding keyboard shortcut for pane zoom (ctrl+shift+z)...")
170
- ts.dat['actions'].append({'command': 'togglePaneZoom', 'keys': 'ctrl+shift+z'})
178
+ ts.dat["actions"].append({"command": "togglePaneZoom", "keys": "ctrl+shift+z"})
171
179
 
172
180
  ts.save_terminal_settings()
173
- print(f"\n{'='*80}\n✨ WINDOWS TERMINAL SETUP COMPLETE ✨\n{'='*80}")
181
+ print(f"\n{'=' * 80}\n✨ WINDOWS TERMINAL SETUP COMPLETE ✨\n{'=' * 80}")
174
182
  else:
175
183
  error_msg = "❌ ERROR: Only PowerShell is supported, not Windows PowerShell!"
176
184
  print(error_msg)
177
185
  raise NotImplementedError(error_msg)
178
186
 
179
187
 
180
- if __name__ == '__main__':
188
+ if __name__ == "__main__":
181
189
  pass
@@ -7,20 +7,19 @@ from rich.panel import Panel
7
7
 
8
8
 
9
9
  def generate_file_checklist(repo_root: Union[str, Path], exclude_dirs: Optional[List[str]] = None) -> Path:
10
-
11
- actual_exclude_dirs: List[str] = ['.venv', '.git', '__pycache__', 'build', 'dist', '*.egg-info']
10
+ actual_exclude_dirs: List[str] = [".venv", ".git", "__pycache__", "build", "dist", "*.egg-info"]
12
11
  if exclude_dirs is not None:
13
12
  actual_exclude_dirs = exclude_dirs
14
13
  repo_root = Path(repo_root).expanduser().absolute()
15
14
  output_path: Path = repo_root / ".ai" / "repo_task" / "file_checklist.md"
16
15
  py_files: List[Path] = []
17
- for filepath in repo_root.glob('**/*.py'):
16
+ for filepath in repo_root.glob("**/*.py"):
18
17
  if any(excl in filepath.parts for excl in actual_exclude_dirs) or any(filepath.match(f"**/{excl}/**") for excl in actual_exclude_dirs) or filepath.name == "__init__.py":
19
18
  continue
20
19
  py_files.append(filepath.relative_to(repo_root))
21
20
 
22
21
  sh_files: List[Path] = []
23
- for filepath in repo_root.glob('**/*.sh'):
22
+ for filepath in repo_root.glob("**/*.sh"):
24
23
  if any(excl in filepath.parts for excl in actual_exclude_dirs) or any(filepath.match(f"**/{excl}/**") for excl in actual_exclude_dirs):
25
24
  continue
26
25
  sh_files.append(filepath.relative_to(repo_root))
@@ -47,17 +46,16 @@ def generate_file_checklist(repo_root: Union[str, Path], exclude_dirs: Optional[
47
46
  def main() -> None:
48
47
  import argparse
49
48
 
50
- parser = argparse.ArgumentParser(description='Generate a markdown file with checkboxes for all .py and .sh files.')
51
- parser.add_argument('--repo', '-r', type=str, default=str(Path.cwd()), help='Repository root path. Defaults to current working directory.')
52
- parser.add_argument('--exclude', '-e', nargs='+', type=str,
53
- help='Additional directories to exclude (by default excludes .venv, .git, __pycache__, build, dist, *.egg-info)')
49
+ parser = argparse.ArgumentParser(description="Generate a markdown file with checkboxes for all .py and .sh files.")
50
+ parser.add_argument("--repo", "-r", type=str, default=str(Path.cwd()), help="Repository root path. Defaults to current working directory.")
51
+ parser.add_argument("--exclude", "-e", nargs="+", type=str, help="Additional directories to exclude (by default excludes .venv, .git, __pycache__, build, dist, *.egg-info)")
54
52
 
55
53
  args = parser.parse_args()
56
54
 
57
- exclude_dirs: List[str] = ['.venv', '.git', '__pycache__', 'build', 'dist', '*.egg-info']
55
+ exclude_dirs: List[str] = [".venv", ".git", "__pycache__", "build", "dist", "*.egg-info"]
58
56
  if args.exclude:
59
57
  exclude_dirs.extend(args.exclude)
60
- if args.repo == '':
58
+ if args.repo == "":
61
59
  print("Error: Repository path cannot be empty.")
62
60
  return
63
61
 
@@ -46,7 +46,8 @@ print(f"✅ Found {len(relevant_urls)} relevant URLs. Preparing to convert to Ma
46
46
 
47
47
  commands: list[str] = []
48
48
  for a_url in relevant_urls:
49
- commands.append(f"""curl {a_url} | html2markdown --output {op_dir.joinpath(a_url.split('/')[-1] + "_" + randstr(5) + ".md")} """)
49
+ commands.append(f"""curl {a_url} | html2markdown --output {op_dir.joinpath(a_url.split("/")[-1] + "_" + randstr(5) + ".md")} """)
50
+
50
51
 
51
52
  def run_command(cmd: str) -> bool:
52
53
  try:
@@ -57,6 +58,7 @@ def run_command(cmd: str) -> bool:
57
58
  print(f"❌ Error with command: {cmd[:60]}...\n{str(e)}")
58
59
  return False
59
60
 
61
+
60
62
  def main():
61
63
  cpu_count = multiprocessing.cpu_count()
62
64
  max_processes = min(20, cpu_count)
@@ -78,6 +80,6 @@ def main():
78
80
 
79
81
  print(f"📂 Output saved to: {op_dir}\n")
80
82
 
83
+
81
84
  if __name__ == "__main__":
82
85
  main()
83
-
@@ -15,6 +15,7 @@ sys.path.insert(0, str(Path(__file__).parent))
15
15
  # from transaction import setup_oauth_authentication, CLIENT_ID, CLIENT_SECRET, REDIRECT_URI
16
16
  from machineconfig.utils.cloud.onedrive.transaction import CLIENT_ID, CLIENT_SECRET, REDIRECT_URI, setup_oauth_authentication
17
17
 
18
+
18
19
  def main():
19
20
  """Main setup function."""
20
21
  print("🔧 OneDrive OAuth Setup")