From caecf07c06b9d66296fb08a3be8c076f1c92c8d6 Mon Sep 17 00:00:00 2001 From: Brett Williams Date: Wed, 21 Aug 2024 00:49:03 -0500 Subject: [PATCH] More wip --- src/distributed_job_manager.py | 16 ++++++++-------- src/init.py | 16 +++++++--------- src/render_queue.py | 1 - src/ui/main_window.py | 16 ++++++++-------- 4 files changed, 23 insertions(+), 26 deletions(-) diff --git a/src/distributed_job_manager.py b/src/distributed_job_manager.py index ee6d2f7..d3cb38a 100644 --- a/src/distributed_job_manager.py +++ b/src/distributed_job_manager.py @@ -39,10 +39,10 @@ class DistributedJobManager: """ Responds to the 'frame_complete' pubsub message for local jobs. - Parameters: - job_id (str): The ID of the job that has changed status. - old_status (str): The previous status of the job. - new_status (str): The new (current) status of the job. + Args: + job_id (str): The ID of the job that has changed status. + old_status (str): The previous status of the job. + new_status (str): The new (current) status of the job. Note: Do not call directly. Instead, call via the 'frame_complete' pubsub message. """ @@ -75,10 +75,10 @@ class DistributedJobManager: Responds to the 'status_change' pubsub message for local jobs. If it's a child job, it notifies the parent job about the status change. - Parameters: - job_id (str): The ID of the job that has changed status. - old_status (str): The previous status of the job. - new_status (str): The new (current) status of the job. + Args: + job_id (str): The ID of the job that has changed status. + old_status (str): The previous status of the job. + new_status (str): The new (current) status of the job. Note: Do not call directly. Instead, call via the 'status_change' pubsub message. """ diff --git a/src/init.py b/src/init.py index c5cc400..6abdad4 100644 --- a/src/init.py +++ b/src/init.py @@ -1,11 +1,9 @@ -''' app/init.py ''' import logging import multiprocessing import os import socket import sys import threading -import time from collections import deque from src.api.api_server import start_server @@ -22,8 +20,10 @@ logger = logging.getLogger() def run(server_only=False) -> int: - """ - Initializes the application and runs it. + """Initializes the application and runs it. + + Args: + server_only: Run in server-only CLI mode. Default is False (runs in GUI mode). Returns: int: The exit status code. @@ -84,9 +84,7 @@ def run(server_only=False) -> int: 'system_os_version': current_system_os_version()} ZeroconfServer.start() logger.info(f"Zordon Render Server started - Hostname: {local_hostname}") - - RenderQueue.evaluation_inverval = Config.queue_eval_seconds - RenderQueue.start() + RenderQueue.start() # Start evaluating the render queue # start in gui or server only (cli) mode logger.debug(f"Launching in {'server only' if server_only else 'GUI'} mode") @@ -137,8 +135,8 @@ def __setup_buffer_handler(): buffer_handler = BufferingHandler() buffer_handler.setFormatter(logging.getLogger().handlers[0].formatter) - logger = logging.getLogger() - logger.addHandler(buffer_handler) + new_logger = logging.getLogger() + new_logger.addHandler(buffer_handler) return buffer_handler diff --git a/src/render_queue.py b/src/render_queue.py index 7b90161..c81a72d 100755 --- a/src/render_queue.py +++ b/src/render_queue.py @@ -30,7 +30,6 @@ class RenderQueue: last_saved_counts = {} is_running = False __eval_thread = None - evaluation_interval = 1 # -------------------------------------------- # Start / Stop Background Updates diff --git a/src/ui/main_window.py b/src/ui/main_window.py index 7577b07..e56782a 100644 --- a/src/ui/main_window.py +++ b/src/ui/main_window.py @@ -20,14 +20,14 @@ from src.render_queue import RenderQueue from src.utilities.misc_helper import get_time_elapsed, resources_dir, is_localhost from src.utilities.status_utils import RenderStatus from src.utilities.zeroconf_server import ZeroconfServer -from .add_job import NewRenderJobForm -from .console import ConsoleWindow -from .engine_browser import EngineBrowserWindow -from .log_viewer import LogViewer -from .widgets.menubar import MenuBar -from .widgets.proportional_image_label import ProportionalImageLabel -from .widgets.statusbar import StatusBar -from .widgets.toolbar import ToolBar +from src.ui.add_job import NewRenderJobForm +from src.ui.console import ConsoleWindow +from src.ui.engine_browser import EngineBrowserWindow +from src.ui.log_viewer import LogViewer +from src.ui.widgets.menubar import MenuBar +from src.ui.widgets.proportional_image_label import ProportionalImageLabel +from src.ui.widgets.statusbar import StatusBar +from src.ui.widgets.toolbar import ToolBar from src.api.serverproxy_manager import ServerProxyManager from src.utilities.misc_helper import launch_url