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

@@ -2,10 +2,15 @@
2
2
 
3
3
  from pathlib import Path
4
4
  from typing import Optional
5
- # import typer
5
+ import typer
6
+ from rich.console import Console
7
+ from rich.panel import Panel
8
+ from rich.text import Text
9
+ from rich.align import Align
6
10
 
7
11
 
8
12
  """
13
+ uv run --python 3.13 --with machineconfig
9
14
  reference:
10
15
  # https://github.com/tsl0922/ttyd/wiki/Serving-web-fonts
11
16
  # -t "fontFamily=CaskaydiaCove" bash
@@ -14,7 +19,36 @@ reference:
14
19
  """
15
20
 
16
21
 
17
- def share_terminal(port: int, password: Optional[str]) -> None:
22
+ def display_terminal_url(local_ip_v4: str, port: int) -> None:
23
+ """Display a flashy, unmissable terminal URL announcement."""
24
+ console = Console()
25
+
26
+ # Create the main message with styling
27
+ url_text = Text(f"http://{local_ip_v4}:{port}", style="bold bright_cyan underline")
28
+ message = Text.assemble(
29
+ ("🚀 ", "bright_red"),
30
+ ("Terminal is now accessible at: ", "bright_white bold"),
31
+ url_text,
32
+ (" 🚀", "bright_red")
33
+ )
34
+
35
+ # Create a fancy panel with borders and styling
36
+ panel = Panel(
37
+ Align.center(message),
38
+ title="[bold bright_green]🌐 WEB TERMINAL READY 🌐[/bold bright_green]",
39
+ subtitle="[italic bright_yellow]⚡ Click the link above to access your terminal! ⚡[/italic bright_yellow]",
40
+ border_style="bright_magenta",
41
+ padding=(1, 2),
42
+ expand=False
43
+ )
44
+
45
+ # Print with extra spacing and attention-grabbing elements
46
+ console.print("\n" + "🔥" * 60 + "\n", style="bright_red bold")
47
+ console.print(panel)
48
+ console.print("🔥" * 60 + "\n", style="bright_red bold")
49
+
50
+
51
+ def main(port: Optional[int]=None, password: Optional[str]=None) -> None:
18
52
  if password is None:
19
53
  pwd_path = Path.home().joinpath("dotfiles/creds/passwords/quick_password")
20
54
  if pwd_path.exists():
@@ -22,20 +56,30 @@ def share_terminal(port: int, password: Optional[str]) -> None:
22
56
  else:
23
57
  raise ValueError("Password not provided and default password file does not exist.")
24
58
 
59
+ if port is None:
60
+ port = 7681 # Default port for ttyd
61
+
25
62
  import socket
26
63
  s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
27
64
  s.connect(('8.8.8.8',80))
28
65
  local_ip_v4 = s.getsockname()[0]
29
66
  s.close()
30
67
 
31
- print(f"\n🌐 Access your terminal at: http://{local_ip_v4}:{port}\n")
68
+ # Display the flashy terminal announcement
69
+ display_terminal_url(local_ip_v4, port)
32
70
 
33
71
  code = f"""
34
72
  #!/bin/bash
35
73
  uv run --python 3.13 --with machineconfig install -ttyd
36
-
37
74
  ttyd --writable -t enableSixel=true --port {port} --credential "$USER:{password}" -t 'theme={"background": "black"}' bash
38
-
39
75
  """
40
76
  import subprocess
41
77
  subprocess.run(code, shell=True, check=True)
78
+
79
+
80
+ def main_with_parser():
81
+ typer.run(main)
82
+
83
+
84
+ if __name__ == "__main__":
85
+ pass
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: machineconfig
3
- Version: 3.96
3
+ Version: 3.97
4
4
  Summary: Dotfiles management package
5
5
  Author-email: Alex Al-Saffar <programmer@usa.com>
6
6
  License: Apache 2.0
@@ -174,7 +174,7 @@ machineconfig/scripts/python/repos_helper_clone.py,sha256=xW5YZEoNt3k7h9NIULhUhO
174
174
  machineconfig/scripts/python/repos_helper_record.py,sha256=YEEQORfEiLddOIIgePo5eEkyQUFruFg3kc8npMvRL-o,10927
175
175
  machineconfig/scripts/python/repos_helper_update.py,sha256=AYyKIB7eQ48yoYmFjydIhRI1lV39TBv_S4_LCa-oKuQ,11042
176
176
  machineconfig/scripts/python/scheduler.py,sha256=rKhssuxkD697EY6qaV6CSdNhxpAQLDWO4fE8GMCQ9FA,3061
177
- machineconfig/scripts/python/share_terminal.py,sha256=divO0lleaX1l90ta4muv_ogUB7zfdDCFxbTSmVIZqJw,1116
177
+ machineconfig/scripts/python/share_terminal.py,sha256=QkzxEqvGZG29heiFByB4JrT21UvG8qyYhwG2JIgR_hw,2551
178
178
  machineconfig/scripts/python/snapshot.py,sha256=aDvKeoniZaeTSNv9zWBUajaj2yagAxVdfuvO1_tgq5Y,1026
179
179
  machineconfig/scripts/python/start_slidev.py,sha256=U5ujAL7R5Gd5CzFReTsnF2SThjY91aFBg0Qz_MMl6U4,4573
180
180
  machineconfig/scripts/python/start_terminals.py,sha256=DRWbMZumhPmL0DvvsCsbRNFL5AVQn1SgaziafTio3YQ,6149
@@ -401,8 +401,8 @@ machineconfig/utils/schemas/fire_agents/fire_agents_input.py,sha256=CCs5ebomW1ac
401
401
  machineconfig/utils/schemas/installer/installer_types.py,sha256=DLagmIe0G5-xg7HZ9VrlFCDk1gIbwvX7O4gZjwq0wh0,1326
402
402
  machineconfig/utils/schemas/layouts/layout_types.py,sha256=M1ZFCz_kjRZPhxM19rIYUDR5lDDpwa09odR_ihtIFq0,1932
403
403
  machineconfig/utils/schemas/repos/repos_types.py,sha256=ECVr-3IVIo8yjmYmVXX2mnDDN1SLSwvQIhx4KDDQHBQ,405
404
- machineconfig-3.96.dist-info/METADATA,sha256=u12zhxYgXReDlgty97G8EezR37WZMvoPSy-3AfreqtA,7032
405
- machineconfig-3.96.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
406
- machineconfig-3.96.dist-info/entry_points.txt,sha256=hJ7T5FTW9omjvkiKvBGD5H-vlv8ULx6H6aVFWCKpzWc,1204
407
- machineconfig-3.96.dist-info/top_level.txt,sha256=porRtB8qms8fOIUJgK-tO83_FeH6Bpe12oUVC670teA,14
408
- machineconfig-3.96.dist-info/RECORD,,
404
+ machineconfig-3.97.dist-info/METADATA,sha256=41d56Jx9vgeCV42fom4BZPQrRIj-yV3CRoMJondht1c,7032
405
+ machineconfig-3.97.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
406
+ machineconfig-3.97.dist-info/entry_points.txt,sha256=94GY2PC5gimDHncsCsa2RM-xDRVbWsp8a01p4YGDb2M,1282
407
+ machineconfig-3.97.dist-info/top_level.txt,sha256=porRtB8qms8fOIUJgK-tO83_FeH6Bpe12oUVC670teA,14
408
+ machineconfig-3.97.dist-info/RECORD,,
@@ -16,5 +16,6 @@ kill_process = machineconfig.utils.procs:main
16
16
  mount_nfs = machineconfig.scripts.python.mount_nfs:main
17
17
  mount_nw_drive = machineconfig.scripts.python.mount_nw_drive:main
18
18
  repos = machineconfig.scripts.python.repos:main_from_parser
19
+ share_terminal = machineconfig.scripts.python.share_terminal:main_with_parser
19
20
  start_slidev = machineconfig.scripts.python.start_slidev:arg_parser
20
21
  wifi_conn = machineconfig.scripts.python.wifi_conn:arg_parser