mirror of
https://github.com/overcuriousity/trace.git
synced 2025-12-20 21:12:22 +00:00
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:
@@ -163,7 +163,7 @@ def main():
|
|||||||
|
|
||||||
# Launch TUI (with optional direct navigation to active context)
|
# Launch TUI (with optional direct navigation to active context)
|
||||||
try:
|
try:
|
||||||
from .tui import run_tui
|
from .tui_app import run_tui
|
||||||
run_tui(open_active=args.open)
|
run_tui(open_active=args.open)
|
||||||
except ImportError as e:
|
except ImportError as e:
|
||||||
print(f"Error launching TUI: {e}")
|
print(f"Error launching TUI: {e}")
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
"""TUI (Text User Interface) package for trace application"""
|
"""TUI (Text User Interface) package for trace application"""
|
||||||
|
|
||||||
# Import from the main tui module for backward compatibility
|
# Import from the main tui_app module for backward compatibility
|
||||||
# The tui.py file contains the main TUI class and run_tui function
|
# 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']
|
||||||
|
|||||||
Reference in New Issue
Block a user