From 1fee2d524c9f5273fc9efe3db710b95609b9a465 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Fri, 4 Dec 2020 13:05:16 +0100 Subject: [PATCH] fix imports in lib --- pype/__init__.py | 7 ++++--- pype/lib/applications.py | 8 ++++---- pype/lib/avalon_context.py | 2 +- pype/lib/plugin_tools.py | 2 +- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/pype/__init__.py b/pype/__init__.py index d88299693e..ff1ca29919 100644 --- a/pype/__init__.py +++ b/pype/__init__.py @@ -4,7 +4,8 @@ import os import functools import logging -pyblish = avalon = config = Anatomy = filter_pyblish_plugins = None +pyblish = avalon = filter_pyblish_plugins = None +get_project_settings = Anatomy = None log = logging.getLogger(__name__) @@ -27,14 +28,14 @@ def import_wrapper(func): def decorated(*args, **kwargs): global pyblish global avalon - global config + global get_project_settings global Anatomy global filter_pyblish_plugins global _original_discover if pyblish is None: from pyblish import api as pyblish from avalon import api as avalon - from .api import Anatomy, config + from .api import Anatomy, get_project_settings from .lib import filter_pyblish_plugins # we are monkey patching `avalon.api.discover()` to allow us to diff --git a/pype/lib/applications.py b/pype/lib/applications.py index 7d8635b30a..5619b166ed 100644 --- a/pype/lib/applications.py +++ b/pype/lib/applications.py @@ -9,7 +9,7 @@ from abc import ABCMeta, abstractmethod import six from pype.settings import get_system_settings, get_environments -from ..api import Logger +from . import PypeLogger from .python_module_tools import ( modules_from_path, @@ -132,7 +132,7 @@ def _subprocess(*args, **kwargs): class ApplicationManager: def __init__(self): - self.log = Logger().get_logger(self.__class__.__name__) + self.log = PypeLogger().get_logger(self.__class__.__name__) self.applications = {} self.tools = {} @@ -379,7 +379,7 @@ class LaunchHook: Always should be called """ - self.log = Logger().get_logger(self.__class__.__name__) + self.log = PypeLogger().get_logger(self.__class__.__name__) self.launch_context = launch_context @@ -513,7 +513,7 @@ class ApplicationLaunchContext: # Logger logger_name = "{}-{}".format(self.__class__.__name__, self.app_name) - self.log = Logger().get_logger(logger_name) + self.log = PypeLogger().get_logger(logger_name) self.executable = executable diff --git a/pype/lib/avalon_context.py b/pype/lib/avalon_context.py index e0dca20789..1d3461b6b5 100644 --- a/pype/lib/avalon_context.py +++ b/pype/lib/avalon_context.py @@ -5,7 +5,7 @@ import logging import collections import functools -from . import config +from pype.settings import get_project_settings log = logging.getLogger("AvalonContext") diff --git a/pype/lib/plugin_tools.py b/pype/lib/plugin_tools.py index a78c9e525e..ea8ddb83d4 100644 --- a/pype/lib/plugin_tools.py +++ b/pype/lib/plugin_tools.py @@ -4,7 +4,7 @@ import os import inspect import logging -from ..api import get_project_settings +from pype.settings import get_project_settings log = logging.getLogger(__name__)