Skip to content

main

dev_tool.main

log = logging.getLogger('dev_tool') module-attribute

cleanup

Source code in dev_tool/main.py
def cleanup() -> None:
    message = 'Exiting...'
    CONTEXT.notification.normal_text(message)

    log.debug(message)

    logging.shutdown()

    CONTEXT.configuration.stop_watching()

    for thread in threading.enumerate():
        if thread is not threading.main_thread() and not thread.daemon:
            message = f'Waiting for thread {thread.name} to finish...'
            log.debug(message)

            thread.join(timeout=1)

main

Source code in dev_tool/main.py
def main() -> None:
    CONTEXT.configuration.initialize_watcher()
    CONTEXT.configuration.create_default_development_env()
    CONTEXT.configuration.create_default_pyproject()
    CONTEXT.configuration.start_watching()

    container = DependencyContainer()

    ServiceRegistry.register_all_services(container)
    CommandGroupRegistry.register_command_groups(container)

    container.resolve(HomeCommandGroup)
    container.resolve(DjangoCommandGroup)
    container.resolve(PythonCommandGroup)
    # container.resolve(AICommandGroup)
    container.resolve(DatabaseCommandGroup)
    container.resolve(TaskCommandGroup)
    container.resolve(OtherCommandGroup)

    if len(sys.argv) > 1:
        run_cli_application()
    else:
        run_tui_application()