diff --git a/igniter/bootstrap_repos.py b/igniter/bootstrap_repos.py index 16e0f212e9..121c0ade9c 100644 --- a/igniter/bootstrap_repos.py +++ b/igniter/bootstrap_repos.py @@ -633,9 +633,9 @@ class BootstrapRepos: if openpype_path: dir_to_search = openpype_path else: - if os.getenv("PYPE_PATH"): - if Path(os.getenv("PYPE_PATH")).exists(): - dir_to_search = Path(os.getenv("PYPE_PATH")) + if os.getenv("OPENPYPE_PATH"): + if Path(os.getenv("OPENPYPE_PATH")).exists(): + dir_to_search = Path(os.getenv("OPENPYPE_PATH")) else: try: registry_dir = Path( @@ -679,7 +679,7 @@ class BootstrapRepos: if location.startswith("mongodb"): pype_path = get_openpype_path_from_db(location) if not openpype_path: - self._print("cannot find PYPE_PATH in settings.") + self._print("cannot find OPENPYPE_PATH in settings.") return None # if not successful, consider location to be fs path. diff --git a/igniter/install_dialog.py b/igniter/install_dialog.py index 1e3e52d81f..2cc0ed8448 100644 --- a/igniter/install_dialog.py +++ b/igniter/install_dialog.py @@ -46,7 +46,10 @@ class InstallDialog(QtWidgets.QDialog): self.mongo_url = "" try: - self.mongo_url = os.getenv("PYPE_MONGO", "") or self.registry.get_secure_item("pypeMongo") # noqa: E501 + self.mongo_url = ( + os.getenv("OPENPYPE_MONGO", "") + or self.registry.get_secure_item("openPypeMongo") + ) except ValueError: pass diff --git a/igniter/install_thread.py b/igniter/install_thread.py index 5f9fdef115..bf5d541056 100644 --- a/igniter/install_thread.py +++ b/igniter/install_thread.py @@ -68,7 +68,7 @@ class InstallThread(QThread): # user did not entered url if not self._mongo: # it not set in environment - if not os.getenv("PYPE_MONGO"): + if not os.getenv("OPENPYPE_MONGO"): # try to get it from settings registry try: self._mongo = bs.registry.get_secure_item( @@ -79,17 +79,17 @@ class InstallThread(QThread): self.finished.emit(InstallResult(-1)) return else: - self._mongo = os.getenv("PYPE_MONGO") + self._mongo = os.getenv("OPENPYPE_MONGO") else: self.message.emit("Saving mongo connection string ...", False) bs.registry.set_secure_item("openPypeMongo", self._mongo) - os.environ["PYPE_MONGO"] = self._mongo + os.environ["OPENPYPE_MONGO"] = self._mongo self.message.emit( f"Detecting installed OpenPype versions in {bs.data_dir}", False) - detected = bs.find_pype(include_zips=True) + detected = bs.find_openpype(include_zips=True) if detected: if OpenPypeVersion( @@ -170,7 +170,7 @@ class InstallThread(QThread): self.finished.emit(InstallResult(-1)) return bs.registry.set_secure_item("openPypeMongo", self._mongo) - os.environ["PYPE_MONGO"] = self._mongo + os.environ["OPENPYPE_MONGO"] = self._mongo self.message.emit(f"processing {self._path}", True) repo_file = bs.process_entered_location(self._path) diff --git a/igniter/user_settings.py b/igniter/user_settings.py index 039f19373b..77fb8b5ae5 100644 --- a/igniter/user_settings.py +++ b/igniter/user_settings.py @@ -211,7 +211,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: @@ -367,7 +367,7 @@ class JSONSettingRegistry(ASettingRegistry): now = datetime.now().strftime("%d/%m/%Y %H:%M:%S") header = { "__metadata__": { - "openpype-version": os.getenv("PYPE_VERSION", "N/A"), + "openpype-version": os.getenv("OPENPYPE_VERSION", "N/A"), "generated": now }, "registry": {} diff --git a/pype/cli.py b/pype/cli.py index f67cf10ea1..c6da88cbc1 100644 --- a/pype/cli.py +++ b/pype/cli.py @@ -93,7 +93,7 @@ def eventserver(debug, provided credentials will be stored for later use. """ if debug: - os.environ['PYPE_DEBUG'] = "3" + os.environ['OPENPYPE_DEBUG'] = "3" PypeCommands().launch_eventservercli( ftrack_url, @@ -139,7 +139,7 @@ def publish(debug, paths): More than one path is allowed. """ if debug: - os.environ['PYPE_DEBUG'] = '3' + os.environ['OPENPYPE_DEBUG'] = '3' PypeCommands.publish(list(paths)) @@ -164,7 +164,7 @@ def texturecopy(debug, project, asset, path): Nothing is written to database. """ if debug: - os.environ['PYPE_DEBUG'] = '3' + os.environ['OPENPYPE_DEBUG'] = '3' PypeCommands().texture_copy(project, asset, path) @@ -178,7 +178,7 @@ def texturecopy(debug, project, asset, path): default=lambda: os.environ.get('AVALON_TASK', '')) @click.option("--tools", help="List of tools to add") @click.option("--user", help="Pype user name", - default=lambda: os.environ.get('PYPE_USERNAME', '')) + default=lambda: os.environ.get('OPENPYPE_USERNAME', '')) @click.option("-fs", "--ftrack-server", help="Registered application name", @@ -214,7 +214,7 @@ def launch(app, project, asset, task, os.environ["FTRACK_API_KEY"] = ftrack_key if user: - os.environ["PYPE_USERNAME"] = user + os.environ["OPENPYPE_USERNAME"] = user # test required if not project or not asset or not task: diff --git a/pype/hooks/pre_python2_vendor.py b/pype/hooks/pre_python2_vendor.py index 6f34e44132..377431b372 100644 --- a/pype/hooks/pre_python2_vendor.py +++ b/pype/hooks/pre_python2_vendor.py @@ -11,7 +11,7 @@ class PrePython2Vendor(PreLaunchHook): def execute(self): # Prepare vendor dir path self.log.info("adding global python 2 vendor") - pype_root = os.getenv("PYPE_ROOT") + pype_root = os.getenv("OPENPYPE_ROOT") python_2_vendor = os.path.join( pype_root, "pype", @@ -32,4 +32,3 @@ class PrePython2Vendor(PreLaunchHook): # Set new PYTHONPATH to launch context environments self.launch_context.env["PYTHONPATH"] = os.pathsep.join(python_paths) - \ No newline at end of file diff --git a/pype/hosts/celaction/hooks/pre_celaction_registers.py b/pype/hosts/celaction/hooks/pre_celaction_registers.py index 40e8eaa6ff..2e535d6d77 100644 --- a/pype/hosts/celaction/hooks/pre_celaction_registers.py +++ b/pype/hosts/celaction/hooks/pre_celaction_registers.py @@ -35,7 +35,7 @@ class CelactionPrelaunchHook(PreLaunchHook): winreg.KEY_ALL_ACCESS) # TODO: this will need to be checked more thoroughly - pype_exe = os.getenv("PYPE_EXECUTABLE") + pype_exe = os.getenv("OPENPYPE_EXECUTABLE") winreg.SetValueEx(hKey, "SubmitAppTitle", 0, winreg.REG_SZ, pype_exe) diff --git a/pype/hosts/fusion/api/__init__.py b/pype/hosts/fusion/api/__init__.py index 61eaf44ddb..5581a0a9cb 100644 --- a/pype/hosts/fusion/api/__init__.py +++ b/pype/hosts/fusion/api/__init__.py @@ -15,7 +15,7 @@ from .lib import ( update_frame_range ) -from .menu import launch_pype_menu +from .menu import launch_openpype_menu __all__ = [ @@ -34,5 +34,5 @@ __all__ = [ "update_frame_range", # menu - "launch_pype_menu", + "launch_openpype_menu", ] diff --git a/pype/hosts/fusion/api/menu.py b/pype/hosts/fusion/api/menu.py index c37f1daa49..b338b361d0 100644 --- a/pype/hosts/fusion/api/menu.py +++ b/pype/hosts/fusion/api/menu.py @@ -49,11 +49,11 @@ class Spacer(QtWidgets.QWidget): self.setLayout(layout) -class PypeMenu(QtWidgets.QWidget): +class OpenPypeMenu(QtWidgets.QWidget): def __init__(self, *args, **kwargs): super(self.__class__, self).__init__(*args, **kwargs) - self.setObjectName("PypeMenu") + self.setObjectName("OpenPypeMenu") self.setWindowFlags( QtCore.Qt.Window @@ -63,14 +63,14 @@ class PypeMenu(QtWidgets.QWidget): | QtCore.Qt.WindowStaysOnTopHint ) self.render_mode_widget = None - self.setWindowTitle("Pype") - workfiles_btn = QtWidgets.QPushButton("Workfiles", self) - create_btn = QtWidgets.QPushButton("Create", self) - publish_btn = QtWidgets.QPushButton("Publish", self) - load_btn = QtWidgets.QPushButton("Load", self) - inventory_btn = QtWidgets.QPushButton("Inventory", self) - libload_btn = QtWidgets.QPushButton("Library", self) - rendermode_btn = QtWidgets.QPushButton("Set render mode", self) + self.setWindowTitle("OpenPype") + workfiles_btn = QtWidgets.QPushButton("Workfiles ...", self) + create_btn = QtWidgets.QPushButton("Create ...", self) + publish_btn = QtWidgets.QPushButton("Publish ...", self) + load_btn = QtWidgets.QPushButton("Load ...", self) + inventory_btn = QtWidgets.QPushButton("Inventory ...", self) + libload_btn = QtWidgets.QPushButton("Library ...", self) + rendermode_btn = QtWidgets.QPushButton("Set render mode ...", self) duplicate_with_inputs_btn = QtWidgets.QPushButton( "Duplicate with input connections", self ) @@ -156,11 +156,11 @@ class PypeMenu(QtWidgets.QWidget): print("Clicked Reset Resolution") -def launch_pype_menu(): +def launch_openpype_menu(): app = QtWidgets.QApplication(sys.argv) app.setQuitOnLastWindowClosed(False) - pype_menu = PypeMenu() + pype_menu = OpenPypeMenu() stylesheet = load_stylesheet() pype_menu.setStyleSheet(stylesheet) diff --git a/pype/hosts/fusion/api/menu_style.qss b/pype/hosts/fusion/api/menu_style.qss index df4fd7e949..12c474b070 100644 --- a/pype/hosts/fusion/api/menu_style.qss +++ b/pype/hosts/fusion/api/menu_style.qss @@ -20,7 +20,7 @@ QPushButton:hover { color: #e64b3d; } -#PypeMenu { +#OpenPypeMenu { border: 1px solid #fef9ef; } diff --git a/pype/hosts/fusion/api/pipeline.py b/pype/hosts/fusion/api/pipeline.py index 36084dc734..bcb2b0aaf3 100644 --- a/pype/hosts/fusion/api/pipeline.py +++ b/pype/hosts/fusion/api/pipeline.py @@ -11,9 +11,6 @@ import pype.hosts.fusion log = Logger().get_logger(__name__) - -AVALON_CONFIG = os.getenv("AVALON_CONFIG", "pype") - HOST_DIR = os.path.dirname(os.path.abspath(pype.hosts.fusion.__file__)) PLUGINS_DIR = os.path.join(HOST_DIR, "plugins") diff --git a/pype/hosts/fusion/utility_scripts/Pype_menu.py b/pype/hosts/fusion/utility_scripts/__OpenPype_Menu__.py similarity index 93% rename from pype/hosts/fusion/utility_scripts/Pype_menu.py rename to pype/hosts/fusion/utility_scripts/__OpenPype_Menu__.py index 0cd2b7502e..8940f5fc52 100644 --- a/pype/hosts/fusion/utility_scripts/Pype_menu.py +++ b/pype/hosts/fusion/utility_scripts/__OpenPype_Menu__.py @@ -18,7 +18,7 @@ def main(env): log.info(f"Avalon registred hosts: {avalon.api.registered_host()}") - menu.launch_pype_menu() + menu.launch_openpype_menu() if __name__ == "__main__": diff --git a/pype/hosts/harmony/api/__init__.py b/pype/hosts/harmony/api/__init__.py index 1a0255d045..ae1450d9cc 100644 --- a/pype/hosts/harmony/api/__init__.py +++ b/pype/hosts/harmony/api/__init__.py @@ -154,7 +154,7 @@ def application_launch(): # It is now moved so it it manually called. # ensure_scene_settings() # check_inventory() - # fills PYPE_HARMONY_JS + # fills OPENPYPE_HARMONY_JS pype_harmony_path = Path(__file__).parent.parent / "js" / "PypeHarmony.js" pype_harmony_js = pype_harmony_path.read_text() diff --git a/pype/hosts/harmony/js/creators/CreateRender.js b/pype/hosts/harmony/js/creators/CreateRender.js index cfb0701df4..92ec6dfd2f 100644 --- a/pype/hosts/harmony/js/creators/CreateRender.js +++ b/pype/hosts/harmony/js/creators/CreateRender.js @@ -6,8 +6,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var PYPE_HARMONY_JS = System.getenv('PYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(PYPE_HARMONY_JS.replace(/\\/g, "/")); + var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; + include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); } diff --git a/pype/hosts/harmony/js/loaders/ImageSequenceLoader.js b/pype/hosts/harmony/js/loaders/ImageSequenceLoader.js index cfa71e2834..d809c350ab 100644 --- a/pype/hosts/harmony/js/loaders/ImageSequenceLoader.js +++ b/pype/hosts/harmony/js/loaders/ImageSequenceLoader.js @@ -5,8 +5,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var PYPE_HARMONY_JS = System.getenv('PYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(PYPE_HARMONY_JS.replace(/\\/g, "/")); + var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; + include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); } if (typeof $ === 'undefined'){ diff --git a/pype/hosts/harmony/js/loaders/TemplateLoader.js b/pype/hosts/harmony/js/loaders/TemplateLoader.js index 160979f943..1df04c8282 100644 --- a/pype/hosts/harmony/js/loaders/TemplateLoader.js +++ b/pype/hosts/harmony/js/loaders/TemplateLoader.js @@ -6,8 +6,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var PYPE_HARMONY_JS = System.getenv('PYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(PYPE_HARMONY_JS.replace(/\\/g, "/")); + var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; + include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); } if (typeof $ === 'undefined'){ diff --git a/pype/hosts/harmony/js/publish/CollectCurrentFile.js b/pype/hosts/harmony/js/publish/CollectCurrentFile.js index d39f23712d..2eeb7fb764 100644 --- a/pype/hosts/harmony/js/publish/CollectCurrentFile.js +++ b/pype/hosts/harmony/js/publish/CollectCurrentFile.js @@ -6,8 +6,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var PYPE_HARMONY_JS = System.getenv('PYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(PYPE_HARMONY_JS.replace(/\\/g, "/")); + var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; + include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); } diff --git a/pype/hosts/harmony/js/publish/CollectFarmRender.js b/pype/hosts/harmony/js/publish/CollectFarmRender.js index 7c0cda5165..759dc5ce5d 100644 --- a/pype/hosts/harmony/js/publish/CollectFarmRender.js +++ b/pype/hosts/harmony/js/publish/CollectFarmRender.js @@ -6,8 +6,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var PYPE_HARMONY_JS = System.getenv('PYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(PYPE_HARMONY_JS.replace(/\\/g, "/")); + var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; + include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); } diff --git a/pype/hosts/harmony/js/publish/CollectPalettes.js b/pype/hosts/harmony/js/publish/CollectPalettes.js index 8fda55ff75..afb0ad854a 100644 --- a/pype/hosts/harmony/js/publish/CollectPalettes.js +++ b/pype/hosts/harmony/js/publish/CollectPalettes.js @@ -6,8 +6,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var PYPE_HARMONY_JS = System.getenv('PYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(PYPE_HARMONY_JS.replace(/\\/g, "/")); + var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; + include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); } diff --git a/pype/hosts/harmony/js/publish/ExtractPalette.js b/pype/hosts/harmony/js/publish/ExtractPalette.js index 794c6fdbb1..c4765354c4 100644 --- a/pype/hosts/harmony/js/publish/ExtractPalette.js +++ b/pype/hosts/harmony/js/publish/ExtractPalette.js @@ -6,8 +6,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var PYPE_HARMONY_JS = System.getenv('PYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(PYPE_HARMONY_JS.replace(/\\/g, "/")); + var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; + include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); } /** diff --git a/pype/hosts/harmony/js/publish/ExtractTemplate.js b/pype/hosts/harmony/js/publish/ExtractTemplate.js index d36a8947f8..4676e1ff68 100644 --- a/pype/hosts/harmony/js/publish/ExtractTemplate.js +++ b/pype/hosts/harmony/js/publish/ExtractTemplate.js @@ -6,8 +6,8 @@ // check if PypeHarmony is defined and if not, load it. if (typeof PypeHarmony === 'undefined') { - var PYPE_HARMONY_JS = System.getenv('PYPE_HARMONY_JS') + '/PypeHarmony.js'; - include(PYPE_HARMONY_JS.replace(/\\/g, "/")); + var OPENPYPE_HARMONY_JS = System.getenv('OPENPYPE_HARMONY_JS') + '/PypeHarmony.js'; + include(OPENPYPE_HARMONY_JS.replace(/\\/g, "/")); } diff --git a/pype/hosts/houdini/startup/MainMenuCommon.XML b/pype/hosts/houdini/startup/MainMenuCommon.XML index ba639a71a1..faa811de86 100644 --- a/pype/hosts/houdini/startup/MainMenuCommon.XML +++ b/pype/hosts/houdini/startup/MainMenuCommon.XML @@ -2,21 +2,7 @@ - - - - - - - - - - + @@ -55,7 +41,7 @@ publish.show(parent) - + " ## 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: diff --git a/pype/modules/avalon_apps/avalon_app.py b/pype/modules/avalon_apps/avalon_app.py index 38d6e4394c..60f62fe731 100644 --- a/pype/modules/avalon_apps/avalon_app.py +++ b/pype/modules/avalon_apps/avalon_app.py @@ -23,7 +23,7 @@ class AvalonModule(PypeModule, ITrayModule, IWebServerRoutes): avalon_mongo_url = avalon_settings["AVALON_MONGO"] # Use pype mongo if Avalon's mongo not defined if not avalon_mongo_url: - avalon_mongo_url = os.environ["PYPE_MONGO"] + avalon_mongo_url = os.environ["OPENPYPE_MONGO"] thumbnail_root = os.environ.get("AVALON_THUMBNAIL_ROOT") if not thumbnail_root: diff --git a/pype/modules/deadline/plugins/publish/submit_aftereffects_deadline.py b/pype/modules/deadline/plugins/publish/submit_aftereffects_deadline.py index c1a6de4ce3..5ec5129fa4 100644 --- a/pype/modules/deadline/plugins/publish/submit_aftereffects_deadline.py +++ b/pype/modules/deadline/plugins/publish/submit_aftereffects_deadline.py @@ -64,9 +64,9 @@ class AfterEffectsSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline "AVALON_ASSET", "AVALON_TASK", "AVALON_APP_NAME", - "PYPE_USERNAME", - "PYPE_DEV", - "PYPE_LOG_NO_COLORS" + "OPENPYPE_USERNAME", + "OPENPYPE_DEV", + "OPENPYPE_LOG_NO_COLORS" ] environment = dict({key: os.environ[key] for key in keys @@ -78,7 +78,7 @@ class AfterEffectsSubmitDeadline(abstract_submit_deadline.AbstractSubmitDeadline key=key, value=val) # to recognize job from PYPE for turning Event On/Off - dln_job_info.EnvironmentKeyValue = "PYPE_RENDER_JOB=1" + dln_job_info.EnvironmentKeyValue = "OPENPYPE_RENDER_JOB=1" return dln_job_info diff --git a/pype/modules/deadline/plugins/publish/submit_harmony_deadline..py b/pype/modules/deadline/plugins/publish/submit_harmony_deadline..py index 8e85937353..d723490a69 100644 --- a/pype/modules/deadline/plugins/publish/submit_harmony_deadline..py +++ b/pype/modules/deadline/plugins/publish/submit_harmony_deadline..py @@ -273,9 +273,9 @@ class HarmonySubmitDeadline( "AVALON_ASSET", "AVALON_TASK", "AVALON_APP_NAME", - "PYPE_USERNAME", - "PYPE_DEV", - "PYPE_LOG_NO_COLORS" + "OPENPYPE_USERNAME", + "OPENPYPE_DEV", + "OPENPYPE_LOG_NO_COLORS" ] environment = dict({key: os.environ[key] for key in keys @@ -288,7 +288,7 @@ class HarmonySubmitDeadline( value=val) # to recognize job from PYPE for turning Event On/Off - job_info.EnvironmentKeyValue = "PYPE_RENDER_JOB=1" + job_info.EnvironmentKeyValue = "OPENPYPE_RENDER_JOB=1" return job_info diff --git a/pype/modules/deadline/plugins/publish/submit_maya_deadline.py b/pype/modules/deadline/plugins/publish/submit_maya_deadline.py index b17dd6ba8d..041a351de9 100644 --- a/pype/modules/deadline/plugins/publish/submit_maya_deadline.py +++ b/pype/modules/deadline/plugins/publish/submit_maya_deadline.py @@ -441,17 +441,17 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin): "AVALON_ASSET", "AVALON_TASK", "AVALON_APP_NAME", - "PYPE_USERNAME", - "PYPE_DEV", - "PYPE_LOG_NO_COLORS" + "OPENPYPE_USERNAME", + "OPENPYPE_DEV", + "OPENPYPE_LOG_NO_COLORS" ] environment = dict({key: os.environ[key] for key in keys if key in os.environ}, **api.Session) - environment["PYPE_LOG_NO_COLORS"] = "1" - environment["PYPE_MAYA_VERSION"] = cmds.about(v=True) + environment["OPENPYPE_LOG_NO_COLORS"] = "1" + environment["OPENPYPE_MAYA_VERSION"] = cmds.about(v=True) # to recognize job from PYPE for turning Event On/Off - environment["PYPE_RENDER_JOB"] = "1" + environment["OPENPYPE_RENDER_JOB"] = "1" self.payload_skeleton["JobInfo"].update({ "EnvironmentKeyValue%d" % index: "{key}={value}".format( key=key, @@ -858,20 +858,20 @@ class MayaSubmitDeadline(pyblish.api.InstancePlugin): envs.append( "AVALON_APP_NAME={}".format(os.environ.get("AVALON_APP_NAME"))) envs.append( - "PYPE_ASS_EXPORT_RENDER_LAYER={}".format(data["renderlayer"])) + "OPENPYPE_ASS_EXPORT_RENDER_LAYER={}".format(data["renderlayer"])) envs.append( - "PYPE_ASS_EXPORT_SCENE_FILE={}".format(data["filepath"])) + "OPENPYPE_ASS_EXPORT_SCENE_FILE={}".format(data["filepath"])) envs.append( - "PYPE_ASS_EXPORT_OUTPUT={}".format( + "OPENPYPE_ASS_EXPORT_OUTPUT={}".format( payload['JobInfo']['OutputFilename0'])) envs.append( - "PYPE_ASS_EXPORT_START={}".format( + "OPENPYPE_ASS_EXPORT_START={}".format( int(self._instance.data["frameStartHandle"]))) envs.append( - "PYPE_ASS_EXPORT_END={}".format( + "OPENPYPE_ASS_EXPORT_END={}".format( int(self._instance.data["frameEndHandle"]))) envs.append( - "PYPE_ASS_EXPORT_STEP={}".format(1)) + "OPENPYPE_ASS_EXPORT_STEP={}".format(1)) i = 0 for e in envs: @@ -984,7 +984,7 @@ class MayaSubmitDeadline(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) @@ -1003,7 +1003,7 @@ class MayaSubmitDeadline(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/modules/deadline/plugins/publish/submit_nuke_deadline.py b/pype/modules/deadline/plugins/publish/submit_nuke_deadline.py index a4653427bb..2e30e624ef 100644 --- a/pype/modules/deadline/plugins/publish/submit_nuke_deadline.py +++ b/pype/modules/deadline/plugins/publish/submit_nuke_deadline.py @@ -237,7 +237,7 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin): "PYBLISHPLUGINPATH", "NUKE_PATH", "TOOL_ENV", - "PYPE_DEV", + "OPENPYPE_DEV", "FOUNDRY_LICENSE" ] environment = dict({key: os.environ[key] for key in keys @@ -279,7 +279,7 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin): environment = clean_environment # to recognize job from PYPE for turning Event On/Off - environment["PYPE_RENDER_JOB"] = "1" + environment["OPENPYPE_RENDER_JOB"] = "1" payload["JobInfo"].update({ "EnvironmentKeyValue%d" % index: "{key}={value}".format( key=key, diff --git a/pype/modules/deadline/plugins/publish/submit_publish_job.py b/pype/modules/deadline/plugins/publish/submit_publish_job.py index 38d328b1cb..8f937b23df 100644 --- a/pype/modules/deadline/plugins/publish/submit_publish_job.py +++ b/pype/modules/deadline/plugins/publish/submit_publish_job.py @@ -114,16 +114,16 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): "FTRACK_API_USER", "FTRACK_API_KEY", "FTRACK_SERVER", - "PYPE_METADATA_FILE", + "OPENPYPE_METADATA_FILE", "AVALON_PROJECT", "AVALON_ASSET", "AVALON_TASK", "AVALON_APP_NAME", - "PYPE_PUBLISH_JOB" - "PYPE_LOG_NO_COLORS", - "PYPE_USERNAME", - "PYPE_RENDER_JOB", - "PYPE_PUBLISH_JOB" + "OPENPYPE_PUBLISH_JOB" + "OPENPYPE_LOG_NO_COLORS", + "OPENPYPE_USERNAME", + "OPENPYPE_RENDER_JOB", + "OPENPYPE_PUBLISH_JOB" ] # custom deadline atributes @@ -223,10 +223,10 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): environment["AVALON_ASSET"] = io.Session["AVALON_ASSET"] environment["AVALON_TASK"] = io.Session["AVALON_TASK"] environment["AVALON_APP_NAME"] = os.environ.get("AVALON_APP_NAME") - environment["PYPE_LOG_NO_COLORS"] = "1" - environment["PYPE_USERNAME"] = instance.context.data["user"] - environment["PYPE_PUBLISH_JOB"] = "1" - environment["PYPE_RENDER_JOB"] = "0" + environment["OPENPYPE_LOG_NO_COLORS"] = "1" + environment["OPENPYPE_USERNAME"] = instance.context.data["user"] + environment["OPENPYPE_PUBLISH_JOB"] = "1" + environment["OPENPYPE_RENDER_JOB"] = "0" args = [ 'publish', @@ -1048,4 +1048,4 @@ class ProcessSubmittedJobOnFarm(pyblish.api.InstancePlugin): # Directory publish_folder = os.path.dirname(file_path) - return publish_folder \ No newline at end of file + return publish_folder diff --git a/pype/modules/deadline/plugins/publish/validate_deadline_connection.py b/pype/modules/deadline/plugins/publish/validate_deadline_connection.py index 1c49e68ee1..88b3f42d49 100644 --- a/pype/modules/deadline/plugins/publish/validate_deadline_connection.py +++ b/pype/modules/deadline/plugins/publish/validate_deadline_connection.py @@ -44,5 +44,5 @@ class ValidateDeadlineConnection(pyblish.api.ContextPlugin): of defense SSL is providing and it is not recommended. """ 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 return requests.get(*args, **kwargs) diff --git a/pype/modules/ftrack/event_handlers_user/action_applications.py b/pype/modules/ftrack/event_handlers_user/action_applications.py index 2c42cadfb7..fcfebe5078 100644 --- a/pype/modules/ftrack/event_handlers_user/action_applications.py +++ b/pype/modules/ftrack/event_handlers_user/action_applications.py @@ -26,7 +26,7 @@ class AppplicationsAction(BaseAction): type = "Application" label = "Application action" identifier = "pype_app.{}.".format(str(uuid4())) - icon_url = os.environ.get("PYPE_STATICS_SERVER") + icon_url = os.environ.get("OPENPYPE_STATICS_SERVER") def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) diff --git a/pype/modules/ftrack/ftrack_server/socket_thread.py b/pype/modules/ftrack/ftrack_server/socket_thread.py index a895e0b900..181fad5ce5 100644 --- a/pype/modules/ftrack/ftrack_server/socket_thread.py +++ b/pype/modules/ftrack/ftrack_server/socket_thread.py @@ -12,7 +12,7 @@ from pype.lib import get_pype_execute_args class SocketThread(threading.Thread): """Thread that checks suprocess of storer of processor of events""" - MAX_TIMEOUT = int(os.environ.get("PYPE_FTRACK_SOCKET_TIMEOUT", 45)) + MAX_TIMEOUT = int(os.environ.get("OPENPYPE_FTRACK_SOCKET_TIMEOUT", 45)) def __init__(self, name, port, filepath, additional_args=[]): super(SocketThread, self).__init__() @@ -57,7 +57,7 @@ class SocketThread(threading.Thread): ) env = os.environ.copy() - env["PYPE_PROCESS_MONGO_ID"] = str(Logger.mongo_process_id) + env["OPENPYPE_PROCESS_MONGO_ID"] = str(Logger.mongo_process_id) # Pype executable (with path to start script if not build) args = get_pype_execute_args( # Add `run` command diff --git a/pype/modules/ftrack/lib/ftrack_action_handler.py b/pype/modules/ftrack/lib/ftrack_action_handler.py index d95c81955e..2bff9d8cb3 100644 --- a/pype/modules/ftrack/lib/ftrack_action_handler.py +++ b/pype/modules/ftrack/lib/ftrack_action_handler.py @@ -3,7 +3,7 @@ from .ftrack_base_handler import BaseHandler def statics_icon(*icon_statics_file_parts): - statics_server = os.environ.get("PYPE_STATICS_SERVER") + statics_server = os.environ.get("OPENPYPE_STATICS_SERVER") if not statics_server: return None return "/".join((statics_server, *icon_statics_file_parts)) diff --git a/pype/modules/ftrack/plugins/publish/validate_custom_ftrack_attributes.py b/pype/modules/ftrack/plugins/publish/validate_custom_ftrack_attributes.py index 03aa8844fd..549f48889d 100644 --- a/pype/modules/ftrack/plugins/publish/validate_custom_ftrack_attributes.py +++ b/pype/modules/ftrack/plugins/publish/validate_custom_ftrack_attributes.py @@ -8,7 +8,7 @@ class ValidateFtrackAttributes(pyblish.api.InstancePlugin): Attributes to be validated are specified in: - `$PYPE_CONFIG/presets//ftrack_attributes.json` + `$OPENPYPE_CONFIG/presets//ftrack_attributes.json` This is array (list) of checks in format: [ diff --git a/pype/modules/muster/muster.py b/pype/modules/muster/muster.py index 5595ccff15..1a82926802 100644 --- a/pype/modules/muster/muster.py +++ b/pype/modules/muster/muster.py @@ -153,5 +153,5 @@ class MusterModule(PypeModule, ITrayModule, IWebServerRoutes): of defense SSL is providing and it is not recommended. """ 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 return requests.post(*args, **kwargs) diff --git a/pype/modules/timers_manager/timers_manager.py b/pype/modules/timers_manager/timers_manager.py index b83f51f0ba..a8ea5799e6 100644 --- a/pype/modules/timers_manager/timers_manager.py +++ b/pype/modules/timers_manager/timers_manager.py @@ -221,7 +221,7 @@ class TimersManager(PypeModule, ITrayService, IIdleManager, IWebServerRoutes): def change_timer_from_host(self, project_name, asset_name, task_name): """Prepared method for calling change timers on REST api""" - webserver_url = os.environ.get("PYPE_WEBSERVER_URL") + webserver_url = os.environ.get("OPENPYPE_WEBSERVER_URL") if not webserver_url: self.log.warning("Couldn't find webserver url") return diff --git a/pype/modules/user/user_module.py b/pype/modules/user/user_module.py index 71c5fd124e..7d257f1781 100644 --- a/pype/modules/user/user_module.py +++ b/pype/modules/user/user_module.py @@ -29,7 +29,7 @@ class UserModule(PypeModule, ITrayModule, IWebServerRoutes): appdirs.user_data_dir('pype-app', 'pype') ) cred_filename = 'user_info.json' - env_name = "PYPE_USERNAME" + env_name = "OPENPYPE_USERNAME" name = "user" diff --git a/pype/modules/webserver/webserver_module.py b/pype/modules/webserver/webserver_module.py index 3b3f0e7a79..b3fb83596d 100644 --- a/pype/modules/webserver/webserver_module.py +++ b/pype/modules/webserver/webserver_module.py @@ -49,8 +49,8 @@ class WebServerModule(PypeModule, ITrayService): self.server_manager.add_static(static_prefix, resources.RESOURCES_DIR) webserver_url = "http://localhost:{}".format(self.port) - os.environ["PYPE_WEBSERVER_URL"] = webserver_url - os.environ["PYPE_STATICS_SERVER"] = "{}{}".format( + os.environ["OPENPYPE_WEBSERVER_URL"] = webserver_url + os.environ["OPENPYPE_STATICS_SERVER"] = "{}{}".format( webserver_url, static_prefix ) diff --git a/pype/plugins/publish/collect_current_pype_user.py b/pype/plugins/publish/collect_current_pype_user.py index a8947dd8fb..de4e950d56 100644 --- a/pype/plugins/publish/collect_current_pype_user.py +++ b/pype/plugins/publish/collect_current_pype_user.py @@ -11,7 +11,7 @@ class CollectCurrentUserPype(pyblish.api.ContextPlugin): label = "Collect Pype User" def process(self, context): - user = os.getenv("PYPE_USERNAME", "").strip() + user = os.getenv("OPENPYPE_USERNAME", "").strip() if not user: user = context.data.get("user", getpass.getuser()) diff --git a/pype/plugins/publish/collect_rendered_files.py b/pype/plugins/publish/collect_rendered_files.py index e0f3695fd5..edf9b50b92 100644 --- a/pype/plugins/publish/collect_rendered_files.py +++ b/pype/plugins/publish/collect_rendered_files.py @@ -17,7 +17,7 @@ from avalon import api class CollectRenderedFiles(pyblish.api.ContextPlugin): """ This collector will try to find json files in provided - `PYPE_PUBLISH_DATA`. Those files _MUST_ share same context. + `OPENPYPE_PUBLISH_DATA`. Those files _MUST_ share same context. """ order = pyblish.api.CollectorOrder - 0.2 @@ -113,9 +113,9 @@ class CollectRenderedFiles(pyblish.api.ContextPlugin): def process(self, context): self._context = context - assert os.environ.get("PYPE_PUBLISH_DATA"), ( - "Missing `PYPE_PUBLISH_DATA`") - paths = os.environ["PYPE_PUBLISH_DATA"].split(os.pathsep) + assert os.environ.get("OPENPYPE_PUBLISH_DATA"), ( + "Missing `OPENPYPE_PUBLISH_DATA`") + paths = os.environ["OPENPYPE_PUBLISH_DATA"].split(os.pathsep) project_name = os.environ.get("AVALON_PROJECT") if project_name is None: diff --git a/pype/plugins/publish/extract_scanline_exr.py b/pype/plugins/publish/extract_scanline_exr.py index a801baa17c..5839105f7f 100644 --- a/pype/plugins/publish/extract_scanline_exr.py +++ b/pype/plugins/publish/extract_scanline_exr.py @@ -45,7 +45,7 @@ class ExtractScanlineExr(pyblish.api.InstancePlugin): stagingdir = os.path.normpath(repre.get("stagingDir")) - oiio_tool_path = os.getenv("PYPE_OIIO_PATH", "") + oiio_tool_path = os.getenv("OPENPYPE_OIIO_PATH", "") if not os.path.exists(oiio_tool_path): self.log.error( "OIIO tool not found in {}".format(oiio_tool_path)) diff --git a/pype/pype_commands.py b/pype/pype_commands.py index ea94a35e3a..c46d71c631 100644 --- a/pype/pype_commands.py +++ b/pype/pype_commands.py @@ -79,7 +79,7 @@ class PypeCommands: pyblish.api.register_target("filesequence") pyblish.api.register_host("shell") - os.environ["PYPE_PUBLISH_DATA"] = os.pathsep.join(paths) + os.environ["OPENPYPE_PUBLISH_DATA"] = os.pathsep.join(paths) log.info("Running publish ...") diff --git a/pype/resources/__init__.py b/pype/resources/__init__.py index fdee38ab34..ef4ed73974 100644 --- a/pype/resources/__init__.py +++ b/pype/resources/__init__.py @@ -32,7 +32,7 @@ def get_liberation_font_path(bold=False, italic=False): def pype_icon_filepath(debug=None): if debug is None: - debug = bool(os.getenv("PYPE_DEV")) + debug = bool(os.getenv("OPENPYPE_DEV")) if debug: icon_file_name = "openpype_icon_staging.png" @@ -43,7 +43,7 @@ def pype_icon_filepath(debug=None): def pype_splash_filepath(debug=None): if debug is None: - debug = bool(os.getenv("PYPE_DEV")) + debug = bool(os.getenv("OPENPYPE_DEV")) if debug: splash_file_name = "openpype_splash_staging.png" diff --git a/pype/scripts/export_maya_ass_job.py b/pype/scripts/export_maya_ass_job.py index d343eec131..6e5eff6663 100644 --- a/pype/scripts/export_maya_ass_job.py +++ b/pype/scripts/export_maya_ass_job.py @@ -1,4 +1,8 @@ -"""This module is used for command line exporting of ASS files.""" +"""This module is used for command line exporting of ASS files. + +WARNING: +This need to be rewriten to be able use it in Pype 3! +""" import os import argparse @@ -45,10 +49,10 @@ def __main__(): auto_pype_root = os.path.dirname(os.path.abspath(__file__)) auto_pype_root = os.path.abspath(auto_pype_root + "../../../../..") - auto_pype_root = os.environ.get('PYPE_SETUP_PATH') or auto_pype_root - if os.environ.get('PYPE_SETUP_PATH'): + auto_pype_root = os.environ.get('OPENPYPE_SETUP_PATH') or auto_pype_root + if os.environ.get('OPENPYPE_SETUP_PATH'): print("Got Pype location from environment: {}".format( - os.environ.get('PYPE_SETUP_PATH'))) + os.environ.get('OPENPYPE_SETUP_PATH'))) pype_command = "pype.ps1" if platform.system().lower() == "linux": @@ -74,7 +78,7 @@ def __main__(): print("Set pype root to: {}".format(pype_root)) print("Paths: {}".format(kwargs.paths or [os.getcwd()])) - # paths = kwargs.paths or [os.environ.get("PYPE_METADATA_FILE")] or [os.getcwd()] # noqa + # paths = kwargs.paths or [os.environ.get("OPENPYPE_METADATA_FILE")] or [os.getcwd()] # noqa mayabatch = os.environ.get("AVALON_APP_NAME").replace("maya", "mayabatch") args = [ diff --git a/pype/scripts/export_maya_ass_sequence.mel b/pype/scripts/export_maya_ass_sequence.mel index 83d1d010ac..b3b9a8543e 100644 --- a/pype/scripts/export_maya_ass_sequence.mel +++ b/pype/scripts/export_maya_ass_sequence.mel @@ -12,12 +12,12 @@ Attributes: */ -$scene_file=`getenv "PYPE_ASS_EXPORT_SCENE_FILE"`; -$step=`getenv "PYPE_ASS_EXPORT_STEP"`; -$start=`getenv "PYPE_ASS_EXPORT_START"`; -$end=`getenv "PYPE_ASS_EXPORT_END"`; -$file_path=`getenv "PYPE_ASS_EXPORT_OUTPUT"`; -$render_layer = `getenv "PYPE_ASS_EXPORT_RENDER_LAYER"`; +$scene_file=`getenv "OPENPYPE_ASS_EXPORT_SCENE_FILE"`; +$step=`getenv "OPENPYPE_ASS_EXPORT_STEP"`; +$start=`getenv "OPENPYPE_ASS_EXPORT_START"`; +$end=`getenv "OPENPYPE_ASS_EXPORT_END"`; +$file_path=`getenv "OPENPYPE_ASS_EXPORT_OUTPUT"`; +$render_layer = `getenv "OPENPYPE_ASS_EXPORT_RENDER_LAYER"`; print("*** ASS Export Plugin\n"); diff --git a/pype/scripts/publish_deadline.py b/pype/scripts/publish_deadline.py deleted file mode 100644 index 16d097a1ea..0000000000 --- a/pype/scripts/publish_deadline.py +++ /dev/null @@ -1,38 +0,0 @@ -import os -import subprocess -import platform -import argparse - - -def __main__(): - parser = argparse.ArgumentParser() - parser.add_argument("--paths", - nargs="*", - default=[], - help="The filepaths to publish. This can be a " - "directory or a path to a .json publish " - "configuration.") - - kwargs, args = parser.parse_known_args() - pype_root = os.environ.get("PYPE_SETUP_PATH") - if not pype_root: - raise Exception("PYPE_SETUP_PATH is not set") - - # TODO: set correct path - pype_command = "pype.ps1" - if platform.system().lower() == "linux": - pype_command = "pype" - - args = [os.path.join(pype_root, pype_command), - "--node", "--publish", "--paths", kwargs.paths] - - # if we are using windows, run powershell command directly to support - # UNC paths. - if platform.system().lower() == "windows": - args = ["powershell", "-NoProfile", "-noexit", "-nologo", - "-executionPolicy bypass", "-command", - '"{}; exit $LASTEXITCODE"'.format(" ".join(args))] - - print('>>> running pype ...') - p = subprocess.call(args, shell=True) - print('<<< done [ {} ]'.format(p.returncode)) diff --git a/pype/scripts/publish_filesequence.py b/pype/scripts/publish_filesequence.py deleted file mode 100644 index 905c6b99ba..0000000000 --- a/pype/scripts/publish_filesequence.py +++ /dev/null @@ -1,97 +0,0 @@ -"""This module is used for command line publishing of image sequences.""" - -import os -import sys -import argparse -import logging -import subprocess -import platform -import json - -try: - from shutil import which -except ImportError: - # we are in python < 3.3 - def which(command): - path = os.getenv('PATH') - for p in path.split(os.path.pathsep): - p = os.path.join(p, command) - if os.path.exists(p) and os.access(p, os.X_OK): - return p - -handler = logging.basicConfig() -log = logging.getLogger("Publish Image Sequences") -log.setLevel(logging.DEBUG) - -error_format = "Failed {plugin.__name__}: {error} -- {error.traceback}" - - -def __main__(): - parser = argparse.ArgumentParser() - parser.add_argument("--paths", - nargs="*", - default=[], - help="The filepaths to publish. This can be a " - "directory or a path to a .json publish " - "configuration.") - parser.add_argument("--gui", - default=False, - action="store_true", - help="Whether to run Pyblish in GUI mode.") - - parser.add_argument("--pype", help="Pype root") - - kwargs, args = parser.parse_known_args() - - print("Running pype ...") - auto_pype_root = os.path.dirname(os.path.abspath(__file__)) - auto_pype_root = os.path.abspath(auto_pype_root + "../../../../..") - - auto_pype_root = os.environ.get('PYPE_SETUP_PATH') or auto_pype_root - if os.environ.get('PYPE_SETUP_PATH'): - print("Got Pype location from environment: {}".format( - os.environ.get('PYPE_SETUP_PATH'))) - - pype_command = "pype.ps1" - if platform.system().lower() == "linux": - pype_command = "pype" - elif platform.system().lower() == "windows": - pype_command = "pype.bat" - - if kwargs.pype: - pype_root = kwargs.pype - else: - # test if pype.bat / pype is in the PATH - # if it is, which() will return its path and we use that. - # if not, we use auto_pype_root path. Caveat of that one is - # that it can be UNC path and that will not work on windows. - - pype_path = which(pype_command) - - if pype_path: - pype_root = os.path.dirname(pype_path) - else: - pype_root = auto_pype_root - - print("Set pype root to: {}".format(pype_root)) - print("Paths: {}".format(kwargs.paths or [os.getcwd()])) - - paths = kwargs.paths or [os.environ.get("PYPE_METADATA_FILE")] or [os.getcwd()] # noqa - args = [ - os.path.join(pype_root, pype_command), - "publish", - " ".join(['"{}"'.format(p) for p in paths]) - ] - - print("Pype command: {}".format(" ".join(args))) - # Forcing forwaring the environment because environment inheritance does - # not always work. - # Cast all values in environment to str to be safe - env = {k: str(v) for k, v in os.environ.items()} - exit_code = subprocess.call(args, env=env) - if exit_code != 0: - raise RuntimeError("Publishing failed.") - - -if __name__ == '__main__': - __main__() diff --git a/pype/settings/defaults/system_settings/applications.json b/pype/settings/defaults/system_settings/applications.json index 5eccdfb83d..b21b035e38 100644 --- a/pype/settings/defaults/system_settings/applications.json +++ b/pype/settings/defaults/system_settings/applications.json @@ -6,9 +6,9 @@ "host_name": "maya", "environment": { "PYTHONPATH": [ - "{PYPE_ROOT}/pype/hosts/maya/startup", - "{PYPE_REPOS_ROOT}/avalon-core/setup/maya", - "{PYPE_REPOS_ROOT}/maya-look-assigner", + "{OPENPYPE_ROOT}/pype/hosts/maya/startup", + "{OPENPYPE_REPOS_ROOT}/avalon-core/setup/maya", + "{OPENPYPE_REPOS_ROOT}/maya-look-assigner", "{PYTHONPATH}" ], "MAYA_DISABLE_CLIC_IPM": "Yes", @@ -16,7 +16,7 @@ "MAYA_DISABLE_CER": "Yes", "PYMEL_SKIP_MEL_INIT": "Yes", "LC_ALL": "C", - "PYPE_LOG_NO_COLORS": "Yes" + "OPENPYPE_LOG_NO_COLORS": "Yes" }, "variants": { "maya_2020": { @@ -91,8 +91,8 @@ "host_name": "maya", "environment": { "PYTHONPATH": [ - "{PYPE_REPOS_ROOT}/avalon-core/setup/maya", - "{PYPE_REPOS_ROOT}/maya-look-assigner", + "{OPENPYPE_REPOS_ROOT}/avalon-core/setup/maya", + "{OPENPYPE_REPOS_ROOT}/maya-look-assigner", "{PYTHON_ENV}/python2/Lib/site-packages", "{PYTHONPATH}" ], @@ -101,7 +101,7 @@ "MAYA_DISABLE_CER": "Yes", "PYMEL_SKIP_MEL_INIT": "Yes", "LC_ALL": "C", - "PYPE_LOG_NO_COLORS": "Yes", + "OPENPYPE_LOG_NO_COLORS": "Yes", "MAYA_TEST": "{MAYA_VERSION}" }, "variants": { @@ -171,9 +171,9 @@ "host_name": "nuke", "environment": { "NUKE_PATH": [ - "{PYPE_REPOS_ROOT}/avalon-core/setup/nuke/nuke_path", - "{PYPE_ROOT}/pype/hosts/nuke/startup", - "{PYPE_STUDIO_PLUGINS}/nuke" + "{OPENPYPE_REPOS_ROOT}/avalon-core/setup/nuke/nuke_path", + "{OPENPYPE_ROOT}/pype/hosts/nuke/startup", + "{OPENPYPE_STUDIO_PLUGINS}/nuke" ], "PATH": { "windows": "C:/Program Files (x86)/QuickTime/QTSystem/;{PATH}" @@ -264,9 +264,9 @@ "host_name": "nuke", "environment": { "NUKE_PATH": [ - "{PYPE_REPOS_ROOT}/avalon-core/setup/nuke/nuke_path", - "{PYPE_ROOT}/pype/hosts/nuke/startup", - "{PYPE_STUDIO_PLUGINS}/nuke" + "{OPENPYPE_REPOS_ROOT}/avalon-core/setup/nuke/nuke_path", + "{OPENPYPE_ROOT}/pype/hosts/nuke/startup", + "{OPENPYPE_STUDIO_PLUGINS}/nuke" ], "PATH": { "windows": "C:/Program Files (x86)/QuickTime/QTSystem/;{PATH}" @@ -381,7 +381,7 @@ "host_name": "hiero", "environment": { "HIERO_PLUGIN_PATH": [ - "{PYPE_ROOT}/pype/hosts/hiero/startup" + "{OPENPYPE_ROOT}/pype/hosts/hiero/startup" ], "PATH": { "windows": "C:/Program Files (x86)/QuickTime/QTSystem/;{PATH}" @@ -496,7 +496,7 @@ "host_name": "hiero", "environment": { "HIERO_PLUGIN_PATH": [ - "{PYPE_ROOT}/pype/hosts/hiero/startup" + "{OPENPYPE_ROOT}/pype/hosts/hiero/startup" ], "PATH": { "windows": "C:/Program Files (x86)/QuickTime/QTSystem/;{PATH}" @@ -633,7 +633,7 @@ "{PYTHON36}/Scripts", "{PATH}" ], - "PYPE_LOG_NO_COLORS": "Yes" + "OPENPYPE_LOG_NO_COLORS": "Yes" }, "variants": { "fusion_16": { @@ -709,8 +709,8 @@ "{PYTHON36_RESOLVE}/Scripts", "{PATH}" ], - "PRE_PYTHON_SCRIPT": "{PYPE_ROOT}/pype/resolve/preload_console.py", - "PYPE_LOG_NO_COLORS": "True", + "PRE_PYTHON_SCRIPT": "{OPENPYPE_ROOT}/pype/resolve/preload_console.py", + "OPENPYPE_LOG_NO_COLORS": "True", "RESOLVE_DEV": "True" }, "variants": { @@ -740,14 +740,14 @@ "host_name": "houdini", "environment": { "HOUDINI_PATH": { - "darwin": "{PYPE_ROOT}/pype/hosts/houdini/startup:&", - "linux": "{PYPE_ROOT}/pype/hosts/houdini/startup:&", - "windows": "{PYPE_ROOT}/pype/hosts/houdini/startup;&" + "darwin": "{OPENPYPE_ROOT}/pype/hosts/houdini/startup:&", + "linux": "{OPENPYPE_ROOT}/pype/hosts/houdini/startup:&", + "windows": "{OPENPYPE_ROOT}/pype/hosts/houdini/startup;&" }, "HOUDINI_MENU_PATH": { - "darwin": "{PYPE_ROOT}/pype/hosts/houdini/startup:&", - "linux": "{PYPE_ROOT}/pype/hosts/houdini/startup:&", - "windows": "{PYPE_ROOT}/pype/hosts/houdini/startup;&" + "darwin": "{OPENPYPE_ROOT}/pype/hosts/houdini/startup:&", + "linux": "{OPENPYPE_ROOT}/pype/hosts/houdini/startup:&", + "windows": "{OPENPYPE_ROOT}/pype/hosts/houdini/startup;&" } }, "variants": { @@ -806,9 +806,9 @@ "icon": "{}/app_icons/blender.png", "host_name": "blender", "environment": { - "BLENDER_USER_SCRIPTS": "{PYPE_REPOS_ROOT}/avalon-core/setup/blender", + "BLENDER_USER_SCRIPTS": "{OPENPYPE_REPOS_ROOT}/avalon-core/setup/blender", "PYTHONPATH": [ - "{PYPE_REPOS_ROOT}/avalon-core/setup/blender", + "{OPENPYPE_REPOS_ROOT}/avalon-core/setup/blender", "{PYTHONPATH}" ], "CREATE_NEW_CONSOLE": "yes" @@ -869,7 +869,7 @@ "host_name": "harmony", "environment": { "AVALON_HARMONY_WORKFILES_ON_LAUNCH": "1", - "LIB_OPENHARMONY_PATH": "{PYPE_ROOT}/pype/vendor/OpenHarmony" + "LIB_OPENHARMONY_PATH": "{OPENPYPE_ROOT}/pype/vendor/OpenHarmony" }, "variants": { "harmony_20": { @@ -912,7 +912,7 @@ "icon": "{}/app_icons/tvpaint.png", "host_name": "tvpaint", "environment": { - "PYPE_LOG_NO_COLORS": "True" + "OPENPYPE_LOG_NO_COLORS": "True" }, "variants": { "tvpaint_animation_11-64bits": { @@ -958,7 +958,7 @@ "host_name": "photoshop", "environment": { "AVALON_PHOTOSHOP_WORKFILES_ON_LAUNCH": "1", - "PYPE_LOG_NO_COLORS": "Yes", + "OPENPYPE_LOG_NO_COLORS": "Yes", "WEBSOCKET_URL": "ws://localhost:8099/ws/", "WORKFILES_SAVE_AS": "Yes" }, @@ -1006,7 +1006,7 @@ "host_name": "aftereffects", "environment": { "AVALON_AFTEREFFECTS_WORKFILES_ON_LAUNCH": "1", - "PYPE_LOG_NO_COLORS": "Yes", + "OPENPYPE_LOG_NO_COLORS": "Yes", "WEBSOCKET_URL": "ws://localhost:8097/ws/", "WORKFILES_SAVE_AS": "Yes" }, @@ -1053,7 +1053,7 @@ "icon": "app_icons/celaction.png", "host_name": "celaction", "environment": { - "CELACTION_TEMPLATE": "{PYPE_ROOT}/pype/hosts/celaction/celaction_template_scene.scn" + "CELACTION_TEMPLATE": "{OPENPYPE_ROOT}/pype/hosts/celaction/celaction_template_scene.scn" }, "variants": { "celation_Local": { @@ -1075,8 +1075,8 @@ "icon": "{}/app_icons/ue4.png'", "host_name": "unreal", "environment": { - "AVALON_UNREAL_PLUGIN": "{PYPE_REPOS_ROOT}/avalon-unreal-integration", - "PYPE_LOG_NO_COLORS": "True", + "AVALON_UNREAL_PLUGIN": "{OPENPYPE_REPOS_ROOT}/avalon-unreal-integration", + "OPENPYPE_LOG_NO_COLORS": "True", "QT_PREFERRED_BINDING": "PySide" }, "variants": { diff --git a/pype/settings/defaults/system_settings/general.json b/pype/settings/defaults/system_settings/general.json index 99db4e85c6..eb9b6950c5 100644 --- a/pype/settings/defaults/system_settings/general.json +++ b/pype/settings/defaults/system_settings/general.json @@ -3,15 +3,15 @@ "studio_code": "stu", "environment": { "FFMPEG_PATH": { - "windows": "{PYPE_ROOT}/vendor/bin/ffmpeg_exec/windows/bin", - "darwin": "{PYPE_ROOT}/vendor/bin/ffmpeg_exec/darwin/bin", - "linux": ":{PYPE_ROOT}/vendor/bin/ffmpeg_exec/linux" + "windows": "{OPENPYPE_ROOT}/vendor/bin/ffmpeg_exec/windows/bin", + "darwin": "{OPENPYPE_ROOT}/vendor/bin/ffmpeg_exec/darwin/bin", + "linux": ":{OPENPYPE_ROOT}/vendor/bin/ffmpeg_exec/linux" }, - "PYPE_OCIO_CONFIG": "{STUDIO_SOFT}/OpenColorIO-Configs", + "OPENPYPE_OCIO_CONFIG": "{STUDIO_SOFT}/OpenColorIO-Configs", "__environment_keys__": { "global": [ "FFMPEG_PATH", - "PYPE_OCIO_CONFIG" + "OPENPYPE_OCIO_CONFIG" ] } }, diff --git a/pype/settings/defaults/system_settings/tools.json b/pype/settings/defaults/system_settings/tools.json index 214bfc95e5..535d8d5fdb 100644 --- a/pype/settings/defaults/system_settings/tools.json +++ b/pype/settings/defaults/system_settings/tools.json @@ -2,7 +2,7 @@ "tool_groups": { "mtoa": { "environment": { - "MTOA": "{PYPE_STUDIO_SOFTWARE}/arnold/mtoa_{MAYA_VERSION}_{MTOA_VERSION}", + "MTOA": "{OPENPYPE_STUDIO_SOFTWARE}/arnold/mtoa_{MAYA_VERSION}_{MTOA_VERSION}", "MAYA_RENDER_DESC_PATH": "{MTOA}", "MAYA_MODULE_PATH": "{MTOA}", "ARNOLD_PLUGIN_PATH": "{MTOA}/shaders", diff --git a/pype/tools/pyblish_pype/settings.py b/pype/tools/pyblish_pype/settings.py index 5848cdf698..11539f67a6 100644 --- a/pype/tools/pyblish_pype/settings.py +++ b/pype/tools/pyblish_pype/settings.py @@ -24,4 +24,4 @@ TerminalFilters = { } # Allow animations in GUI -Animated = env_variable_to_bool("PYPE_PYBLISH_ANIMATED", True) +Animated = env_variable_to_bool("OPENPYPE_PYBLISH_ANIMATED", True) diff --git a/pype/tools/settings/local_settings/mongo_widget.py b/pype/tools/settings/local_settings/mongo_widget.py index c6f6ab1591..35a415b081 100644 --- a/pype/tools/settings/local_settings/mongo_widget.py +++ b/pype/tools/settings/local_settings/mongo_widget.py @@ -27,7 +27,7 @@ class PypeMongoWidget(QtWidgets.QWidget): # Input mongo_url_input = QtWidgets.QLineEdit(self) mongo_url_input.setPlaceholderText("< Pype Mongo URL >") - mongo_url_input.setText(os.environ["PYPE_MONGO"]) + mongo_url_input.setText(os.environ["OPENPYPE_MONGO"]) # Confirm button mongo_url_change_btn = QtWidgets.QPushButton("Confirm Change", self) diff --git a/pype/tools/settings/settings/widgets/widgets.py b/pype/tools/settings/settings/widgets/widgets.py index ccd437ece3..d00372be03 100644 --- a/pype/tools/settings/settings/widgets/widgets.py +++ b/pype/tools/settings/settings/widgets/widgets.py @@ -643,7 +643,7 @@ class ProjectListWidget(QtWidgets.QWidget): items = [self.default] - mongo_url = os.environ["PYPE_MONGO"] + mongo_url = os.environ["OPENPYPE_MONGO"] # Force uninstall of whole avalon connection if url does not match # to current environment and set it as environment diff --git a/pype/tools/tray/pype_tray.py b/pype/tools/tray/pype_tray.py index 2d37c04136..0d3f729870 100644 --- a/pype/tools/tray/pype_tray.py +++ b/pype/tools/tray/pype_tray.py @@ -77,8 +77,8 @@ class TrayManager: self.tray_widget.showMessage(*args, **kwargs) def _add_version_item(self): - subversion = os.environ.get("PYPE_SUBVERSION") - client_name = os.environ.get("PYPE_CLIENT") + subversion = os.environ.get("OPENPYPE_SUBVERSION") + client_name = os.environ.get("OPENPYPE_CLIENT") version_string = pype.version.__version__ if subversion: diff --git a/start.py b/start.py index f3b2b337cc..9a53edd9da 100644 --- a/start.py +++ b/start.py @@ -40,7 +40,7 @@ So, bootstrapping OpenPype looks like this:: +-------------------------------------------------------+ | Determine MongoDB connection: | -| Use `OPENPYPE_MONGO`, system keyring `openPypeMongo` | +| Use `OPENPYPE_MONGO`, system keyring `openPypeMongo` | +--------------------------|----------------------------+ .--- Found? --. YES NO @@ -100,7 +100,6 @@ import subprocess import site from pathlib import Path - # add dependencies folder to sys.pat for frozen code if getattr(sys, 'frozen', False): frozen_libs = os.path.normpath( @@ -114,7 +113,7 @@ if getattr(sys, 'frozen', False): import igniter # noqa: E402 from igniter import BootstrapRepos # noqa: E402 -from igniter.tools import get_pype_path_from_db # noqa +from igniter.tools import get_openpype_path_from_db # noqa from igniter.bootstrap_repos import OpenPypeVersion # noqa: E402 bootstrap = BootstrapRepos() @@ -192,7 +191,7 @@ def set_avalon_environments(): # Avalon mongo URL avalon_mongo_url = ( os.environ.get("AVALON_MONGO") - or os.environ["PYPE_MONGO"] + or os.environ["OPENPYPE_MONGO"] ) os.environ.update({ # Mongo url (use same as OpenPype has) @@ -282,7 +281,7 @@ def _process_arguments() -> tuple: def _determine_mongodb() -> str: """Determine mongodb connection string. - First use ``PYPE_MONGO`` environment variable, then system keyring. + First use ``OPENPYPE_MONGO`` environment variable, then system keyring. Then try to run **Igniter UI** to let user specify it. Returns: @@ -293,7 +292,7 @@ def _determine_mongodb() -> str: """ - openpype_mongo = os.getenv("PYPE_MONGO", None) + openpype_mongo = os.getenv("OPENPYPE_MONGO", None) if not openpype_mongo: # try system keyring try: @@ -316,9 +315,9 @@ def _determine_mongodb() -> str: def _initialize_environment(openpype_version: OpenPypeVersion) -> None: version_path = openpype_version.path - os.environ["PYPE_VERSION"] = openpype_version.version + os.environ["OPENPYPE_VERSION"] = openpype_version.version # set OPENPYPE_ROOT to point to currently used OpenPype version. - os.environ["PYPE_ROOT"] = os.path.normpath(version_path.as_posix()) + os.environ["OPENPYPE_ROOT"] = os.path.normpath(version_path.as_posix()) # inject version to Python environment (sys.path, ...) print(">>> Injecting OpenPype version to running environment ...") bootstrap.add_paths_from_directory(version_path) @@ -328,11 +327,11 @@ def _initialize_environment(openpype_version: OpenPypeVersion) -> None: # to same hierarchy from code and from frozen OpenPype additional_paths = [ # add OpenPype tools - os.path.join(os.environ["PYPE_ROOT"], "openpype", "tools"), + os.path.join(os.environ["OPENPYPE_ROOT"], "openpype", "tools"), # add common OpenPype vendor # (common for multiple Python interpreter versions) os.path.join( - os.environ["PYPE_ROOT"], + os.environ["OPENPYPE_ROOT"], "openpype", "vendor", "python", @@ -370,7 +369,7 @@ def _find_frozen_openpype(use_version: str = None, openpype_version = None openpype_versions = bootstrap.find_openpype(include_zips=True, staging=use_staging) - if not os.getenv("PYPE_TRYOUT"): + if not os.getenv("OPENPYPE_TRYOUT"): try: # use latest one found (last in the list is latest) openpype_version = openpype_versions[-1] @@ -381,7 +380,7 @@ def _find_frozen_openpype(use_version: str = None, import igniter return_code = igniter.open_dialog() if return_code == 2: - os.environ["PYPE_TRYOUT"] = "1" + os.environ["OPENPYPE_TRYOUT"] = "1" if return_code == 3: # run OpenPype after installation @@ -401,7 +400,7 @@ def _find_frozen_openpype(use_version: str = None, if not openpype_versions: # no Pype versions found anyway, lets use then the one # shipped with frozen OpenPype - if not os.getenv("PYPE_TRYOUT"): + if not os.getenv("OPENPYPE_TRYOUT"): print("*** Still no luck finding OpenPype.") print(("*** We'll try to use the one coming " "with OpenPype installation.")) @@ -478,7 +477,7 @@ def _bootstrap_from_code(use_version): # get current version of OpenPype local_version = bootstrap.get_local_live_version() - os.environ["PYPE_VERSION"] = local_version + os.environ["OPENPYPE_VERSION"] = local_version if use_version and use_version != local_version: openpype_versions = bootstrap.find_openpype(include_zips=True) version_path = BootstrapRepos.get_version_path_from_list( @@ -486,10 +485,10 @@ def _bootstrap_from_code(use_version): if version_path: # use specified bootstrap.add_paths_from_directory(version_path) - os.environ["PYPE_VERSION"] = use_version + os.environ["OPENPYPE_VERSION"] = use_version else: version_path = openpype_root - os.environ["PYPE_ROOT"] = openpype_root + os.environ["OPENPYPE_ROOT"] = openpype_root repos = os.listdir(os.path.join(openpype_root, "repos")) repos = [os.path.join(openpype_root, "repos", repo) for repo in repos] # add self to python paths @@ -511,11 +510,15 @@ def _bootstrap_from_code(use_version): # to same hierarchy from code and from frozen OpenPype additional_paths = [ # add OpenPype tools - os.path.join(os.environ["PYPE_ROOT"], "openpype", "tools"), + os.path.join(os.environ["OPENPYPE_ROOT"], "openpype", "tools"), # add common OpenPype vendor # (common for multiple Python interpreter versions) os.path.join( - os.environ["PYPE_ROOT"], "openpype", "vendor", "python", "common" + os.environ["OPENPYPE_ROOT"], + "openpype", + "vendor", + "python", + "common" ) ] for path in additional_paths: @@ -534,7 +537,7 @@ def boot(): # Play animation # ------------------------------------------------------------------------ - from igniter.terminal_splash import play_animation + # from igniter.terminal_splash import play_animation # don't play for silenced commands # if all(item not in sys.argv for item in silent_commands): @@ -557,7 +560,7 @@ def boot(): print(f"!!! {e}") sys.exit(1) - os.environ["PYPE_MONGO"] = openpype_mongo + os.environ["OPENPYPE_MONGO"] = openpype_mongo # ------------------------------------------------------------------------ # Set environments - load OpenPype path from database (if set) @@ -565,19 +568,18 @@ def boot(): # set OPENPYPE_ROOT to running location until proper version can be # determined. if getattr(sys, 'frozen', False): - os.environ["PYPE_ROOT"] = os.path.dirname(sys.executable) + os.environ["OPENPYPE_ROOT"] = os.path.dirname(sys.executable) else: - os.environ["PYPE_ROOT"] = os.path.dirname(__file__) + os.environ["OPENPYPE_ROOT"] = os.path.dirname(__file__) # Get Pype path from database and set it to environment so Pype can # find its versions there and bootstrap them. - - openpype_path = get_pype_path_from_db(openpype_mongo) + openpype_path = get_openpype_path_from_db(openpype_mongo) if not openpype_path: - print("*** Cannot get Pype path from database.") + print("*** Cannot get OpenPype path from database.") - if not os.getenv("PYPE_PATH") and openpype_path: - os.environ["PYPE_PATH"] = openpype_path + if not os.getenv("OPENPYPE_PATH") and openpype_path: + os.environ["OPENPYPE_PATH"] = openpype_path # ------------------------------------------------------------------------ # Find OpenPype versions @@ -597,13 +599,13 @@ def boot(): # set this to point either to `python` from venv in case of live code # or to `openpype` or `openpype_console` in case of frozen code - os.environ["PYPE_EXECUTABLE"] = sys.executable + os.environ["OPENPYPE_EXECUTABLE"] = sys.executable if getattr(sys, 'frozen', False): - os.environ["PYPE_REPOS_ROOT"] = os.environ["PYPE_ROOT"] + os.environ["OPENPYPE_REPOS_ROOT"] = os.environ["OPENPYPE_ROOT"] else: - os.environ["PYPE_REPOS_ROOT"] = os.path.join( - os.environ["PYPE_ROOT"], "repos") + os.environ["OPENPYPE_REPOS_ROOT"] = os.path.join( + os.environ["OPENPYPE_ROOT"], "repos") # delete OpenPype module and it's submodules from cache so it is used from # specific version @@ -631,7 +633,7 @@ def boot(): set_modules_environments() from pype import cli - from pype.lib import terminal as t + from pype.lib import terminal as t from pype.version import __version__ assert version_path, "Version path not defined." @@ -674,7 +676,7 @@ def get_info() -> list: inf.append(("OpenPype variant", "staging")) else: inf.append(("OpenPype variant", "production")) - inf.append(("Running OpenPype from", os.environ.get('PYPE_ROOT'))) + inf.append(("Running OpenPype from", os.environ.get('OPENPYPE_ROOT'))) inf.append(("Using mongodb", components["host"])) if os.environ.get("FTRACK_SERVER"):