fixed imports in ftrack subprocesses

This commit is contained in:
iLLiCiTiT 2020-12-07 13:04:58 +01:00
parent 59cef39c82
commit 79da225622
4 changed files with 8 additions and 76 deletions

View file

@ -41,76 +41,6 @@ TOPIC_STATUS_SERVER_RESULT = "pype.event.server.status.result"
log = Logger().get_logger("ftrack_server.lib")
def clockify_event_path():
api_key = os.environ.get("CLOCKIFY_API_KEY")
if not api_key:
log.warning("Clockify API key is not set.")
return
workspace_name = os.environ.get("CLOCKIFY_WORKSPACE")
if not workspace_name:
log.warning("Clockify Workspace is not set.")
return
from pype.modules.clockify.constants import CLOCKIFY_FTRACK_SERVER_PATH
return CLOCKIFY_FTRACK_SERVER_PATH
def get_server_event_handler_paths():
paths = []
# Add pype's default dir
paths.append(SERVER_HANDLERS_DIR)
# Add additional paths from settings
paths.extend(
get_system_settings()
["modules"]
["Ftrack"]
["ftrack_events_path"]
)
try:
clockify_path = clockify_event_path()
if clockify_path:
paths.append(clockify_path)
except Exception:
log.warning("Clockify paths function failed.", exc_info=True)
# Filter only existing paths
_paths = []
for path in paths:
if os.path.exists(path):
_paths.append(path)
else:
log.warning((
"Registered event handler path is not accessible: {}"
).format(path))
return _paths
def get_user_event_handler_paths():
paths = []
# Add pype's default dir
paths.append(USER_HANDLERS_DIR)
# Add additional paths from settings
paths.extend(
get_system_settings()
["modules"]
["Ftrack"]
["ftrack_actions_path"]
)
# Filter only existing paths
_paths = []
for path in paths:
if os.path.exists(path):
_paths.append(path)
else:
log.warning((
"Registered event handler path is not accessible: {}"
).format(path))
return _paths
def get_ftrack_event_mongo_info():
database_name = (
os.environ.get("FTRACK_EVENTS_MONGO_DB") or "pype"

View file

@ -8,9 +8,9 @@ from ftrack_server import FtrackServer
from pype.modules.ftrack.ftrack_server.lib import (
SocketSession,
ProcessEventHub,
TOPIC_STATUS_SERVER,
get_server_event_handler_paths
TOPIC_STATUS_SERVER
)
from pype.modules.ftrack.lib import get_server_event_handler_paths
from pype.api import Logger

View file

@ -9,8 +9,10 @@ import datetime
import ftrack_api
from ftrack_server import FtrackServer
from pype.modules.ftrack.ftrack_server.lib import (
SocketSession, StatusEventHub,
TOPIC_STATUS_SERVER, TOPIC_STATUS_SERVER_RESULT
SocketSession,
StatusEventHub,
TOPIC_STATUS_SERVER,
TOPIC_STATUS_SERVER_RESULT
)
from pype.api import Logger

View file

@ -5,9 +5,9 @@ import socket
from ftrack_server import FtrackServer
from pype.modules.ftrack.ftrack_server.lib import (
SocketSession,
SocketBaseEventHub,
get_user_event_handler_paths
SocketBaseEventHub
)
from pype.modules.ftrack.lib import get_user_event_handler_paths
from pype.api import Logger