Major refactor of Ameba Control Panel v3.1.0: - Three-column layout: icon sidebar, config+history, log view - Dracula PRO theme with light/dark toggle - DTR/RTS GPIO control (replaces ASCII commands) - Multi-CDC firmware support for AmebaSmart control device - Dynamic DUT tabs with +/- management - NN Model flash image support - Settings dialog (Font, Serial, Flash, Command tabs) - Background port scanning, debounced session store - Adaptive log flush rate, format cache optimization - Smooth sidebar animation, deferred startup - pytest test framework with session/log/settings tests - Thread safety fixes: _alive guards, parented timers, safe baud parsing - Find highlight: needle-only highlighting with focused match color - Partial line buffering for table output - PyInstaller packaging with version stamp and module exclusions Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
36 lines
950 B
Python
36 lines
950 B
Python
import sys
|
|
from pathlib import Path
|
|
|
|
|
|
def _bootstrap_path() -> None:
|
|
root = Path(__file__).resolve().parent.parent
|
|
if getattr(sys, "frozen", False):
|
|
root = Path(sys._MEIPASS) if hasattr(sys, "_MEIPASS") else root # type: ignore[attr-defined]
|
|
if str(root) not in sys.path:
|
|
sys.path.insert(0, str(root))
|
|
|
|
|
|
_bootstrap_path()
|
|
|
|
from ameba_control_panel.app import main # noqa: E402
|
|
|
|
|
|
if __name__ == "__main__":
|
|
if "--profile" in sys.argv:
|
|
sys.argv.remove("--profile")
|
|
import cProfile
|
|
import pstats
|
|
profiler = cProfile.Profile()
|
|
profiler.enable()
|
|
try:
|
|
main()
|
|
finally:
|
|
profiler.disable()
|
|
stats = pstats.Stats(profiler)
|
|
stats.sort_stats("cumulative")
|
|
stats.print_stats(40)
|
|
stats.dump_stats("profile_output.prof")
|
|
print("Profile saved to profile_output.prof")
|
|
else:
|
|
main()
|