From the review of #108.
MECHS and hab_pages are declared empty at module level and filled by prepare(); only the __main__ block calls prepare() before main(). Anyone importing the module and calling main() — a test, a future driver script — gets KeyError: 'HabitatMech' from scan() rather than a message saying the checkouts were never resolved.
Fix belongs in #108: have main() call prepare() itself (it is idempotent enough for a single run, and main() is the one entry point that needs the filesystem), and keep __main__ calling main() alone.
From the review of #108.
MECHSandhab_pagesare declared empty at module level and filled byprepare(); only the__main__block callsprepare()beforemain(). Anyone importing the module and callingmain()— a test, a future driver script — getsKeyError: 'HabitatMech'fromscan()rather than a message saying the checkouts were never resolved.Fix belongs in #108: have
main()callprepare()itself (it is idempotent enough for a single run, andmain()is the one entry point that needs the filesystem), and keep__main__callingmain()alone.