machineconfig 5.47__py3-none-any.whl → 5.50__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of machineconfig might be problematic. Click here for more details.
- machineconfig/profile/create_helper.py +10 -0
- machineconfig/profile/create_links.py +16 -18
- machineconfig/profile/mapper.toml +4 -4
- machineconfig/scripts/python/interactive.py +1 -2
- {machineconfig-5.47.dist-info → machineconfig-5.50.dist-info}/METADATA +2 -1
- {machineconfig-5.47.dist-info → machineconfig-5.50.dist-info}/RECORD +9 -9
- {machineconfig-5.47.dist-info → machineconfig-5.50.dist-info}/WHEEL +0 -0
- {machineconfig-5.47.dist-info → machineconfig-5.50.dist-info}/entry_points.txt +0 -0
- {machineconfig-5.47.dist-info → machineconfig-5.50.dist-info}/top_level.txt +0 -0
|
@@ -16,10 +16,20 @@ def copy_assets_to_machine(which: Literal["scripts", "settings"]):
|
|
|
16
16
|
case "scripts":
|
|
17
17
|
source = LIBRARY_ROOT.joinpath("scripts", system)
|
|
18
18
|
target = CONFIG_ROOT.joinpath("scripts", system)
|
|
19
|
+
|
|
19
20
|
case "settings":
|
|
20
21
|
source = LIBRARY_ROOT.joinpath("settings")
|
|
21
22
|
target = CONFIG_ROOT.joinpath("settings")
|
|
22
23
|
from machineconfig.utils.path_extended import PathExtended
|
|
23
24
|
PathExtended(source).copy(folder=target.parent, overwrite=True)
|
|
25
|
+
import platform
|
|
26
|
+
system = platform.system().lower()
|
|
27
|
+
if system == "linux" and which == "scripts":
|
|
28
|
+
import subprocess
|
|
29
|
+
from rich.console import Console
|
|
30
|
+
console = Console()
|
|
31
|
+
console.print("\n[bold]📜 Setting executable permissions for scripts...[/bold]")
|
|
32
|
+
subprocess.run(f"chmod +x {CONFIG_ROOT.joinpath(f'scripts/{system.lower()}')} -R", shell=True, capture_output=True, text=True)
|
|
33
|
+
console.print("[green]✅ Script permissions updated[/green]")
|
|
24
34
|
|
|
25
35
|
|
|
@@ -28,14 +28,6 @@ SYSTEM = system.lower()
|
|
|
28
28
|
console = Console()
|
|
29
29
|
|
|
30
30
|
|
|
31
|
-
def get_other_systems(current_system: str) -> list[str]:
|
|
32
|
-
all_systems = ["linux", "windows", "darwin"]
|
|
33
|
-
return [s for s in all_systems if s != current_system.lower()]
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
OTHER_SYSTEMS = get_other_systems(SYSTEM)
|
|
37
|
-
|
|
38
|
-
|
|
39
31
|
class Base(TypedDict):
|
|
40
32
|
this: str
|
|
41
33
|
to_this: str
|
|
@@ -54,7 +46,19 @@ def read_mapper() -> MapperFileData:
|
|
|
54
46
|
mapper_data: dict[str, dict[str, Base]] = tomllib.loads(LIBRARY_ROOT.joinpath("profile/mapper.toml").read_text(encoding="utf-8"))
|
|
55
47
|
public: dict[str, list[ConfigMapper]] = {}
|
|
56
48
|
private: dict[str, list[ConfigMapper]] = {}
|
|
49
|
+
# def get_other_systems(current_system: str) -> list[str]:
|
|
50
|
+
# all_systems = ["linux", "windows", "darwin"]
|
|
51
|
+
# return [s for s in all_systems if s != current_system.lower()]
|
|
52
|
+
# OTHER_SYSTEMS = get_other_systems(SYSTEM)
|
|
57
53
|
for program_key, program_map in mapper_data.items():
|
|
54
|
+
parts = program_key.split("_")
|
|
55
|
+
if len(parts) > 1:
|
|
56
|
+
if parts[-1].lower() == "windows" and SYSTEM != "windows":
|
|
57
|
+
# console.print(f"Skipping Windows-only program mapping: {program_key}")
|
|
58
|
+
continue
|
|
59
|
+
elif parts[-1].lower() == "linux" and SYSTEM == "windows":
|
|
60
|
+
# console.print(f"Skipping Linux-only program mapping: {program_key}")
|
|
61
|
+
continue
|
|
58
62
|
for file_name, file_base in program_map.items():
|
|
59
63
|
file_map: ConfigMapper = {
|
|
60
64
|
"file_name": file_name,
|
|
@@ -79,7 +83,9 @@ def apply_mapper(mapper_data: dict[str, list[ConfigMapper]],
|
|
|
79
83
|
method: Literal["symlink", "copy"]
|
|
80
84
|
):
|
|
81
85
|
operation_records: list[OperationRecord] = []
|
|
82
|
-
|
|
86
|
+
print(f"Working with {len(mapper_data)} programs from mapper data.")
|
|
87
|
+
if len(mapper_data) == 1:
|
|
88
|
+
print(mapper_data)
|
|
83
89
|
import os
|
|
84
90
|
if os.name == "nt":
|
|
85
91
|
import ctypes
|
|
@@ -102,17 +108,14 @@ def apply_mapper(mapper_data: dict[str, list[ConfigMapper]],
|
|
|
102
108
|
)
|
|
103
109
|
)
|
|
104
110
|
raise RuntimeError("Run terminal as admin and try again, otherwise, there will be too many popups for admin requests and no chance to terminate the program.")
|
|
105
|
-
|
|
106
111
|
for program_name, program_files in mapper_data.items():
|
|
107
112
|
console.rule(f"🔄 Processing [bold]{program_name}[/] symlinks", style="cyan")
|
|
108
113
|
for a_mapper in program_files:
|
|
109
114
|
config_file_default_path = PathExtended(a_mapper["config_file_default_path"])
|
|
110
115
|
self_managed_config_file_path = PathExtended(a_mapper["self_managed_config_file_path"].replace("CONFIG_ROOT", CONFIG_ROOT.as_posix()))
|
|
111
|
-
|
|
112
116
|
# Determine whether to use copy or symlink
|
|
113
117
|
use_copy = method == "copy" or a_mapper.get("copy", False)
|
|
114
|
-
|
|
115
|
-
if "contents" in a_mapper:
|
|
118
|
+
if "contents" in a_mapper and a_mapper["contents"]:
|
|
116
119
|
targets = list(self_managed_config_file_path.expanduser().search("*"))
|
|
117
120
|
for a_target in targets:
|
|
118
121
|
operation_type = "contents_copy" if use_copy else "contents_symlink"
|
|
@@ -213,11 +216,6 @@ def apply_mapper(mapper_data: dict[str, list[ConfigMapper]],
|
|
|
213
216
|
ERROR_LIST.append(e)
|
|
214
217
|
console.print(f"❌ [red]Error setting SSH permissions[/red]: {e}")
|
|
215
218
|
|
|
216
|
-
if system == "Linux":
|
|
217
|
-
console.print("\n[bold]📜 Setting executable permissions for scripts...[/bold]")
|
|
218
|
-
subprocess.run(f"chmod +x {CONFIG_ROOT.joinpath(f'scripts/{system.lower()}')} -R", shell=True, capture_output=True, text=True)
|
|
219
|
-
console.print("[green]✅ Script permissions updated[/green]")
|
|
220
|
-
|
|
221
219
|
# Display operation summary table
|
|
222
220
|
if operation_records:
|
|
223
221
|
table = Table(title="🔗 Symlink Operations Summary", show_header=True, header_style="bold magenta")
|
|
@@ -167,10 +167,10 @@ config = {this = '~/.config/pudb/pudb.cfg', to_this = 'CONFIG_ROOT/settings/pudb
|
|
|
167
167
|
# AllUsersAllHosts = {this = 'C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1', to_this = '~/dotfiles/shells/windows_powershell/AllUsersAllHosts/profile.ps1'}
|
|
168
168
|
|
|
169
169
|
[pwsh_windows]
|
|
170
|
-
CurrentUserCurrentHost = {this = '~/Documents/PowerShell/Microsoft.PowerShell_profile.ps1', to_this = 'CONFIG_ROOT/settings/shells/pwsh/init.ps1'}
|
|
171
|
-
CurrentUserAllHosts = {this = '~/Documents/PowerShell/profile.ps1', to_this = 'CONFIG_ROOT/settings/shells/pwsh/profile.ps1'}
|
|
172
|
-
AllUsersCurrentHost = {this = 'C:\Program Files\PowerShell\7\Microsoft.PowerShell_profile.ps1', to_this = 'CONFIG_ROOT/settings/shells/pwsh/init.ps1'}
|
|
173
|
-
AllUsersAllHosts = {this = 'C:\Program Files\PowerShell\7\profile.ps1', to_this = 'CONFIG_ROOT/settings/shells/pwsh/init.ps1'}
|
|
170
|
+
# CurrentUserCurrentHost = {this = '~/Documents/PowerShell/Microsoft.PowerShell_profile.ps1', to_this = 'CONFIG_ROOT/settings/shells/pwsh/init.ps1'}
|
|
171
|
+
# CurrentUserAllHosts = {this = '~/Documents/PowerShell/profile.ps1', to_this = 'CONFIG_ROOT/settings/shells/pwsh/profile.ps1'}
|
|
172
|
+
# AllUsersCurrentHost = {this = 'C:\Program Files\PowerShell\7\Microsoft.PowerShell_profile.ps1', to_this = 'CONFIG_ROOT/settings/shells/pwsh/init.ps1'}
|
|
173
|
+
# AllUsersAllHosts = {this = 'C:\Program Files\PowerShell\7\profile.ps1', to_this = 'CONFIG_ROOT/settings/shells/pwsh/init.ps1'}
|
|
174
174
|
|
|
175
175
|
[nushell_windows]
|
|
176
176
|
config = {this = '~/AppData/Roaming/nushell/config.nu', to_this = 'CONFIG_ROOT/settings/shells/nushell/config.nu'}
|
|
@@ -51,9 +51,8 @@ def display_header() -> None:
|
|
|
51
51
|
╚═════════════════════════════════════════════════════════════════════════════════════════════════════════════╝
|
|
52
52
|
"""
|
|
53
53
|
|
|
54
|
-
import machineconfig
|
|
55
54
|
version = get_machineconfig_version()
|
|
56
|
-
title = f"✨ MACHINE CONFIGURATION v{version}
|
|
55
|
+
title = f"✨ MACHINE CONFIGURATION v{version} ✨"
|
|
57
56
|
subtitle = "🎯 Your digital life manager. Dotfiles, data, code and more."
|
|
58
57
|
bug_report = "🐛 Please report bugs to Alex Al-Saffar @ https://github.com/thisismygitrepo/machineconfig"
|
|
59
58
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: machineconfig
|
|
3
|
-
Version: 5.
|
|
3
|
+
Version: 5.50
|
|
4
4
|
Summary: Dotfiles management package
|
|
5
5
|
Author-email: Alex Al-Saffar <programmer@usa.com>
|
|
6
6
|
License: Apache 2.0
|
|
@@ -27,6 +27,7 @@ Requires-Dist: pyjson5>=1.6.9
|
|
|
27
27
|
Requires-Dist: questionary>=2.1.1
|
|
28
28
|
Requires-Dist: typer-slim>=0.19.2
|
|
29
29
|
Requires-Dist: euporie>=2.8.14
|
|
30
|
+
Requires-Dist: typer>=0.19.2
|
|
30
31
|
Provides-Extra: windows
|
|
31
32
|
Requires-Dist: pywin32; extra == "windows"
|
|
32
33
|
Provides-Extra: plot
|
|
@@ -94,11 +94,11 @@ machineconfig/jobs/windows/msc/cli_agents.ps1,sha256=47DEQpj8HBSa-_TImW-5JCeuQeR
|
|
|
94
94
|
machineconfig/profile/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
95
95
|
machineconfig/profile/backup.toml,sha256=Hb25sIdKVvLqOF62NgiOpGZxd45I6IhsNHu623RtfQQ,766
|
|
96
96
|
machineconfig/profile/bash_shell_profiles.md,sha256=mio0xkMTwO-F3fikWIfgcdQaPCmQrmkxJMNtZsTe9TI,514
|
|
97
|
-
machineconfig/profile/create_helper.py,sha256=
|
|
98
|
-
machineconfig/profile/create_links.py,sha256=
|
|
97
|
+
machineconfig/profile/create_helper.py,sha256=_iNeuwmcEGTx6sf_f40JKHfOCuJRZQRpyE8Fo_3Q6bI,1519
|
|
98
|
+
machineconfig/profile/create_links.py,sha256=K7T2bq08GZP9fo2NzCOE0pojAgQDe0Ofe7fNfbQlQpw,14219
|
|
99
99
|
machineconfig/profile/create_links_export.py,sha256=OEmuJE-F7FZX5xvOl1rqJzHg_BWtPKCiWdrq4RPOobs,3173
|
|
100
100
|
machineconfig/profile/create_shell_profile.py,sha256=ifsEAK90ovvY7ftyxuY5-Xh8f2JuQYX7IMYUXp6x2Sw,9538
|
|
101
|
-
machineconfig/profile/mapper.toml,sha256=
|
|
101
|
+
machineconfig/profile/mapper.toml,sha256=_zy_Og2cSFeFDISHCInKm7ReZUNCbwibNHYwr0TY01E,12894
|
|
102
102
|
machineconfig/profile/records/generic/shares.toml,sha256=FduDztfyQtZcr5bfx-RSKhEEweweQSWfVXkKWnx8hCY,143
|
|
103
103
|
machineconfig/profile/records/linux/apps_summary_report.csv,sha256=pw9djvaRUPalKDLn2sl3odcbD2_Zx3aEupsQ8UPfaaY,2738
|
|
104
104
|
machineconfig/profile/records/linux/apps_summary_report.md,sha256=l77oofA6Rliql0ZgKGIZi8bstFoGyyGTxeS8p2PtOj0,5634
|
|
@@ -127,7 +127,7 @@ machineconfig/scripts/python/devops.py,sha256=SilJAQXAPBKXjF91zcpJV9YRS721M5UPbX
|
|
|
127
127
|
machineconfig/scripts/python/devops_navigator.py,sha256=JYRKB8pVK5gyxcsrEYPC4IvUeX7rP4eMIkaattt8_t0,35090
|
|
128
128
|
machineconfig/scripts/python/fire_jobs.py,sha256=l2qByVK2rxWDUGFliU3HYwrtAI1XsUvOtcGLX4DUA5U,13689
|
|
129
129
|
machineconfig/scripts/python/ftpx.py,sha256=dFFCRKygZvNXkkwpo6vZgJmUv7buTNoVLLKT9wNp0Wc,9323
|
|
130
|
-
machineconfig/scripts/python/interactive.py,sha256=
|
|
130
|
+
machineconfig/scripts/python/interactive.py,sha256=IRveYja_9omEEhRyM1M6_SlljPY2Eo_GGoK9tTi1nsk,11778
|
|
131
131
|
machineconfig/scripts/python/sessions.py,sha256=lO_aTnh7T05XoCa8Ox-ROAWBKMtbo-DZzlFDUqzSipM,8716
|
|
132
132
|
machineconfig/scripts/python/ai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
133
133
|
machineconfig/scripts/python/ai/generate_files.py,sha256=Vfjgd0skJu-WTgqUxmOVFzaNMfSFBaFmY5oGGVY7MZY,2860
|
|
@@ -403,8 +403,8 @@ machineconfig/utils/schemas/fire_agents/fire_agents_input.py,sha256=Xbi59rU35AzR
|
|
|
403
403
|
machineconfig/utils/schemas/installer/installer_types.py,sha256=QClRY61QaduBPJoSpdmTIdgS9LS-RvE-QZ-D260tD3o,1214
|
|
404
404
|
machineconfig/utils/schemas/layouts/layout_types.py,sha256=TcqlZdGVoH8htG5fHn1KWXhRdPueAcoyApppZsPAPto,2020
|
|
405
405
|
machineconfig/utils/schemas/repos/repos_types.py,sha256=ECVr-3IVIo8yjmYmVXX2mnDDN1SLSwvQIhx4KDDQHBQ,405
|
|
406
|
-
machineconfig-5.
|
|
407
|
-
machineconfig-5.
|
|
408
|
-
machineconfig-5.
|
|
409
|
-
machineconfig-5.
|
|
410
|
-
machineconfig-5.
|
|
406
|
+
machineconfig-5.50.dist-info/METADATA,sha256=WQMZNGnUR152bdVtttdXTR4DOHRI06xEgYpAZ95vtRw,3140
|
|
407
|
+
machineconfig-5.50.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
408
|
+
machineconfig-5.50.dist-info/entry_points.txt,sha256=z7b9guivf0GSKUG6b8ALgbDoRg2LuPfkGP_p-PxgX9g,469
|
|
409
|
+
machineconfig-5.50.dist-info/top_level.txt,sha256=porRtB8qms8fOIUJgK-tO83_FeH6Bpe12oUVC670teA,14
|
|
410
|
+
machineconfig-5.50.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|