Fix import error: rename tui.py to tui_app.py to avoid package naming conflict

Resolved naming conflict between trace/tui.py (file) and trace/tui/ (package).
Python prioritizes packages over modules with the same name, causing import failures.

Changes:
- Renamed trace/tui.py to trace/tui_app.py
- Updated trace/cli.py to import from tui_app
- Updated trace/tui/__init__.py to re-export from tui_app for backward compatibility

This allows both direct imports (from trace.tui_app) and package imports (from trace.tui)
to work correctly, maintaining backward compatibility while supporting the new modular structure.
This commit is contained in:
Claude
2025-12-13 18:05:12 +00:00
parent b6387f4b0c
commit eec759aafb
3 changed files with 5 additions and 4 deletions

View File

@@ -163,7 +163,7 @@ def main():
# Launch TUI (with optional direct navigation to active context)
try:
from .tui import run_tui
from .tui_app import run_tui
run_tui(open_active=args.open)
except ImportError as e:
print(f"Error launching TUI: {e}")

View File

@@ -1,6 +1,7 @@
"""TUI (Text User Interface) package for trace application"""
# Import from the main tui module for backward compatibility
# The tui.py file contains the main TUI class and run_tui function
# Import from the main tui_app module for backward compatibility
# The tui_app.py file contains the main TUI class and run_tui function
from ..tui_app import run_tui, TUI
__all__ = []
__all__ = ['run_tui', 'TUI']