From a8ab4d288b1b153c5cc7201d33a7686370ba161d Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 18 Mar 2021 14:25:48 +0100 Subject: [PATCH] moved scripts to scripts folder --- .../ftrack/ftrack_server/event_server_cli.py | 13 +++++++------ .../sub_event_processor.py | 0 .../{ftrack_server => scripts}/sub_event_status.py | 0 .../{ftrack_server => scripts}/sub_event_storer.py | 0 .../{ftrack_server => scripts}/sub_legacy_server.py | 0 .../{ftrack_server => scripts}/sub_user_server.py | 0 pype/modules/ftrack/tray/ftrack_tray.py | 3 ++- 7 files changed, 9 insertions(+), 7 deletions(-) rename pype/modules/ftrack/{ftrack_server => scripts}/sub_event_processor.py (100%) rename pype/modules/ftrack/{ftrack_server => scripts}/sub_event_status.py (100%) rename pype/modules/ftrack/{ftrack_server => scripts}/sub_event_storer.py (100%) rename pype/modules/ftrack/{ftrack_server => scripts}/sub_legacy_server.py (100%) rename pype/modules/ftrack/{ftrack_server => scripts}/sub_user_server.py (100%) diff --git a/pype/modules/ftrack/ftrack_server/event_server_cli.py b/pype/modules/ftrack/ftrack_server/event_server_cli.py index 5e885e47f3..c70a12aefb 100644 --- a/pype/modules/ftrack/ftrack_server/event_server_cli.py +++ b/pype/modules/ftrack/ftrack_server/event_server_cli.py @@ -18,6 +18,7 @@ from pype.lib import ( get_pype_execute_args, PypeMongoConnection ) +from pype.modules.ftrack import FTRACK_MODULE_DIR from pype.modules.ftrack.lib import ( credentials, get_ftrack_url_from_settings @@ -98,14 +99,14 @@ def validate_credentials(url, user, api): def legacy_server(ftrack_url): # Current file - file_path = os.path.dirname(os.path.realpath(__file__)) + scripts_dir = os.path.join(FTRACK_MODULE_DIR, "scripts") min_fail_seconds = 5 max_fail_count = 3 wait_time_after_max_fail = 10 subproc = None - subproc_path = "{}/sub_legacy_server.py".format(file_path) + subproc_path = "{}/sub_legacy_server.py".format(scripts_dir) subproc_last_failed = datetime.datetime.now() subproc_failed_count = 0 @@ -183,7 +184,7 @@ def main_loop(ftrack_url): mongo_uri = PypeMongoConnection.get_default_mongo_url() # Current file - file_path = os.path.dirname(os.path.realpath(__file__)) + scripts_dir = os.path.join(FTRACK_MODULE_DIR, "scripts") min_fail_seconds = 5 max_fail_count = 3 @@ -192,21 +193,21 @@ def main_loop(ftrack_url): # Threads data storer_name = "StorerThread" storer_port = 10001 - storer_path = "{}/sub_event_storer.py".format(file_path) + storer_path = "{}/sub_event_storer.py".format(scripts_dir) storer_thread = None storer_last_failed = datetime.datetime.now() storer_failed_count = 0 processor_name = "ProcessorThread" processor_port = 10011 - processor_path = "{}/sub_event_processor.py".format(file_path) + processor_path = "{}/sub_event_processor.py".format(scripts_dir) processor_thread = None processor_last_failed = datetime.datetime.now() processor_failed_count = 0 statuser_name = "StorerThread" statuser_port = 10021 - statuser_path = "{}/sub_event_status.py".format(file_path) + statuser_path = "{}/sub_event_status.py".format(scripts_dir) statuser_thread = None statuser_last_failed = datetime.datetime.now() statuser_failed_count = 0 diff --git a/pype/modules/ftrack/ftrack_server/sub_event_processor.py b/pype/modules/ftrack/scripts/sub_event_processor.py similarity index 100% rename from pype/modules/ftrack/ftrack_server/sub_event_processor.py rename to pype/modules/ftrack/scripts/sub_event_processor.py diff --git a/pype/modules/ftrack/ftrack_server/sub_event_status.py b/pype/modules/ftrack/scripts/sub_event_status.py similarity index 100% rename from pype/modules/ftrack/ftrack_server/sub_event_status.py rename to pype/modules/ftrack/scripts/sub_event_status.py diff --git a/pype/modules/ftrack/ftrack_server/sub_event_storer.py b/pype/modules/ftrack/scripts/sub_event_storer.py similarity index 100% rename from pype/modules/ftrack/ftrack_server/sub_event_storer.py rename to pype/modules/ftrack/scripts/sub_event_storer.py diff --git a/pype/modules/ftrack/ftrack_server/sub_legacy_server.py b/pype/modules/ftrack/scripts/sub_legacy_server.py similarity index 100% rename from pype/modules/ftrack/ftrack_server/sub_legacy_server.py rename to pype/modules/ftrack/scripts/sub_legacy_server.py diff --git a/pype/modules/ftrack/ftrack_server/sub_user_server.py b/pype/modules/ftrack/scripts/sub_user_server.py similarity index 100% rename from pype/modules/ftrack/ftrack_server/sub_user_server.py rename to pype/modules/ftrack/scripts/sub_user_server.py diff --git a/pype/modules/ftrack/tray/ftrack_tray.py b/pype/modules/ftrack/tray/ftrack_tray.py index 3f6432e541..1009d93afe 100644 --- a/pype/modules/ftrack/tray/ftrack_tray.py +++ b/pype/modules/ftrack/tray/ftrack_tray.py @@ -8,6 +8,7 @@ import ftrack_api from ..ftrack_server.lib import check_ftrack_url from ..ftrack_server import socket_thread from ..lib import credentials +from ..ftrack_module import FTRACK_MODULE_DIR from . import login_dialog from pype.api import Logger, resources @@ -132,7 +133,7 @@ class FtrackTrayWrapper: thread_name = "ActionServerThread" thread_port = 10021 subprocess_path = ( - "{}/ftrack_server/sub_user_server.py".format(parent_file_path) + "{}/scripts/sub_user_server.py".format(FTRACK_MODULE_DIR) ) if self.thread_socket_server is not None: self.thread_socket_server.stop()