lapctl 0.1.3__tar.gz → 0.1.4__tar.gz
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.
- {lapctl-0.1.3/src/lapctl.egg-info → lapctl-0.1.4}/PKG-INFO +1 -1
- {lapctl-0.1.3 → lapctl-0.1.4}/pyproject.toml +1 -1
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/__init__.py +1 -1
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/cli.py +54 -5
- {lapctl-0.1.3 → lapctl-0.1.4/src/lapctl.egg-info}/PKG-INFO +1 -1
- {lapctl-0.1.3 → lapctl-0.1.4}/tests/test_cli.py +25 -1
- {lapctl-0.1.3 → lapctl-0.1.4}/LICENSE +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/README.md +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/setup.cfg +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/channels/__init__.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/channels/telegram/__init__.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/channels/telegram/api.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/channels/telegram/auth.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/channels/telegram/handlers.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/channels/telegram/poller.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/channels/telegram/render.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/config.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/core/__init__.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/core/battery.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/core/commands.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/core/confirm.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/core/keyboards.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/core/paths.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/core/ratelimit.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/drivers/__init__.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/drivers/base.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/drivers/linux_hyprland.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/drivers/windows.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/main.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/registry.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl/results.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl.egg-info/SOURCES.txt +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl.egg-info/dependency_links.txt +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl.egg-info/entry_points.txt +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl.egg-info/requires.txt +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/src/lapctl.egg-info/top_level.txt +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/tests/test_auth_and_config.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/tests/test_confirm.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/tests/test_paths.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/tests/test_registry_and_profiles.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/tests/test_render_and_driver.py +0 -0
- {lapctl-0.1.3 → lapctl-0.1.4}/tests/test_windows_driver.py +0 -0
|
@@ -140,6 +140,42 @@ DOCTOR_TOOLS: list[tuple[str, str, str, dict[str, str]]] = [
|
|
|
140
140
|
),
|
|
141
141
|
]
|
|
142
142
|
|
|
143
|
+
WINDOWS_TOOLS: list[tuple[str, str, str, str]] = [
|
|
144
|
+
("ffmpeg", "Rekam layar (/screenrecord)", "winget install Gyan.FFmpeg", "Gyan.FFmpeg"),
|
|
145
|
+
("mpv", "Pemutar TTS (/say)", "winget install mpv.net", "mpv.net"),
|
|
146
|
+
]
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
def _install_missing_windows_packages(ask_confirm: bool = True) -> bool:
|
|
150
|
+
missing = [(tool, pkg_id) for tool, _, _, pkg_id in WINDOWS_TOOLS if shutil.which(tool) is None]
|
|
151
|
+
if not missing:
|
|
152
|
+
return True
|
|
153
|
+
if shutil.which("winget") is None:
|
|
154
|
+
print("\nAlat opsional Windows belum terpasang (winget tidak ditemukan):")
|
|
155
|
+
for _, pkg_id in missing:
|
|
156
|
+
print(f" - winget install -e --id {pkg_id}")
|
|
157
|
+
return False
|
|
158
|
+
|
|
159
|
+
print("\nPerintah instalasi alat opsional Windows:")
|
|
160
|
+
for _, pkg_id in missing:
|
|
161
|
+
print(f" winget install -e --id {pkg_id}")
|
|
162
|
+
|
|
163
|
+
if ask_confirm:
|
|
164
|
+
ans = input("Pasang alat opsional yang kurang via winget sekarang? [y/N]: ").strip().lower()
|
|
165
|
+
if ans not in {"y", "ya", "yes"}:
|
|
166
|
+
return False
|
|
167
|
+
|
|
168
|
+
ok = True
|
|
169
|
+
for _, pkg_id in missing:
|
|
170
|
+
try:
|
|
171
|
+
res = subprocess.run(["winget", "install", "-e", "--id", pkg_id])
|
|
172
|
+
if res.returncode != 0:
|
|
173
|
+
ok = False
|
|
174
|
+
except Exception as e:
|
|
175
|
+
print(f"⚠️ Gagal memasang {pkg_id}: {e}")
|
|
176
|
+
ok = False
|
|
177
|
+
return ok
|
|
178
|
+
|
|
143
179
|
|
|
144
180
|
def _detect_pkg_manager() -> str | None:
|
|
145
181
|
for mgr, exe in (("pacman", "pacman"), ("apt", "apt-get"), ("dnf", "dnf")):
|
|
@@ -389,7 +425,9 @@ def cmd_setup() -> int:
|
|
|
389
425
|
write_toml_config(cfg_path, data)
|
|
390
426
|
print(f"\n✅ Konfigurasi disimpan ke {cfg_path} (izin owner-only).")
|
|
391
427
|
|
|
392
|
-
if
|
|
428
|
+
if WindowsDriver.detect():
|
|
429
|
+
_install_missing_windows_packages(ask_confirm=True)
|
|
430
|
+
else:
|
|
393
431
|
_install_missing_packages(ask_confirm=True)
|
|
394
432
|
|
|
395
433
|
install_svc = input("Pasang auto-start otomatis saat login? [Y/n]: ").strip().lower()
|
|
@@ -422,11 +460,22 @@ def cmd_doctor(install: bool = False) -> int:
|
|
|
422
460
|
f"Konfigurasi ({cfg_path}): {'ada' if cfg_path.exists() else 'belum ada (jalankan lapctl setup)'}"
|
|
423
461
|
)
|
|
424
462
|
if WindowsDriver.detect():
|
|
425
|
-
has_ffmpeg = shutil.which("ffmpeg") is not None
|
|
426
|
-
has_mpv = shutil.which("mpv") is not None
|
|
427
463
|
print("\nPemeriksaan alat opsional Windows:")
|
|
428
|
-
|
|
429
|
-
|
|
464
|
+
win_missing = 0
|
|
465
|
+
for tool, desc, hint, _ in WINDOWS_TOOLS:
|
|
466
|
+
found = shutil.which(tool) is not None
|
|
467
|
+
status = "OK" if found else "TIDAK ADA"
|
|
468
|
+
print(f" - {tool:<14} [{status:<9}] {desc}")
|
|
469
|
+
if not found:
|
|
470
|
+
win_missing += 1
|
|
471
|
+
print(f" Saran instalasi: {hint}")
|
|
472
|
+
if win_missing > 0:
|
|
473
|
+
if install:
|
|
474
|
+
_install_missing_windows_packages(ask_confirm=True)
|
|
475
|
+
else:
|
|
476
|
+
print("Jalankan 'lapctl doctor --install' untuk memasang alat opsional via winget.")
|
|
477
|
+
else:
|
|
478
|
+
print("\nSemua alat opsional Windows tersedia.")
|
|
430
479
|
return 0
|
|
431
480
|
print("\nPemeriksaan dependensi alat:")
|
|
432
481
|
|
|
@@ -15,7 +15,7 @@ def test_cli_version(capsys) -> None:
|
|
|
15
15
|
cli.main(["--version"])
|
|
16
16
|
assert exc.value.code == 0
|
|
17
17
|
out = capsys.readouterr().out
|
|
18
|
-
assert "lapctl 0.1.
|
|
18
|
+
assert "lapctl 0.1.4" in out
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
def test_cli_doctor_reports_missing_tools(monkeypatch, capsys) -> None:
|
|
@@ -114,3 +114,27 @@ def test_cli_doctor_install_runs_pacman(monkeypatch) -> None:
|
|
|
114
114
|
assert calls[0][:4] == ["sudo", "pacman", "-S", "--needed"]
|
|
115
115
|
assert "brightnessctl" in calls[0]
|
|
116
116
|
assert "grim" not in calls[0]
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def test_cli_doctor_install_windows_runs_winget(monkeypatch) -> None:
|
|
120
|
+
calls: list[list[str]] = []
|
|
121
|
+
|
|
122
|
+
def fake_which(name: str) -> str | None:
|
|
123
|
+
if name == "winget":
|
|
124
|
+
return "C:\\Windows\\System32\\winget.exe"
|
|
125
|
+
return None
|
|
126
|
+
|
|
127
|
+
monkeypatch.setattr("lapctl.cli.shutil.which", fake_which)
|
|
128
|
+
monkeypatch.setattr("lapctl.cli.WindowsDriver.detect", classmethod(lambda cls: True))
|
|
129
|
+
monkeypatch.setattr("builtins.input", lambda _prompt: "y")
|
|
130
|
+
monkeypatch.setattr(
|
|
131
|
+
"lapctl.cli.subprocess.run",
|
|
132
|
+
lambda cmd, **kw: calls.append(cmd) or type("R", (), {"returncode": 0})(),
|
|
133
|
+
)
|
|
134
|
+
|
|
135
|
+
rc = cli.main(["doctor", "--install"])
|
|
136
|
+
assert rc == 0
|
|
137
|
+
assert calls == [
|
|
138
|
+
["winget", "install", "-e", "--id", "Gyan.FFmpeg"],
|
|
139
|
+
["winget", "install", "-e", "--id", "mpv.net"],
|
|
140
|
+
]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|