From c26f3ff8c74e6c39cd771ab4ff8e1fb0ec94d7c0 Mon Sep 17 00:00:00 2001 From: iLLiCiTiT Date: Thu, 1 Apr 2021 14:14:11 +0200 Subject: [PATCH] changed prefixes in igniter --- igniter/bootstrap_repos.py | 12 ++++++------ igniter/install_dialog.py | 5 ++++- igniter/install_thread.py | 10 +++++----- igniter/user_settings.py | 4 ++-- 4 files changed, 17 insertions(+), 14 deletions(-) diff --git a/igniter/bootstrap_repos.py b/igniter/bootstrap_repos.py index 58d59afe88..ec980805be 100644 --- a/igniter/bootstrap_repos.py +++ b/igniter/bootstrap_repos.py @@ -625,7 +625,7 @@ class BootstrapRepos: Resolution order for Pype is following: - 1) First we test for ``PYPE_PATH`` environment variable + 1) First we test for ``OPENPYPE_PATH`` environment variable 2) We try to find ``pypePath`` in registry setting 3) We use user data directory @@ -660,9 +660,9 @@ class BootstrapRepos: if pype_path: dir_to_search = pype_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( @@ -688,7 +688,7 @@ class BootstrapRepos: """Process user entered location string. It decides if location string is mongodb url or path. - If it is mongodb url, it will connect and load ``PYPE_PATH`` from + If it is mongodb url, it will connect and load ``OPENPYPE_PATH`` from there and use it as path to Pype. In it is _not_ mongodb url, it is assumed we have a path, this is tested and zip file is produced and installed using :meth:`create_version_from_live_code`. @@ -706,7 +706,7 @@ class BootstrapRepos: if location.startswith("mongodb"): pype_path = get_pype_path_from_db(location) if not pype_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 0eb518c2e3..15b9683639 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("pypeMongo") + ) except ValueError: pass diff --git a/igniter/install_thread.py b/igniter/install_thread.py index a184a19d36..b0da4c9f0d 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("pypeMongo") @@ -78,12 +78,12 @@ 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("pypeMongo", self._mongo) - os.environ["PYPE_MONGO"] = self._mongo + os.environ["OPENPYPE_MONGO"] = self._mongo self.message.emit( f"Detecting installed Pype versions in {bs.data_dir}", False) @@ -160,7 +160,7 @@ class InstallThread(QThread): return else: # if we have mongo connection string, validate it, set it to - # user settings and get PYPE_PATH from there. + # user settings and get OPENPYPE_PATH from there. if self._mongo: if not validate_mongo_connection(self._mongo): self.message.emit( @@ -168,7 +168,7 @@ class InstallThread(QThread): self.finished.emit(InstallResult(-1)) return bs.registry.set_secure_item("pypeMongo", 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 00ce68cb0b..b0c2ac2370 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__": { - "pype-version": os.getenv("PYPE_VERSION", "N/A"), + "pype-version": os.getenv("OPENPYPE_VERSION", "N/A"), "generated": now }, "registry": {}