diff --git a/pype/lib/__init__.py b/pype/lib/__init__.py index f4282f7ea3..49ebd699b6 100644 --- a/pype/lib/__init__.py +++ b/pype/lib/__init__.py @@ -9,7 +9,7 @@ import site # add Python version specific vendor folder site.addsitedir( os.path.join( - os.getenv("PYPE_ROOT", ""), + os.getenv("OPENPYPE_ROOT", ""), "vendor", "python", "python_{}".format(sys.version[0]))) from .terminal import Terminal diff --git a/pype/lib/abstract_submit_deadline.py b/pype/lib/abstract_submit_deadline.py index 9862f534f1..12014ddfb5 100644 --- a/pype/lib/abstract_submit_deadline.py +++ b/pype/lib/abstract_submit_deadline.py @@ -607,7 +607,7 @@ class AbstractSubmitDeadline(pyblish.api.InstancePlugin): """ if 'verify' not in kwargs: - kwargs['verify'] = False if os.getenv("PYPE_DONT_VERIFY_SSL", True) else True # noqa + kwargs['verify'] = False if os.getenv("OPENPYPE_DONT_VERIFY_SSL", True) else True # noqa # add 10sec timeout before bailing out kwargs['timeout'] = 10 return requests.post(*args, **kwargs) @@ -626,7 +626,7 @@ class AbstractSubmitDeadline(pyblish.api.InstancePlugin): """ if 'verify' not in kwargs: - kwargs['verify'] = False if os.getenv("PYPE_DONT_VERIFY_SSL", True) else True # noqa + kwargs['verify'] = False if os.getenv("OPENPYPE_DONT_VERIFY_SSL", True) else True # noqa # add 10sec timeout before bailing out kwargs['timeout'] = 10 return requests.get(*args, **kwargs) diff --git a/pype/lib/anatomy.py b/pype/lib/anatomy.py index 4e7643dbbb..4c1a183ce0 100644 --- a/pype/lib/anatomy.py +++ b/pype/lib/anatomy.py @@ -156,7 +156,7 @@ class Anatomy: return self._roots_obj def root_environments(self): - """Return PYPE_ROOT_* environments for current project in dict.""" + """Return OPENPYPE_ROOT_* environments for current project in dict.""" return self._roots_obj.root_environments() def root_environmets_fill_data(self, template=None): @@ -181,7 +181,7 @@ class Anatomy: return self.roots_obj.all_root_paths() def set_root_environments(self): - """Set PYPE_ROOT_* environments for current project.""" + """Set OPENPYPE_ROOT_* environments for current project.""" self._roots_obj.set_root_environments() def root_names(self): @@ -320,7 +320,7 @@ class Anatomy: "<{}>" ## Output - "/project/asset/task/animation_v001.ma" + "/project/asset/task/animation_v001.ma" Args: filepath (str): Full file path where root should be replaced. @@ -1359,7 +1359,7 @@ class Roots: anatomy Anatomy: Anatomy object created for a specific project. """ - env_prefix = "PYPE_PROJECT_ROOT" + env_prefix = "OPENPYPE_PROJECT_ROOT" roots_filename = "roots.json" def __init__(self, anatomy): @@ -1465,7 +1465,8 @@ class Roots: def root_environments(self): """Use root keys to create unique keys for environment variables. - Concatenates prefix "PYPE_ROOT" with root keys to create unique keys. + Concatenates prefix "OPENPYPE_ROOT" with root keys to create unique + keys. Returns: dict: Result is `{(str): (str)}` dicitonary where key represents @@ -1487,13 +1488,13 @@ class Roots: Result on windows platform:: { - "PYPE_ROOT_WORK": "P:/projects/work", - "PYPE_ROOT_PUBLISH": "P:/projects/publish" + "OPENPYPE_ROOT_WORK": "P:/projects/work", + "OPENPYPE_ROOT_PUBLISH": "P:/projects/publish" } Short example when multiroot is not used:: { - "PYPE_ROOT": "P:/projects" + "OPENPYPE_ROOT": "P:/projects" } """ return self._root_environments() diff --git a/pype/lib/applications.py b/pype/lib/applications.py index 6df296db95..4ebf34597f 100644 --- a/pype/lib/applications.py +++ b/pype/lib/applications.py @@ -1187,7 +1187,7 @@ def _prepare_last_workfile(data, workdir): file_template = anatomy.templates["work"]["file"] workdir_data.update({ "version": 1, - "user": os.environ.get("PYPE_USERNAME") or getpass.getuser(), + "user": os.environ.get("OPENPYPE_USERNAME") or getpass.getuser(), "ext": extensions[0] }) diff --git a/pype/lib/avalon_context.py b/pype/lib/avalon_context.py index d4daf22142..393b6820fa 100644 --- a/pype/lib/avalon_context.py +++ b/pype/lib/avalon_context.py @@ -1153,7 +1153,7 @@ def get_creator_by_name(creator_name, case_sensitive=False): @with_avalon def change_timer_to_current_context(): """Called after context change to change timers""" - webserver_url = os.environ.get("PYPE_WEBSERVER_URL") + webserver_url = os.environ.get("OPENPYPE_WEBSERVER_URL") if not webserver_url: log.warning("Couldn't find webserver url") return diff --git a/pype/lib/execute.py b/pype/lib/execute.py index f815d05f1b..441dcfa754 100644 --- a/pype/lib/execute.py +++ b/pype/lib/execute.py @@ -150,13 +150,13 @@ def get_pype_execute_args(*args): It is possible to pass any arguments that will be added after pype executables. """ - pype_executable = os.environ["PYPE_EXECUTABLE"] + pype_executable = os.environ["OPENPYPE_EXECUTABLE"] pype_args = [pype_executable] executable_filename = os.path.basename(pype_executable) if "python" in executable_filename.lower(): pype_args.append( - os.path.join(os.environ["PYPE_ROOT"], "start.py") + os.path.join(os.environ["OPENPYPE_ROOT"], "start.py") ) if args: diff --git a/pype/lib/import_utils.py b/pype/lib/import_utils.py index 5c832a925c..5fca0ae5f9 100644 --- a/pype/lib/import_utils.py +++ b/pype/lib/import_utils.py @@ -8,7 +8,7 @@ log = Logger().get_logger(__name__) def discover_host_vendor_module(module_name): host = os.environ["AVALON_APP"] - pype_root = os.environ["PYPE_ROOT"] + pype_root = os.environ["OPENPYPE_ROOT"] main_module = module_name.split(".")[0] module_path = os.path.join( pype_root, "hosts", host, "vendor", main_module) diff --git a/pype/lib/local_settings.py b/pype/lib/local_settings.py index aa372a52d2..a26d08a4de 100644 --- a/pype/lib/local_settings.py +++ b/pype/lib/local_settings.py @@ -213,7 +213,7 @@ class IniSettingRegistry(ASettingRegistry): # type: (str, str) -> IniSettingRegistry super(IniSettingRegistry, self).__init__(name) # get registry file - version = os.getenv("PYPE_VERSION", "N/A") + version = os.getenv("OPENPYPE_VERSION", "N/A") self._registry_file = os.path.join(path, "{}.ini".format(name)) if not os.path.exists(self._registry_file): with open(self._registry_file, mode="w") as cfg: @@ -369,7 +369,7 @@ class JSONSettingRegistry(ASettingRegistry): now = datetime.now().strftime("%d/%m/%Y %H:%M:%S") header = { "__metadata__": { - "pype-version": os.getenv("PYPE_VERSION", "N/A"), + "pype-version": os.getenv("OPENPYPE_VERSION", "N/A"), "generated": now }, "registry": {} diff --git a/pype/lib/log.py b/pype/lib/log.py index f6e95eea8a..9675637700 100644 --- a/pype/lib/log.py +++ b/pype/lib/log.py @@ -1,11 +1,11 @@ """ Logging to console and to mongo. For mongo logging, you need to set either -``PYPE_LOG_MONGO_URL`` to something like: +``OPENPYPE_LOG_MONGO_URL`` to something like: .. example:: mongo://user:password@hostname:port/database/collection?authSource=avalon -or set ``PYPE_LOG_MONGO_HOST`` and other variables. +or set ``OPENPYPE_LOG_MONGO_HOST`` and other variables. See :func:`_mongo_settings` Best place for it is in ``repos/pype-config/environments/global.json`` @@ -207,7 +207,7 @@ class PypeLogger: # Collection name under database in Mongo log_collection_name = "logs" - # PYPE_DEBUG + # OPENPYPE_DEBUG pype_debug = 0 # Data same for all record documents @@ -335,7 +335,7 @@ class PypeLogger: # like Ftrack event server has 3 other subprocesses that should # use same mongo id if use_mongo_logging: - mongo_id = os.environ.pop("PYPE_PROCESS_MONGO_ID", None) + mongo_id = os.environ.pop("OPENPYPE_PROCESS_MONGO_ID", None) if not mongo_id: # Create new object id mongo_id = ObjectId() @@ -347,11 +347,11 @@ class PypeLogger: # Store result to class definition cls.use_mongo_logging = use_mongo_logging - # Define if is in PYPE_DEBUG mode - cls.pype_debug = int(os.getenv("PYPE_DEBUG") or "0") + # Define if is in OPENPYPE_DEBUG mode + cls.pype_debug = int(os.getenv("OPENPYPE_DEBUG") or "0") # Mongo URL where logs will be stored - cls.log_mongo_url = os.environ.get("PYPE_MONGO") + cls.log_mongo_url = os.environ.get("OPENPYPE_MONGO") if not cls.log_mongo_url: cls.use_mongo_logging = False diff --git a/pype/lib/mongo.py b/pype/lib/mongo.py index 3ee43bb934..edb52a29ab 100644 --- a/pype/lib/mongo.py +++ b/pype/lib/mongo.py @@ -77,7 +77,7 @@ def compose_url(scheme=None, def get_default_components(): - mongo_url = os.environ.get("PYPE_MONGO") + mongo_url = os.environ.get("OPENPYPE_MONGO") if mongo_url is None: raise MongoEnvNotSet( "URL for Mongo logging connection is not set." @@ -139,7 +139,7 @@ class PypeMongoConnection: @staticmethod def get_default_mongo_url(): - return os.environ["PYPE_MONGO"] + return os.environ["OPENPYPE_MONGO"] @classmethod def get_mongo_client(cls, mongo_url=None): diff --git a/pype/lib/plugin_tools.py b/pype/lib/plugin_tools.py index 0f3a0a2838..f352f134d0 100644 --- a/pype/lib/plugin_tools.py +++ b/pype/lib/plugin_tools.py @@ -235,7 +235,7 @@ def oiio_supported(): Returns: (bool) """ - oiio_path = os.getenv("PYPE_OIIO_PATH", "") + oiio_path = os.getenv("OPENPYPE_OIIO_PATH", "") if not oiio_path or not os.path.exists(oiio_path): log.debug("OIIOTool is not configured or not present at {}". format(oiio_path)) @@ -269,7 +269,7 @@ def decompress(target_dir, file_url, (int(input_frame_end) > int(input_frame_start)) oiio_cmd = [] - oiio_cmd.append(os.getenv("PYPE_OIIO_PATH")) + oiio_cmd.append(os.getenv("OPENPYPE_OIIO_PATH")) oiio_cmd.append("--compression none") @@ -328,7 +328,7 @@ def should_decompress(file_url): """ if oiio_supported(): output = run_subprocess([ - os.getenv("PYPE_OIIO_PATH"), + os.getenv("OPENPYPE_OIIO_PATH"), "--info", "-v", file_url]) return "compression: \"dwaa\"" in output or \ "compression: \"dwab\"" in output diff --git a/pype/lib/pype_info.py b/pype/lib/pype_info.py index cbcc5811a0..d9e810e556 100644 --- a/pype/lib/pype_info.py +++ b/pype/lib/pype_info.py @@ -28,8 +28,8 @@ def get_pype_info(): "version": get_pype_version(), "version_type": version_type, "executable": executable_args[-1], - "pype_root": os.environ["PYPE_ROOT"], - "mongo_url": os.environ["PYPE_MONGO"] + "pype_root": os.environ["OPENPYPE_ROOT"], + "mongo_url": os.environ["OPENPYPE_MONGO"] } diff --git a/pype/lib/terminal.py b/pype/lib/terminal.py index 51b0bcebd6..9e9bfa9790 100644 --- a/pype/lib/terminal.py +++ b/pype/lib/terminal.py @@ -21,7 +21,7 @@ class Terminal: If :mod:`Colorama` is not found, it will still work, but without colors. Depends on :mod:`Colorama` - Using **PYPE_LOG_NO_COLORS** environment variable. + Using **OPENPYPE_LOG_NO_COLORS** environment variable. """ # Is Terminal initialized @@ -38,7 +38,8 @@ class Terminal: """Initialize Terminal class as object. First check if colorized output is disabled by environment variable - `PYPE_LOG_NO_COLORS` value. By default is colorized output turned on. + `OPENPYPE_LOG_NO_COLORS` value. By default is colorized output turned + on. Then tries to import python module that do the colors magic and create it's terminal object. Colorized output is not used if import of python @@ -49,7 +50,7 @@ class Terminal: from pype.lib import env_value_to_bool use_colors = env_value_to_bool( - "PYPE_LOG_NO_COLORS", default=Terminal.use_colors + "OPENPYPE_LOG_NO_COLORS", default=Terminal.use_colors ) if not use_colors: Terminal.use_colors = use_colors @@ -166,7 +167,7 @@ class Terminal: def log(message): """Return color formatted message. - If environment variable `PYPE_LOG_NO_COLORS` is set to + If environment variable `OPENPYPE_LOG_NO_COLORS` is set to whatever value, message will be formatted but not colorized. Args: