machineconfig 1.97__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 (268) hide show
  1. machineconfig/cluster/cloud_manager.py +22 -29
  2. machineconfig/cluster/data_transfer.py +2 -3
  3. machineconfig/cluster/distribute.py +0 -2
  4. machineconfig/cluster/file_manager.py +4 -5
  5. machineconfig/cluster/job_params.py +1 -4
  6. machineconfig/cluster/loader_runner.py +8 -11
  7. machineconfig/cluster/remote_machine.py +4 -5
  8. machineconfig/cluster/script_execution.py +2 -2
  9. machineconfig/cluster/script_notify_upon_completion.py +0 -1
  10. machineconfig/cluster/sessions_managers/archive/create_zellij_template.py +4 -6
  11. machineconfig/cluster/sessions_managers/archive/session_managers.py +0 -1
  12. machineconfig/cluster/sessions_managers/enhanced_command_runner.py +35 -75
  13. machineconfig/cluster/sessions_managers/wt_local.py +113 -185
  14. machineconfig/cluster/sessions_managers/wt_local_manager.py +127 -197
  15. machineconfig/cluster/sessions_managers/wt_remote.py +60 -67
  16. machineconfig/cluster/sessions_managers/wt_remote_manager.py +110 -149
  17. machineconfig/cluster/sessions_managers/wt_utils/layout_generator.py +61 -64
  18. machineconfig/cluster/sessions_managers/wt_utils/process_monitor.py +72 -172
  19. machineconfig/cluster/sessions_managers/wt_utils/remote_executor.py +27 -60
  20. machineconfig/cluster/sessions_managers/wt_utils/session_manager.py +58 -137
  21. machineconfig/cluster/sessions_managers/wt_utils/status_reporter.py +46 -74
  22. machineconfig/cluster/sessions_managers/zellij_local.py +91 -147
  23. machineconfig/cluster/sessions_managers/zellij_local_manager.py +165 -190
  24. machineconfig/cluster/sessions_managers/zellij_remote.py +51 -58
  25. machineconfig/cluster/sessions_managers/zellij_remote_manager.py +40 -46
  26. machineconfig/cluster/sessions_managers/zellij_utils/example_usage.py +19 -17
  27. machineconfig/cluster/sessions_managers/zellij_utils/layout_generator.py +30 -31
  28. machineconfig/cluster/sessions_managers/zellij_utils/process_monitor.py +64 -134
  29. machineconfig/cluster/sessions_managers/zellij_utils/remote_executor.py +7 -11
  30. machineconfig/cluster/sessions_managers/zellij_utils/session_manager.py +27 -55
  31. machineconfig/cluster/sessions_managers/zellij_utils/status_reporter.py +14 -13
  32. machineconfig/cluster/templates/cli_click.py +0 -1
  33. machineconfig/cluster/templates/cli_gooey.py +0 -2
  34. machineconfig/cluster/templates/cli_trogon.py +0 -1
  35. machineconfig/cluster/templates/run_cloud.py +0 -1
  36. machineconfig/cluster/templates/run_cluster.py +0 -1
  37. machineconfig/cluster/templates/run_remote.py +0 -1
  38. machineconfig/cluster/templates/utils.py +27 -11
  39. machineconfig/jobs/__pycache__/__init__.cpython-313.pyc +0 -0
  40. machineconfig/jobs/linux/msc/cli_agents.sh +16 -0
  41. machineconfig/jobs/python/check_installations.py +9 -9
  42. machineconfig/jobs/python/create_bootable_media.py +0 -2
  43. machineconfig/jobs/python/python_cargo_build_share.py +2 -2
  44. machineconfig/jobs/python/python_ve_symlink.py +9 -11
  45. machineconfig/jobs/python/tasks.py +0 -1
  46. machineconfig/jobs/python/vscode/api.py +5 -5
  47. machineconfig/jobs/python/vscode/link_ve.py +20 -21
  48. machineconfig/jobs/python/vscode/select_interpreter.py +28 -29
  49. machineconfig/jobs/python/vscode/sync_code.py +14 -18
  50. machineconfig/jobs/python_custom_installers/__pycache__/__init__.cpython-313.pyc +0 -0
  51. machineconfig/jobs/python_custom_installers/archive/ngrok.py +15 -15
  52. machineconfig/jobs/python_custom_installers/dev/aider.py +10 -18
  53. machineconfig/jobs/python_custom_installers/dev/alacritty.py +12 -21
  54. machineconfig/jobs/python_custom_installers/dev/brave.py +13 -22
  55. machineconfig/jobs/python_custom_installers/dev/bypass_paywall.py +13 -20
  56. machineconfig/jobs/python_custom_installers/dev/code.py +17 -24
  57. machineconfig/jobs/python_custom_installers/dev/cursor.py +10 -21
  58. machineconfig/jobs/python_custom_installers/dev/docker_desktop.py +12 -11
  59. machineconfig/jobs/python_custom_installers/dev/espanso.py +19 -23
  60. machineconfig/jobs/python_custom_installers/dev/goes.py +9 -16
  61. machineconfig/jobs/python_custom_installers/dev/lvim.py +13 -21
  62. machineconfig/jobs/python_custom_installers/dev/nerdfont.py +15 -22
  63. machineconfig/jobs/python_custom_installers/dev/redis.py +15 -23
  64. machineconfig/jobs/python_custom_installers/dev/wezterm.py +15 -22
  65. machineconfig/jobs/python_custom_installers/dev/winget.py +32 -50
  66. machineconfig/jobs/python_custom_installers/docker.py +15 -24
  67. machineconfig/jobs/python_custom_installers/gh.py +18 -26
  68. machineconfig/jobs/python_custom_installers/hx.py +33 -17
  69. machineconfig/jobs/python_custom_installers/warp-cli.py +15 -23
  70. machineconfig/jobs/python_generic_installers/__pycache__/__init__.cpython-313.pyc +0 -0
  71. machineconfig/jobs/python_generic_installers/config.json +412 -389
  72. machineconfig/jobs/python_linux_installers/__pycache__/__init__.cpython-313.pyc +0 -0
  73. machineconfig/jobs/python_windows_installers/dev/config.json +1 -1
  74. machineconfig/jobs/windows/archive/archive_pygraphviz.ps1 +1 -1
  75. machineconfig/jobs/windows/msc/cli_agents.bat +0 -0
  76. machineconfig/jobs/windows/msc/cli_agents.ps1 +0 -0
  77. machineconfig/jobs/windows/start_terminal.ps1 +1 -1
  78. machineconfig/logger.py +50 -0
  79. machineconfig/profile/create.py +50 -36
  80. machineconfig/profile/create_hardlinks.py +33 -26
  81. machineconfig/profile/shell.py +87 -60
  82. machineconfig/scripts/__pycache__/__init__.cpython-313.pyc +0 -0
  83. machineconfig/scripts/cloud/init.sh +2 -2
  84. machineconfig/scripts/linux/checkout_versions +1 -1
  85. machineconfig/scripts/linux/choose_wezterm_theme +1 -1
  86. machineconfig/scripts/linux/cloud_copy +1 -1
  87. machineconfig/scripts/linux/cloud_manager +1 -1
  88. machineconfig/scripts/linux/cloud_mount +1 -1
  89. machineconfig/scripts/linux/cloud_repo_sync +1 -1
  90. machineconfig/scripts/linux/cloud_sync +1 -1
  91. machineconfig/scripts/linux/croshell +1 -1
  92. machineconfig/scripts/linux/devops +3 -5
  93. machineconfig/scripts/linux/fire +2 -1
  94. machineconfig/scripts/linux/fire_agents +3 -3
  95. machineconfig/scripts/linux/ftpx +1 -1
  96. machineconfig/scripts/linux/gh_models +1 -1
  97. machineconfig/scripts/linux/kill_process +1 -1
  98. machineconfig/scripts/linux/mcinit +2 -2
  99. machineconfig/scripts/linux/repos +1 -1
  100. machineconfig/scripts/linux/scheduler +1 -1
  101. machineconfig/scripts/linux/start_slidev +1 -1
  102. machineconfig/scripts/linux/start_terminals +1 -1
  103. machineconfig/scripts/linux/url2md +1 -1
  104. machineconfig/scripts/linux/warp-cli.sh +122 -0
  105. machineconfig/scripts/linux/wifi_conn +1 -1
  106. machineconfig/scripts/python/__pycache__/__init__.cpython-313.pyc +0 -0
  107. machineconfig/scripts/python/__pycache__/croshell.cpython-313.pyc +0 -0
  108. machineconfig/scripts/python/__pycache__/devops.cpython-313.pyc +0 -0
  109. machineconfig/scripts/python/__pycache__/devops_devapps_install.cpython-313.pyc +0 -0
  110. machineconfig/scripts/python/__pycache__/devops_update_repos.cpython-313.pyc +0 -0
  111. machineconfig/scripts/python/__pycache__/fire_jobs.cpython-313.pyc +0 -0
  112. machineconfig/scripts/python/ai/__init__.py +0 -0
  113. machineconfig/scripts/python/ai/__pycache__/__init__.cpython-313.pyc +0 -0
  114. machineconfig/scripts/python/ai/__pycache__/generate_files.cpython-313.pyc +0 -0
  115. machineconfig/scripts/python/ai/__pycache__/mcinit.cpython-313.pyc +0 -0
  116. machineconfig/scripts/python/ai/chatmodes/Thinking-Beast-Mode.chatmode.md +337 -0
  117. machineconfig/scripts/python/ai/chatmodes/Ultimate-Transparent-Thinking-Beast-Mode.chatmode.md +644 -0
  118. machineconfig/scripts/python/ai/chatmodes/deepResearch.chatmode.md +81 -0
  119. machineconfig/scripts/python/ai/configs/.gemini/settings.json +81 -0
  120. machineconfig/scripts/python/ai/generate_files.py +84 -0
  121. machineconfig/scripts/python/ai/instructions/python/dev.instructions.md +45 -0
  122. machineconfig/scripts/python/ai/mcinit.py +107 -0
  123. machineconfig/scripts/python/ai/prompts/allLintersAndTypeCheckers.prompt.md +5 -0
  124. machineconfig/scripts/python/ai/prompts/research-report-skeleton.prompt.md +38 -0
  125. machineconfig/scripts/python/ai/scripts/lint_and_type_check.sh +52 -0
  126. machineconfig/scripts/python/archive/tmate_conn.py +5 -5
  127. machineconfig/scripts/python/archive/tmate_start.py +3 -3
  128. machineconfig/scripts/python/choose_wezterm_theme.py +2 -2
  129. machineconfig/scripts/python/cloud_copy.py +20 -19
  130. machineconfig/scripts/python/cloud_mount.py +10 -8
  131. machineconfig/scripts/python/cloud_repo_sync.py +15 -15
  132. machineconfig/scripts/python/cloud_sync.py +1 -1
  133. machineconfig/scripts/python/croshell.py +18 -16
  134. machineconfig/scripts/python/devops.py +6 -6
  135. machineconfig/scripts/python/devops_add_identity.py +9 -7
  136. machineconfig/scripts/python/devops_add_ssh_key.py +19 -19
  137. machineconfig/scripts/python/devops_backup_retrieve.py +14 -14
  138. machineconfig/scripts/python/devops_devapps_install.py +3 -3
  139. machineconfig/scripts/python/devops_update_repos.py +141 -53
  140. machineconfig/scripts/python/dotfile.py +3 -3
  141. machineconfig/scripts/python/fire_agents.py +202 -41
  142. machineconfig/scripts/python/fire_jobs.py +20 -21
  143. machineconfig/scripts/python/ftpx.py +4 -3
  144. machineconfig/scripts/python/gh_models.py +94 -94
  145. machineconfig/scripts/python/helpers/__pycache__/__init__.cpython-313.pyc +0 -0
  146. machineconfig/scripts/python/helpers/__pycache__/helpers4.cpython-313.pyc +0 -0
  147. machineconfig/scripts/python/helpers/cloud_helpers.py +3 -3
  148. machineconfig/scripts/python/helpers/helpers2.py +3 -3
  149. machineconfig/scripts/python/helpers/helpers4.py +8 -7
  150. machineconfig/scripts/python/helpers/helpers5.py +7 -7
  151. machineconfig/scripts/python/helpers/repo_sync_helpers.py +2 -2
  152. machineconfig/scripts/python/mount_nfs.py +4 -3
  153. machineconfig/scripts/python/mount_nw_drive.py +4 -4
  154. machineconfig/scripts/python/mount_ssh.py +4 -3
  155. machineconfig/scripts/python/repos.py +9 -9
  156. machineconfig/scripts/python/scheduler.py +1 -1
  157. machineconfig/scripts/python/start_slidev.py +9 -8
  158. machineconfig/scripts/python/start_terminals.py +1 -1
  159. machineconfig/scripts/python/viewer.py +40 -40
  160. machineconfig/scripts/python/wifi_conn.py +65 -66
  161. machineconfig/scripts/python/wsl_windows_transfer.py +2 -2
  162. machineconfig/scripts/windows/checkout_version.ps1 +1 -3
  163. machineconfig/scripts/windows/choose_wezterm_theme.ps1 +1 -3
  164. machineconfig/scripts/windows/cloud_copy.ps1 +2 -6
  165. machineconfig/scripts/windows/cloud_manager.ps1 +1 -1
  166. machineconfig/scripts/windows/cloud_repo_sync.ps1 +1 -2
  167. machineconfig/scripts/windows/cloud_sync.ps1 +2 -2
  168. machineconfig/scripts/windows/croshell.ps1 +2 -2
  169. machineconfig/scripts/windows/devops.ps1 +1 -4
  170. machineconfig/scripts/windows/dotfile.ps1 +1 -3
  171. machineconfig/scripts/windows/fire.ps1 +1 -1
  172. machineconfig/scripts/windows/ftpx.ps1 +2 -2
  173. machineconfig/scripts/windows/gpt.ps1 +1 -1
  174. machineconfig/scripts/windows/kill_process.ps1 +1 -2
  175. machineconfig/scripts/windows/mcinit.ps1 +2 -2
  176. machineconfig/scripts/windows/mount_nfs.ps1 +1 -1
  177. machineconfig/scripts/windows/mount_ssh.ps1 +1 -1
  178. machineconfig/scripts/windows/pomodoro.ps1 +1 -1
  179. machineconfig/scripts/windows/py2exe.ps1 +1 -3
  180. machineconfig/scripts/windows/repos.ps1 +1 -1
  181. machineconfig/scripts/windows/scheduler.ps1 +1 -1
  182. machineconfig/scripts/windows/snapshot.ps1 +2 -2
  183. machineconfig/scripts/windows/start_slidev.ps1 +1 -1
  184. machineconfig/scripts/windows/start_terminals.ps1 +1 -1
  185. machineconfig/scripts/windows/wifi_conn.ps1 +1 -1
  186. machineconfig/scripts/windows/wsl_windows_transfer.ps1 +1 -3
  187. machineconfig/settings/lf/linux/lfrc +1 -1
  188. machineconfig/settings/linters/.ruff.toml +2 -2
  189. machineconfig/settings/linters/.ruff_cache/.gitignore +2 -0
  190. machineconfig/settings/linters/.ruff_cache/CACHEDIR.TAG +1 -0
  191. machineconfig/settings/lvim/windows/archive/config_additional.lua +1 -1
  192. machineconfig/settings/shells/ipy/profiles/default/startup/playext.py +71 -71
  193. machineconfig/settings/shells/wt/settings.json +8 -8
  194. machineconfig/settings/svim/linux/init.toml +1 -1
  195. machineconfig/settings/svim/windows/init.toml +1 -1
  196. machineconfig/setup_linux/web_shortcuts/croshell.sh +0 -54
  197. machineconfig/setup_linux/web_shortcuts/interactive.sh +6 -6
  198. machineconfig/setup_linux/web_shortcuts/tmp.sh +2 -0
  199. machineconfig/setup_windows/web_shortcuts/all.ps1 +2 -2
  200. machineconfig/setup_windows/web_shortcuts/ascii_art.ps1 +1 -1
  201. machineconfig/setup_windows/web_shortcuts/croshell.ps1 +1 -1
  202. machineconfig/setup_windows/web_shortcuts/interactive.ps1 +5 -5
  203. machineconfig/setup_windows/wt_and_pwsh/install_fonts.ps1 +51 -15
  204. machineconfig/setup_windows/wt_and_pwsh/set_pwsh_theme.py +75 -18
  205. machineconfig/setup_windows/wt_and_pwsh/set_wt_settings.py +52 -42
  206. machineconfig/utils/ai/browser_user_wrapper.py +5 -5
  207. machineconfig/utils/ai/generate_file_checklist.py +19 -22
  208. machineconfig/utils/ai/url2md.py +5 -3
  209. machineconfig/utils/cloud/onedrive/setup_oauth.py +5 -4
  210. machineconfig/utils/cloud/onedrive/transaction.py +192 -227
  211. machineconfig/utils/code.py +71 -43
  212. machineconfig/utils/installer.py +77 -85
  213. machineconfig/utils/installer_utils/installer_abc.py +29 -17
  214. machineconfig/utils/installer_utils/installer_class.py +188 -83
  215. machineconfig/utils/io_save.py +3 -15
  216. machineconfig/utils/links.py +22 -11
  217. machineconfig/utils/notifications.py +197 -0
  218. machineconfig/utils/options.py +38 -25
  219. machineconfig/utils/path.py +18 -6
  220. machineconfig/utils/path_reduced.py +637 -316
  221. machineconfig/utils/procs.py +69 -63
  222. machineconfig/utils/scheduling.py +11 -13
  223. machineconfig/utils/ssh.py +351 -0
  224. machineconfig/utils/terminal.py +225 -0
  225. machineconfig/utils/utils.py +13 -12
  226. machineconfig/utils/utils2.py +43 -10
  227. machineconfig/utils/utils5.py +242 -46
  228. machineconfig/utils/ve.py +11 -6
  229. {machineconfig-1.97.dist-info → machineconfig-2.1.dist-info}/METADATA +15 -9
  230. {machineconfig-1.97.dist-info → machineconfig-2.1.dist-info}/RECORD +232 -235
  231. machineconfig/cluster/self_ssh.py +0 -57
  232. machineconfig/jobs/__pycache__/__init__.cpython-311.pyc +0 -0
  233. machineconfig/jobs/python/__pycache__/__init__.cpython-311.pyc +0 -0
  234. machineconfig/jobs/python/archive/python_tools.txt +0 -12
  235. machineconfig/jobs/python/vscode/__pycache__/select_interpreter.cpython-311.pyc +0 -0
  236. machineconfig/jobs/python_custom_installers/__pycache__/__init__.cpython-311.pyc +0 -0
  237. machineconfig/jobs/python_generic_installers/__pycache__/__init__.cpython-311.pyc +0 -0
  238. machineconfig/jobs/python_generic_installers/update.py +0 -3
  239. machineconfig/jobs/python_linux_installers/__pycache__/__init__.cpython-311.pyc +0 -0
  240. machineconfig/profile/__pycache__/__init__.cpython-311.pyc +0 -0
  241. machineconfig/profile/__pycache__/create.cpython-311.pyc +0 -0
  242. machineconfig/profile/__pycache__/shell.cpython-311.pyc +0 -0
  243. machineconfig/scripts/__pycache__/__init__.cpython-311.pyc +0 -0
  244. machineconfig/scripts/linux/activate_ve +0 -87
  245. machineconfig/scripts/python/__pycache__/__init__.cpython-311.pyc +0 -0
  246. machineconfig/scripts/python/__pycache__/cloud_copy.cpython-311.pyc +0 -0
  247. machineconfig/scripts/python/__pycache__/cloud_mount.cpython-311.pyc +0 -0
  248. machineconfig/scripts/python/__pycache__/cloud_sync.cpython-311.pyc +0 -0
  249. machineconfig/scripts/python/__pycache__/croshell.cpython-311.pyc +0 -0
  250. machineconfig/scripts/python/__pycache__/devops.cpython-311.pyc +0 -0
  251. machineconfig/scripts/python/__pycache__/devops_backup_retrieve.cpython-311.pyc +0 -0
  252. machineconfig/scripts/python/__pycache__/devops_devapps_install.cpython-311.pyc +0 -0
  253. machineconfig/scripts/python/__pycache__/devops_update_repos.cpython-311.pyc +0 -0
  254. machineconfig/scripts/python/__pycache__/fire_agents.cpython-311.pyc +0 -0
  255. machineconfig/scripts/python/__pycache__/fire_jobs.cpython-311.pyc +0 -0
  256. machineconfig/scripts/python/__pycache__/get_zellij_cmd.cpython-311.pyc +0 -0
  257. machineconfig/scripts/python/__pycache__/repos.cpython-311.pyc +0 -0
  258. machineconfig/scripts/python/ai/__pycache__/init.cpython-311.pyc +0 -0
  259. machineconfig/scripts/python/ai/init.py +0 -56
  260. machineconfig/scripts/python/ai/rules/python/dev.md +0 -31
  261. machineconfig/scripts/python/helpers/__pycache__/__init__.cpython-311.pyc +0 -0
  262. machineconfig/scripts/python/helpers/__pycache__/cloud_helpers.cpython-311.pyc +0 -0
  263. machineconfig/scripts/python/helpers/__pycache__/helpers2.cpython-311.pyc +0 -0
  264. machineconfig/scripts/python/helpers/__pycache__/helpers4.cpython-311.pyc +0 -0
  265. machineconfig/scripts/python/helpers/__pycache__/repo_sync_helpers.cpython-311.pyc +0 -0
  266. machineconfig/scripts/windows/activate_ve.ps1 +0 -54
  267. {machineconfig-1.97.dist-info → machineconfig-2.1.dist-info}/WHEEL +0 -0
  268. {machineconfig-1.97.dist-info → machineconfig-2.1.dist-info}/top_level.txt +0 -0
@@ -8,7 +8,7 @@ Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser"
8
8
  Write-Host "šŸ’” To accept all prompts automatically, run: `$yesAll = `$true`n"
9
9
 
10
10
  # Set environment variable and execute scripts
11
- $ve_name = "ve"
11
+ $ve_name = ".venv"
12
12
 
13
13
  Write-Host "šŸ”„ Setting up Python environment..."
14
14
  Invoke-WebRequest -Uri "https://raw.githubusercontent.com/thisismygitrepo/machineconfig/main/src/machineconfig/setup_windows/ve.ps1" -OutFile "ve.ps1"
@@ -92,7 +92,7 @@ if ($createLinksChoice -eq "y" -or $createLinksChoice -eq "Y") {
92
92
  $linkTypeChoice = "h"
93
93
  }
94
94
 
95
- . ~\venvs\ve\Scripts\Activate.ps1
95
+ . ~\code\machineconfig\.venv\Scripts\Activate.ps1
96
96
 
97
97
  if ($linkTypeChoice -eq "s" -or $linkTypeChoice -eq "S") {
98
98
  python -m fire machineconfig.profile.create main --choice=all
@@ -119,7 +119,7 @@ if (-not $yesAll) {
119
119
  }
120
120
 
121
121
  } else {
122
- . $HOME\venvs\ve\Scripts\activate.ps1
122
+ . $HOME\code\machineconfig\.venv\Scripts\activate.ps1
123
123
  python -m fire machineconfig.scripts.python.devops_devapps_install main --which=AllEssentials
124
124
  deactivate
125
125
  }
@@ -146,7 +146,7 @@ if (-not $yesAll) {
146
146
  }
147
147
  if ([string]::IsNullOrEmpty($choice)) { $choice = "y" }
148
148
  if ($choice -eq "y" -or $choice -eq "Y") {
149
- . ~\venvs\ve\Scripts\Activate.ps1
149
+ . ~\code\machineconfig\.venv\Scripts\Activate.ps1
150
150
  python -m fire machineconfig.scripts.python.devops_backup_retrieve main --direction=RETRIEVE
151
151
  } else {
152
152
  Write-Host "Installation aborted."
@@ -170,7 +170,7 @@ if ($choice -eq "y" -or $choice -eq "Y") {
170
170
  python -m fire machineconfig.setup_windows.wt_and_pwsh.set_wt_settings main
171
171
  winget install --no-upgrade --name "Brave" --Id "Brave.Brave" --source winget --scope user --accept-package-agreements --accept-source-agreements
172
172
  winget install --no-upgrade --name "Microsoft Visual Studio Code" --Id "Microsoft.VisualStudioCode" --source winget --scope user --accept-package-agreements --accept-source-agreements
173
- . $HOME\venvs\ve\Scripts\Activate.ps1
173
+ . $HOME\code\machineconfig\.venv\Scripts\Activate.ps1
174
174
  python -m fire machineconfig.setup_windows.wt_and_pwsh.set_pwsh_theme install_nerd_fonts
175
175
  python -m fire machineconfig.setup_windows.wt_and_pwsh.set_wt_settings main
176
176
 
@@ -4,24 +4,60 @@ $FONTS = 0x14
4
4
  $Path = ".\fonts-to-be-installed"
5
5
  $objShell = New-Object -ComObject Shell.Application
6
6
  $objFolder = $objShell.Namespace($FONTS)
7
- $Fontdir = dir $Path
7
+ $Fontdir = Get-ChildItem -Path $Path -File
8
+
9
+ # Normalization helper: remove spaces, underscores, hyphens, 'nerd', 'font', and collapse 'nf' for broad matching
10
+ function Normalize-FontName {
11
+ param([string]$Name)
12
+ $n = $Name.ToLower()
13
+ $n = $n -replace '[ _-]', ''
14
+ $n = $n -replace 'nerd', ''
15
+ $n = $n -replace 'font', ''
16
+ $n = $n -replace 'nf', ''
17
+ return $n
18
+ }
19
+
20
+ # Cache installed font basenames once (raw + normalized map)
21
+ $installedFontFiles = Get-ChildItem C:\Windows\Fonts -File
22
+ $installedFonts = @{}
23
+ foreach ($f in $installedFontFiles) { $installedFonts[(Normalize-FontName $f.BaseName)] = 1 }
24
+
25
+ Write-Host "Existing related fonts detected:" ($installedFonts.Keys | Where-Object { $_ -match 'caskaydiacove|cascadiacode' } | Sort-Object | Get-Unique) -ForegroundColor DarkGray
8
26
 
9
27
  foreach ($File in $Fontdir) {
10
- if (!($file.name -match "pfb$")) {
11
- $try = $true
12
- $installedFonts = @(Get-ChildItem c:\windows\fonts | Where-Object {$_.PSIsContainer -eq $false} | Select-Object basename)
13
- $name = $File.baseName
14
-
15
- foreach ($font in $installedFonts) {
16
- $font = $font -replace "_", ""
17
- $name = $name -replace "_", ""
18
- if ($font -match $name) {
19
- $try = $false
28
+ if ($File.Name -notmatch 'pfb$') {
29
+ $candidateRaw = $File.BaseName
30
+ $candidateNorm = Normalize-FontName $candidateRaw
31
+
32
+ # 1. Exact file existence check (handles .ttf/.otf pairs) before invoking Shell CopyHere.
33
+ $destFile = Join-Path -Path 'C:\Windows\Fonts' -ChildPath $File.Name
34
+ if (Test-Path -LiteralPath $destFile) { Write-Host "Skip (file exists) $($File.Name)" -ForegroundColor Green; continue }
35
+
36
+ # 2. Registry check: Fonts are registered under HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts
37
+ try {
38
+ $fontReg = Get-ItemProperty 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts' -ErrorAction Stop
39
+ $regMatch = $false
40
+ foreach ($prop in $fontReg.PSObject.Properties) {
41
+ $val = ($prop.Value | Out-String).Trim()
42
+ $nm = ($prop.Name | Out-String).Trim()
43
+ $valNorm = Normalize-FontName ( [System.IO.Path]::GetFileNameWithoutExtension($val) )
44
+ $nmNorm = Normalize-FontName $nm
45
+ if ($valNorm -eq $candidateNorm -or $nmNorm -eq $candidateNorm -or $nmNorm -match [Regex]::Escape($candidateNorm)) { $regMatch = $true; break }
46
+ }
47
+ if ($regMatch) {
48
+ Write-Host "Skip (registry) $($File.Name)" -ForegroundColor Green
49
+ continue
20
50
  }
51
+ } catch {
52
+ Write-Host "Registry font query failed: $($_.Exception.Message) (continuing)" -ForegroundColor DarkYellow
21
53
  }
22
54
 
23
- if ($try) {
24
- $objFolder.CopyHere($File.fullname)
25
- }
55
+ # 3. Original heuristic set: in-memory list
56
+ if ($installedFonts.ContainsKey($candidateNorm)) { Write-Host "Skip (norm map) $($File.Name)" -ForegroundColor Green; continue }
57
+ if ($installedFonts.Keys | Where-Object { $_ -match [Regex]::Escape($candidateNorm) }) { Write-Host "Skip (norm regex) $($File.Name)" -ForegroundColor Green; continue }
58
+
59
+ Write-Host "Installing font (no matches) $($File.Name) | norm=$candidateNorm" -ForegroundColor Yellow
60
+ $objFolder.CopyHere($File.FullName)
26
61
  }
27
- }
62
+ }
63
+ Write-Host "Font installation script completed." -ForegroundColor Cyan
@@ -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,35 +17,92 @@ 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
+
30
78
  print("🧹 Cleaning up unnecessary files...")
31
- folder.search("*Windows*").apply(lambda p: p.delete(sure=True))
32
- folder.search("*readme*").apply(lambda p: p.delete(sure=True))
33
- folder.search("*LICENSE*").apply(lambda p: p.delete(sure=True))
34
-
79
+ [p.delete(sure=True) for p in folder.search("*Windows*")]
80
+ [p.delete(sure=True) for p in folder.search("*readme*")]
81
+ [p.delete(sure=True) for p in folder.search("*LICENSE*")]
82
+
35
83
  print("āš™ļø Installing fonts via PowerShell...")
36
- file = PathExtended.tmpfile(suffix=".ps1").write_text(LIBRARY_ROOT.joinpath("setup_windows/wt_and_pwsh/install_fonts.ps1").read_text().replace(r".\fonts-to-be-installed", str(folder)))
37
- subprocess.run(rf"powershell.exe -executionpolicy Bypass -nologo -noninteractive -File {str(file)}", check=True)
38
-
84
+ file = PathExtended.tmpfile(suffix=".ps1")
85
+ file.parent.mkdir(parents=True, exist_ok=True)
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)
89
+ file.write_text(content, encoding="utf-8")
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
95
+
39
96
  print("šŸ—‘ļø Cleaning up temporary files...")
40
97
  folder.delete(sure=True)
41
- print(f"\nāœ… Nerd Fonts installation complete! āœ…\n{'='*80}")
98
+ print(f"\nāœ… Nerd Fonts installation complete! āœ…\n{'=' * 80}")
42
99
 
43
100
 
44
101
  def main():
45
- print(f"\n{'='*80}\nšŸŽØ POWERSHELL THEME SETUP šŸŽØ\n{'='*80}")
102
+ print(f"\n{'=' * 80}\nšŸŽØ POWERSHELL THEME SETUP šŸŽØ\n{'=' * 80}")
46
103
  install_nerd_fonts()
47
- print(f"\nāœ… All PowerShell theme components installed successfully! āœ…\n{'='*80}")
104
+ print(f"\nāœ… All PowerShell theme components installed successfully! āœ…\n{'=' * 80}")
48
105
 
49
106
 
50
- if __name__ == '__main__':
107
+ if __name__ == "__main__":
51
108
  pass
@@ -1,10 +1,9 @@
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
- import crocodile.environment as env
6
+ import platform
8
7
  from machineconfig.utils.utils import LIBRARY_ROOT
9
8
  from uuid import uuid4
10
9
  import os
@@ -24,13 +23,15 @@ All settings are available on GitHub: https://aka.ms/terminal-profiles-schema
24
23
 
25
24
 
26
25
  console = Console()
27
- assert env.system == 'Windows', 'This script is only for Windows.'
26
+ system = platform.system() # Linux or Windows
27
+
28
+ assert system == "Windows", "This script is only for Windows."
28
29
 
29
30
 
30
31
  class TerminalSettings(object):
31
32
  def __init__(self):
32
33
  # Grabbing Terminal Settings file:
33
- print(f"\n{'='*80}\nšŸ” INITIALIZING TERMINAL SETTINGS šŸ”\n{'='*80}")
34
+ print(f"\n{'=' * 80}\nšŸ” INITIALIZING TERMINAL SETTINGS šŸ”\n{'=' * 80}")
34
35
  tmp = os.getenv("LOCALAPPDATA")
35
36
  if not isinstance(tmp, str):
36
37
  print("āŒ ERROR: Could not find LOCALAPPDATA environment variable!")
@@ -67,19 +68,20 @@ class TerminalSettings(object):
67
68
 
68
69
  # 1- Customizing Powershell========================================================
69
70
  # as opposed to Windows Powershell
70
- def customize_powershell(self, nerd_font: bool=True):
71
+ def customize_powershell(self, nerd_font: bool = True):
71
72
  print("\nšŸ› ļø Customizing PowerShell profile...")
72
- pwsh: dict[str, Any] = dict(name="PowerShell",
73
- commandline="pwsh",
74
- hidden=False,
75
- opacity=87,
76
- # guid="{" + str(uuid4()) + "}", # WT doesn't accept any GUID to identify pwsh
77
- startingDirectory="%USERPROFILE%", # "%USERPROFILE%", # None: inherent from parent process.
78
- )
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
+ )
79
81
  if nerd_font:
80
82
  print("šŸ”¤ Setting PowerShell font to CaskaydiaCove Nerd Font...")
81
83
  pwsh["font"] = dict(face="CaskaydiaCove Nerd Font") # because oh-my-posh uses glyphs from this font.
82
-
84
+
83
85
  for idx, item in enumerate(self.profs):
84
86
  if item["name"] == "PowerShell":
85
87
  self.profs[idx].update(pwsh)
@@ -95,17 +97,17 @@ class TerminalSettings(object):
95
97
  self.dat["defaultProfile"] = profile["guid"]
96
98
  console.print(Panel("āœ… PowerShell is now the default profile!", title="[bold blue]Terminal Settings[/bold blue]", border_style="blue"))
97
99
  break
98
- else:
100
+ else:
99
101
  console.print(Panel("āŒ PowerShell profile was not found in the list of profiles and therefore was not made the default.", title="[bold red]Terminal Settings[/bold red]", border_style="red"))
100
102
 
101
103
  def add_croshell(self):
102
104
  print("\n🐊 Adding croshell profile...")
103
- croshell = dict(name="croshell",
104
- guid="{" + str(uuid4()) + "}",
105
- # commandline=f"powershell.exe -Command \"{activate} ipython -i -c 'from crocodile.toolbox import *'\"",
106
- commandline=f'powershell.exe -Command "{LIBRARY_ROOT.as_posix()}/scripts/windows/croshell.ps1"',
107
- startingDirectory="%USERPROFILE%", # "%USERPROFILE%", # None: inherent from parent process.
108
- )
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
+ )
109
111
  # startingDirectory = None means: inheret from parent process, which will is the default, which point to /System32
110
112
  # Launching a new profile with ctr+shift+2 is equivalent to: wt --profile croshell -d . --new-tab
111
113
  for profile in self.profs:
@@ -113,19 +115,20 @@ class TerminalSettings(object):
113
115
  profile.update(croshell)
114
116
  console.print(Panel("āœ… Updated existing croshell profile", title="[bold blue]Terminal Settings[/bold blue]", border_style="blue"))
115
117
  break
116
- else:
118
+ else:
117
119
  self.profs.append(croshell)
118
120
  console.print(Panel("āœ… Added new croshell profile", title="[bold blue]Terminal Settings[/bold blue]", border_style="blue"))
119
121
 
120
122
  def add_ubuntu(self):
121
123
  print("\n🐧 Adding Ubuntu WSL profile...")
122
124
  # Add Ubunto if it is not there.
123
- ubuntu = dict(name="Ubuntu",
124
- commandline="wsl -d Ubuntu -- cd ~",
125
- hidden=False,
126
- guid="{" + str(uuid4()) + "}",
127
- startingDirectory="%USERPROFILE%", # "%USERPROFILE%", # None: inherent from parent process.
128
- )
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
+ )
129
132
  if not any(x.get("name") == "Ubuntu" for x in self.profs):
130
133
  self.profs.append(ubuntu)
131
134
  console.print(Panel("āœ… Added Ubuntu WSL profile", title="[bold blue]Terminal Settings[/bold blue]", border_style="blue"))
@@ -139,19 +142,26 @@ class TerminalSettings(object):
139
142
  pwsh = croshell = ubuntu = wpwsh = cmd = azure = None
140
143
  for profile in self.profs:
141
144
  name = profile["name"]
142
- if name == "PowerShell": pwsh = profile
143
- elif name == "croshell": croshell = profile
144
- elif name == "Ubuntu": ubuntu = profile
145
- elif name == "Windows PowerShell": wpwsh = profile
146
- elif name == "Command Prompt": cmd = profile
147
- elif name == "Azure Cloud Shell": azure = profile
148
- 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)
149
159
  self.profs = [item for item in [pwsh, croshell, ubuntu, wpwsh, cmd, azure] + others if item is not None]
150
160
  console.print(Panel("āœ… Profile order standardized", title="[bold blue]Terminal Settings[/bold blue]", border_style="blue"))
151
161
 
152
162
 
153
163
  def main():
154
- print(f"\n{'='*80}\nšŸ–„ļø WINDOWS TERMINAL SETUP šŸ–„ļø\n{'='*80}")
164
+ print(f"\n{'=' * 80}\nšŸ–„ļø WINDOWS TERMINAL SETUP šŸ–„ļø\n{'=' * 80}")
155
165
  shell = {"powershell": "pwsh.exe", "Windows Powershell": "powershell.exe"}["powershell"].split(".exe", maxsplit=1)[0]
156
166
  if shell == "pwsh":
157
167
  print("šŸš€ Starting Windows Terminal configuration with PowerShell...")
@@ -163,17 +173,17 @@ def main():
163
173
  ts.add_croshell()
164
174
  ts.add_ubuntu()
165
175
  ts.standardize_profiles_order()
166
-
176
+
167
177
  print("āŒØļø Adding keyboard shortcut for pane zoom (ctrl+shift+z)...")
168
- ts.dat['actions'].append({'command': 'togglePaneZoom', 'keys': 'ctrl+shift+z'})
169
-
178
+ ts.dat["actions"].append({"command": "togglePaneZoom", "keys": "ctrl+shift+z"})
179
+
170
180
  ts.save_terminal_settings()
171
- print(f"\n{'='*80}\n✨ WINDOWS TERMINAL SETUP COMPLETE ✨\n{'='*80}")
181
+ print(f"\n{'=' * 80}\n✨ WINDOWS TERMINAL SETUP COMPLETE ✨\n{'=' * 80}")
172
182
  else:
173
183
  error_msg = "āŒ ERROR: Only PowerShell is supported, not Windows PowerShell!"
174
184
  print(error_msg)
175
185
  raise NotImplementedError(error_msg)
176
186
 
177
187
 
178
- if __name__ == '__main__':
188
+ if __name__ == "__main__":
179
189
  pass
@@ -17,12 +17,12 @@
17
17
 
18
18
  # def _get_padding(text: str, padding_before: int = 2, padding_after: int = 1) -> str:
19
19
  # """Calculate the padding needed to align the box correctly.
20
-
20
+
21
21
  # Args:
22
22
  # text: The text to pad
23
23
  # padding_before: The space taken before the text (usually "ā•‘ ")
24
24
  # padding_after: The space needed after the text (usually " ā•‘")
25
-
25
+
26
26
  # Returns:
27
27
  # A string of spaces for padding
28
28
  # """
@@ -41,12 +41,12 @@
41
41
  # rprint("šŸ”„ Initializing LLM model (llama3.1:8b)...")
42
42
  # llm = ChatOllama(model="llama3.1:8b")
43
43
  # rprint("āœ… LLM model initialized")
44
-
44
+
45
45
  # task_line1 = "šŸ¤– Task: Open https://chat.openai.com/ and ask how many r's in"
46
46
  # task_line2 = "rrraaararewey, use Thinking Button and type the answer"
47
47
  # task_content = f"{task_line1}\n{task_line2}"
48
48
  # rprint(Panel(task_content, title="Task", width=BOX_WIDTH))
49
-
49
+
50
50
  # rprint("šŸš€ Creating and launching browser agent...")
51
51
  # agent = Agent(
52
52
  # task="open https://chat.openai.com/ and ask how many r's in rrraaararewey, use Thinking Button and type the answer",
@@ -55,7 +55,7 @@
55
55
 
56
56
  # rprint("šŸƒā€ā™‚ļø Running agent task...")
57
57
  # await agent.run()
58
-
58
+
59
59
  # # footer success box
60
60
  # title = "āœ… Browser automation task completed"
61
61
  # rprint(Panel(title, title="Status", width=BOX_WIDTH))
@@ -7,61 +7,58 @@ 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))
27
-
26
+
28
27
  py_files.sort()
29
28
  sh_files.sort()
30
-
29
+
31
30
  markdown_content: str = "# File Checklist\n\n"
32
-
31
+
33
32
  markdown_content += "## Python Files\n\n"
34
33
  for py_file in py_files:
35
34
  markdown_content += f"- [ ] {py_file}\n"
36
-
35
+
37
36
  markdown_content += "\n## Shell Script Files\n\n"
38
37
  for sh_file in sh_files:
39
38
  markdown_content += f"- [ ] {sh_file}\n"
40
39
  Path(output_path).parent.mkdir(parents=True, exist_ok=True)
41
- with open(output_path, 'w', encoding='utf-8') as f:
42
- f.write(markdown_content)
43
-
40
+ Path(output_path).write_text(markdown_content, encoding="utf-8")
41
+
44
42
  print(f"šŸ“‹ Checklist generated at: {output_path}")
45
43
  return output_path
46
44
 
47
45
 
48
46
  def main() -> None:
49
47
  import argparse
50
-
51
- parser = argparse.ArgumentParser(description='Generate a markdown file with checkboxes for all .py and .sh files.')
52
- parser.add_argument('--repo', '-r', type=str, default=str(Path.cwd()), help='Repository root path. Defaults to current working directory.')
53
- parser.add_argument('--exclude', '-e', nargs='+', type=str,
54
- help='Additional directories to exclude (by default excludes .venv, .git, __pycache__, build, dist, *.egg-info)')
55
-
48
+
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)")
52
+
56
53
  args = parser.parse_args()
57
-
58
- exclude_dirs: List[str] = ['.venv', '.git', '__pycache__', 'build', 'dist', '*.egg-info']
54
+
55
+ exclude_dirs: List[str] = [".venv", ".git", "__pycache__", "build", "dist", "*.egg-info"]
59
56
  if args.exclude:
60
57
  exclude_dirs.extend(args.exclude)
61
- if args.repo == '':
58
+ if args.repo == "":
62
59
  print("Error: Repository path cannot be empty.")
63
60
  return
64
-
61
+
65
62
  output_path = generate_file_checklist(args.repo, exclude_dirs)
66
63
  console = Console()
67
64
  console.print(Panel(f"āœ… SUCCESS | Markdown checklist generated successfully!\nšŸ“„ File Location: {output_path}", border_style="bold blue", expand=False))
@@ -38,7 +38,7 @@ except KeyboardInterrupt:
38
38
  print("\nāŒ Process interrupted by user, no URLs found.")
39
39
  exit(1)
40
40
 
41
- all_urls = urls_file.read_text().splitlines()
41
+ all_urls = urls_file.read_text(encoding="utf-8").splitlines()
42
42
  relevant_urls = list(set(all_urls)) # remove duplicates
43
43
  relevant_urls = [a_url for a_url in relevant_urls if not a_url.endswith(".css") and not a_url.endswith(".js") and not a_url.endswith(".png") and not a_url.endswith(".jpg") and not a_url.endswith(".jpeg") and not a_url.endswith(".gif")]
44
44
 
@@ -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,11 +15,12 @@ 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")
21
22
  print("=" * 40)
22
-
23
+
23
24
  # Check if environment variables are set
24
25
  if CLIENT_ID == "your_client_id_here":
25
26
  print("\nāŒ ONEDRIVE_CLIENT_ID environment variable not set!")
@@ -42,15 +43,15 @@ def main():
42
43
  print(" export ONEDRIVE_REDIRECT_URI='http://localhost:8080/callback'")
43
44
  print("\nšŸ”„ Then run this script again.")
44
45
  return
45
-
46
+
46
47
  print(f"āœ… Client ID: {CLIENT_ID}")
47
48
  print(f"āœ… Redirect URI: {REDIRECT_URI}")
48
-
49
+
49
50
  if CLIENT_SECRET and CLIENT_SECRET != "your_client_secret_here":
50
51
  print("āœ… Client Secret: [SET]")
51
52
  else:
52
53
  print("ā„¹ļø Client Secret: [NOT SET - Using public client mode]")
53
-
54
+
54
55
  print("\nšŸš€ Starting OAuth setup...")
55
56
  setup_oauth_authentication()
56
57