accli 2.1.3__tar.gz → 2.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.
- {accli-2.1.3 → accli-2.1.4}/PKG-INFO +1 -1
- {accli-2.1.3 → accli-2.1.4}/accli/_version.py +1 -1
- accli-2.1.4/accli/acc_logo.ico +0 -0
- accli-2.1.4/accli/acc_logo.png +0 -0
- {accli-2.1.3 → accli-2.1.4}/accli/gui.py +89 -7
- {accli-2.1.3 → accli-2.1.4}/accli.egg-info/PKG-INFO +1 -1
- {accli-2.1.3 → accli-2.1.4}/accli.egg-info/SOURCES.txt +2 -0
- {accli-2.1.3 → accli-2.1.4}/pyproject.toml +1 -1
- {accli-2.1.3 → accli-2.1.4}/LICENSE +0 -0
- {accli-2.1.3 → accli-2.1.4}/README.md +0 -0
- {accli-2.1.3 → accli-2.1.4}/accli/AcceleratorJobProjectService.py +0 -0
- {accli-2.1.3 → accli-2.1.4}/accli/AcceleratorTaskDispatcher.py +0 -0
- {accli-2.1.3 → accli-2.1.4}/accli/AcceleratorTerminalCliProjectService.py +0 -0
- {accli-2.1.3 → accli-2.1.4}/accli/CsvRegionalTimeseriesValidator.py +0 -0
- {accli-2.1.3 → accli-2.1.4}/accli/__init__.py +0 -0
- {accli-2.1.3 → accli-2.1.4}/accli/__main__.py +0 -0
- {accli-2.1.3 → accli-2.1.4}/accli/cleanup-nfs.ps1 +0 -0
- {accli-2.1.3 → accli-2.1.4}/accli/cli.py +0 -0
- {accli-2.1.3 → accli-2.1.4}/accli/common.py +0 -0
- {accli-2.1.3 → accli-2.1.4}/accli/job_views.py +0 -0
- {accli-2.1.3 → accli-2.1.4}/accli/log_timeline.py +0 -0
- {accli-2.1.3 → accli-2.1.4}/accli/mount_downloader.py +0 -0
- {accli-2.1.3 → accli-2.1.4}/accli/nfs_watcher.py +0 -0
- {accli-2.1.3 → accli-2.1.4}/accli/refresh_explorer.ps1 +0 -0
- {accli-2.1.3 → accli-2.1.4}/accli/setup-nfs.ps1 +0 -0
- {accli-2.1.3 → accli-2.1.4}/accli/token.py +0 -0
- {accli-2.1.3 → accli-2.1.4}/accli/version_checker.py +0 -0
- {accli-2.1.3 → accli-2.1.4}/accli.egg-info/dependency_links.txt +0 -0
- {accli-2.1.3 → accli-2.1.4}/accli.egg-info/entry_points.txt +0 -0
- {accli-2.1.3 → accli-2.1.4}/accli.egg-info/requires.txt +0 -0
- {accli-2.1.3 → accli-2.1.4}/accli.egg-info/top_level.txt +0 -0
- {accli-2.1.3 → accli-2.1.4}/setup.cfg +0 -0
- {accli-2.1.3 → accli-2.1.4}/tests/test_jobs_commands.py +0 -0
- {accli-2.1.3 → accli-2.1.4}/tests/test_log_timeline.py +0 -0
- {accli-2.1.3 → accli-2.1.4}/tests/test_logs_command.py +0 -0
- {accli-2.1.3 → accli-2.1.4}/tests/test_mount_lifecycle.py +0 -0
- {accli-2.1.3 → accli-2.1.4}/tests/test_update_check.py +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -5,6 +5,7 @@ import time
|
|
|
5
5
|
import platform
|
|
6
6
|
import threading
|
|
7
7
|
import subprocess
|
|
8
|
+
import webbrowser
|
|
8
9
|
from pathlib import Path
|
|
9
10
|
|
|
10
11
|
def setup_tcl_tk_env():
|
|
@@ -33,7 +34,7 @@ from tkinter import ttk, messagebox, filedialog
|
|
|
33
34
|
|
|
34
35
|
# Ensure PyInstaller static analyzer traces and bundles all CLI dependencies
|
|
35
36
|
import accli.cli
|
|
36
|
-
from accli.version_checker import check_for_updates, get_upgrade_instruction
|
|
37
|
+
from accli.version_checker import RELEASES_URL, check_for_updates, get_upgrade_instruction
|
|
37
38
|
from accli._version import VERSION
|
|
38
39
|
|
|
39
40
|
class AccliGuiApp(tk.Tk):
|
|
@@ -42,6 +43,7 @@ class AccliGuiApp(tk.Tk):
|
|
|
42
43
|
self.title("IIASA Accelerator Client (accli)")
|
|
43
44
|
self.geometry("800x600")
|
|
44
45
|
self.minsize(700, 500)
|
|
46
|
+
self.set_app_icon()
|
|
45
47
|
|
|
46
48
|
# Apply dark modern theme style
|
|
47
49
|
self.style = ttk.Style()
|
|
@@ -54,6 +56,17 @@ class AccliGuiApp(tk.Tk):
|
|
|
54
56
|
self.refresh_login_status()
|
|
55
57
|
self.refresh_mounts_list()
|
|
56
58
|
self.check_version_async()
|
|
59
|
+
|
|
60
|
+
def set_app_icon(self):
|
|
61
|
+
base_dir = Path(getattr(sys, "_MEIPASS", Path(__file__).parent))
|
|
62
|
+
for candidate in (Path(__file__).parent / "acc_logo.png", base_dir / "accli" / "acc_logo.png", base_dir / "acc_logo.png"):
|
|
63
|
+
if candidate.is_file():
|
|
64
|
+
try:
|
|
65
|
+
self._app_icon = tk.PhotoImage(file=str(candidate))
|
|
66
|
+
self.iconphoto(True, self._app_icon)
|
|
67
|
+
break
|
|
68
|
+
except Exception:
|
|
69
|
+
pass
|
|
57
70
|
|
|
58
71
|
def configure_styles(self):
|
|
59
72
|
self.configure(bg="#1e1e1e")
|
|
@@ -128,14 +141,77 @@ class AccliGuiApp(tk.Tk):
|
|
|
128
141
|
def show_notice():
|
|
129
142
|
self.status_bar_val.set(f"Update available: accli {latest} (current: {VERSION})")
|
|
130
143
|
self.append_log(f"\n🔔 Update available: accli {latest} (current: {VERSION})\n{instruction}\n\n")
|
|
131
|
-
|
|
132
|
-
messagebox.showinfo(
|
|
133
|
-
"Update Available",
|
|
134
|
-
f"Update available: accli {latest} (current: {VERSION})\n\n{instruction}"
|
|
135
|
-
)
|
|
144
|
+
self.show_update_dialog(latest, instruction)
|
|
136
145
|
self.after(0, show_notice)
|
|
137
146
|
threading.Thread(target=worker, daemon=True).start()
|
|
138
147
|
|
|
148
|
+
def show_update_dialog(self, latest: str, instruction: str):
|
|
149
|
+
dialog = tk.Toplevel(self)
|
|
150
|
+
dialog.title("Update Available")
|
|
151
|
+
dialog.configure(bg="#1e1e1e")
|
|
152
|
+
dialog.resizable(False, False)
|
|
153
|
+
dialog.transient(self)
|
|
154
|
+
|
|
155
|
+
frame = ttk.Frame(dialog, padding=20)
|
|
156
|
+
frame.pack(fill=tk.BOTH, expand=True)
|
|
157
|
+
|
|
158
|
+
ttk.Label(
|
|
159
|
+
frame,
|
|
160
|
+
text=f"Update available: accli {latest} (current: {VERSION})",
|
|
161
|
+
font=("Segoe UI", 11, "bold"),
|
|
162
|
+
).pack(anchor=tk.W, pady=(0, 10))
|
|
163
|
+
|
|
164
|
+
if RELEASES_URL in instruction:
|
|
165
|
+
prompt_text = "Download the latest release from:"
|
|
166
|
+
copy_value = RELEASES_URL
|
|
167
|
+
else:
|
|
168
|
+
prompt_text = instruction
|
|
169
|
+
copy_value = "pip install -U accli"
|
|
170
|
+
|
|
171
|
+
ttk.Label(frame, text=prompt_text).pack(anchor=tk.W, pady=(0, 5))
|
|
172
|
+
|
|
173
|
+
link_var = tk.StringVar(value=copy_value)
|
|
174
|
+
link_entry = tk.Entry(
|
|
175
|
+
frame,
|
|
176
|
+
textvariable=link_var,
|
|
177
|
+
state="readonly",
|
|
178
|
+
readonlybackground="#2d2d2d",
|
|
179
|
+
fg="#4ec9b0",
|
|
180
|
+
relief=tk.FLAT,
|
|
181
|
+
font=("Segoe UI", 10),
|
|
182
|
+
width=58,
|
|
183
|
+
)
|
|
184
|
+
link_entry.pack(fill=tk.X, pady=(0, 15), ipady=4)
|
|
185
|
+
link_entry.selection_range(0, tk.END)
|
|
186
|
+
|
|
187
|
+
btn_frame = ttk.Frame(frame)
|
|
188
|
+
btn_frame.pack(fill=tk.X)
|
|
189
|
+
|
|
190
|
+
def copy_to_clipboard():
|
|
191
|
+
self.clipboard_clear()
|
|
192
|
+
self.clipboard_append(copy_value)
|
|
193
|
+
self.update()
|
|
194
|
+
copy_btn.configure(text="Copied!")
|
|
195
|
+
dialog.after(1500, lambda: copy_btn.configure(text="Copy Link" if RELEASES_URL in instruction else "Copy"))
|
|
196
|
+
|
|
197
|
+
copy_btn = ttk.Button(
|
|
198
|
+
btn_frame,
|
|
199
|
+
text="Copy Link" if RELEASES_URL in instruction else "Copy",
|
|
200
|
+
command=copy_to_clipboard,
|
|
201
|
+
)
|
|
202
|
+
copy_btn.pack(side=tk.LEFT, padx=(0, 8))
|
|
203
|
+
|
|
204
|
+
if RELEASES_URL in instruction:
|
|
205
|
+
open_btn = ttk.Button(
|
|
206
|
+
btn_frame,
|
|
207
|
+
text="Open in Browser",
|
|
208
|
+
command=lambda: webbrowser.open(RELEASES_URL),
|
|
209
|
+
)
|
|
210
|
+
open_btn.pack(side=tk.LEFT, padx=(0, 8))
|
|
211
|
+
|
|
212
|
+
ok_btn = ttk.Button(btn_frame, text="OK", style="Refresh.TButton", command=dialog.destroy)
|
|
213
|
+
ok_btn.pack(side=tk.RIGHT)
|
|
214
|
+
|
|
139
215
|
def run_cli_async(self, args, on_done=None, log_to_viewer=True, elevate=False):
|
|
140
216
|
"""Runs the CLI binary in a background thread to prevent UI freezing."""
|
|
141
217
|
def worker():
|
|
@@ -164,14 +240,20 @@ class AccliGuiApp(tk.Tk):
|
|
|
164
240
|
startupinfo = subprocess.STARTUPINFO()
|
|
165
241
|
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
|
|
166
242
|
|
|
243
|
+
env = os.environ.copy()
|
|
244
|
+
env["PYTHONIOENCODING"] = "utf-8"
|
|
245
|
+
env["PYTHONUTF8"] = "1"
|
|
246
|
+
|
|
167
247
|
process = subprocess.Popen(
|
|
168
248
|
cmd,
|
|
169
249
|
stdout=subprocess.PIPE,
|
|
170
250
|
stderr=subprocess.STDOUT,
|
|
171
251
|
text=True,
|
|
252
|
+
encoding="utf-8",
|
|
172
253
|
errors="replace",
|
|
173
254
|
bufsize=1,
|
|
174
|
-
startupinfo=startupinfo
|
|
255
|
+
startupinfo=startupinfo,
|
|
256
|
+
env=env,
|
|
175
257
|
)
|
|
176
258
|
|
|
177
259
|
output_lines = []
|
|
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
|