fix: GUI Tkinter - use instance variables for tk and ttk
Fix NameError by storing tk and ttk as instance variables at the beginning of _run_tkinter method, so they're accessible in all Tkinter-related methods (_refresh_sessions, _show_harness_dialog, _show_session_details). Also removed redundant tkinter imports in helper methods. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -531,13 +531,15 @@ class AgentCostEstimatorGUI:
|
||||
|
||||
def _show_session_details(self, harness_name: str, session_id: str):
|
||||
"""Show detailed information for a session."""
|
||||
from tkinter import messagebox
|
||||
|
||||
# Find the session
|
||||
if self.session_discovery:
|
||||
harnesses = self.session_discovery.discover_sessions()
|
||||
if harness_name in harnesses:
|
||||
for session in harnesses[harness_name].sessions:
|
||||
if session.session_id == session_id:
|
||||
self.tk.messagebox.showinfo(
|
||||
messagebox.showinfo(
|
||||
f"Session: {session.session_id}",
|
||||
f"Model: {session.model}\n"
|
||||
f"Session Price: ${session.session_price:.2f}\n"
|
||||
@@ -546,7 +548,7 @@ class AgentCostEstimatorGUI:
|
||||
)
|
||||
return
|
||||
|
||||
self.tk.messagebox.showwarning("Not Found", f"Session {session_id} not found")
|
||||
messagebox.showwarning("Not Found", f"Session {session_id} not found")
|
||||
|
||||
def _auto_refresh(self):
|
||||
"""Auto-refresh sessions."""
|
||||
|
||||
Reference in New Issue
Block a user