progress?
This commit is contained in:
@@ -72,8 +72,8 @@ def main():
|
||||
print(f"Last packet: {last_time}")
|
||||
return
|
||||
|
||||
# Load PCAP file
|
||||
if args.pcap:
|
||||
# Load PCAP file (skip for textual mode which uses background parsing)
|
||||
if args.pcap and not args.textual:
|
||||
try:
|
||||
loader = PCAPLoader(args.pcap)
|
||||
if not loader.validate_file():
|
||||
@@ -93,6 +93,16 @@ def main():
|
||||
except Exception as e:
|
||||
print(f"Error loading PCAP file: {e}")
|
||||
sys.exit(1)
|
||||
elif args.pcap and args.textual:
|
||||
# For textual mode, just validate the file exists
|
||||
try:
|
||||
loader = PCAPLoader(args.pcap)
|
||||
if not loader.validate_file():
|
||||
print(f"Error: Invalid or inaccessible PCAP file: {args.pcap}")
|
||||
sys.exit(1)
|
||||
except Exception as e:
|
||||
print(f"Error validating PCAP file: {e}")
|
||||
sys.exit(1)
|
||||
|
||||
# Handle console output mode
|
||||
if args.no_tui:
|
||||
@@ -106,9 +116,24 @@ def main():
|
||||
|
||||
# TUI mode - choose between classic, modern curses, and textual interface
|
||||
if args.textual:
|
||||
# Use new Textual-based interface (TipTop-inspired)
|
||||
# Use new Textual-based interface (TipTop-inspired) with background parsing
|
||||
app = StreamLensAppV2(analyzer)
|
||||
app.run()
|
||||
|
||||
try:
|
||||
# Start background parsing if PCAP file provided
|
||||
if args.pcap:
|
||||
app.start_background_parsing(args.pcap)
|
||||
|
||||
app.run()
|
||||
except KeyboardInterrupt:
|
||||
print("\nShutting down...")
|
||||
finally:
|
||||
# Cleanup background threads
|
||||
try:
|
||||
app.cleanup()
|
||||
except Exception as e:
|
||||
print(f"Cleanup error: {e}")
|
||||
pass
|
||||
return
|
||||
elif args.classic:
|
||||
tui = TUIInterface(analyzer)
|
||||
|
||||
Reference in New Issue
Block a user