changed prefixes in igniter

This commit is contained in:
iLLiCiTiT 2021-04-01 14:14:11 +02:00
parent abdf4a1f99
commit c26f3ff8c7
4 changed files with 17 additions and 14 deletions

View file

@ -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.

View file

@ -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

View file

@ -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)

View file

@ -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": {}