From e0fb4c6442fcb61b7d96948fdb824e647e465522 Mon Sep 17 00:00:00 2001 From: amcmanu3 Date: Sun, 5 Jun 2022 16:02:52 -0400 Subject: [PATCH] Fix version3 imports --- app/classes/shared/command.py | 7 +++++-- main.py | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/app/classes/shared/command.py b/app/classes/shared/command.py index 5e75879f..9234d84b 100644 --- a/app/classes/shared/command.py +++ b/app/classes/shared/command.py @@ -16,12 +16,15 @@ logger = logging.getLogger(__name__) class MainPrompt(cmd.Cmd): - def __init__(self, helper, tasks_manager, migration_manager, main_controller): + def __init__( + self, helper, tasks_manager, migration_manager, main_controller, import3 + ): super().__init__() self.helper: Helpers = helper self.tasks_manager: TasksManager = tasks_manager self.migration_manager: MigrationManager = migration_manager self.controller: Controller = main_controller + self.import3: Import3 = import3 # overrides the default Prompt self.prompt = f"Crafty Controller v{self.helper.get_version_string()} > " @@ -101,7 +104,7 @@ class MainPrompt(cmd.Cmd): self.stdout.flush() def do_import3(self, _line): - Import3.start_import() + self.import3.start_import() def universal_exit(self): logger.info("Stopping all server daemons / threads") diff --git a/main.py b/main.py index 89d740e3..6e7cb3dd 100644 --- a/main.py +++ b/main.py @@ -6,6 +6,7 @@ import time import argparse import logging.config import signal +from app.classes.shared.import3 import Import3 import peewee from app.classes.models.users import HelperUsers from app.classes.shared.console import Console @@ -133,6 +134,7 @@ if __name__ == "__main__": # now the tables are created, we can load the tasks_manager and server controller controller = Controller(database, helper) + import3 = Import3(helper, controller) tasks_manager = TasksManager(helper, controller) tasks_manager.start_webserver() @@ -194,7 +196,9 @@ if __name__ == "__main__": controller.clear_unexecuted_commands() controller.clear_support_status() - crafty_prompt = MainPrompt(helper, tasks_manager, migration_manager, controller) + crafty_prompt = MainPrompt( + helper, tasks_manager, migration_manager, controller, import3 + ) controller_setup_thread = Thread(target=controller_setup, name="controller_setup")