do not use PYPE_CORE_* environments

This commit is contained in:
iLLiCiTiT 2020-04-09 18:10:38 +02:00
parent 0370389292
commit 56338f3d70
3 changed files with 25 additions and 52 deletions

View file

@ -20,13 +20,7 @@ def _get_script():
if module_path.endswith(".pyc"):
module_path = module_path[: -len(".pyc")] + ".py"
module_path = os.path.normpath(module_path)
mount_root = os.path.normpath(os.environ["PYPE_CORE_MOUNT"])
network_root = os.path.normpath(os.environ["PYPE_CORE_PATH"])
module_path = module_path.replace(mount_root, network_root)
return module_path
return os.path.normpath(module_path)
# Logic to retrieve latest files concerning extendFrames

View file

@ -309,13 +309,7 @@ class MayaSubmitMuster(pyblish.api.InstancePlugin):
output_dir = instance.data["outputDir"]
metadata_path = os.path.join(output_dir, metadata_filename)
# replace path for UNC / network share paths, co PYPE is found
# over network. It assumes PYPE is located somewhere in
# PYPE_CORE_PATH
pype_root = os.environ["PYPE_SETUP_PATH"].replace(
os.path.normpath(os.environ['PYPE_CORE_MOUNT']),
os.path.normpath(os.environ['PYPE_CORE_PATH'])
)
pype_root = os.environ["PYPE_SETUP_PATH"]
# we must provide either full path to executable or use musters own
# python named MPython.exe, residing directly in muster bin
@ -516,33 +510,25 @@ class MayaSubmitMuster(pyblish.api.InstancePlugin):
environment["PATH"] = os.environ["PATH"]
# self.log.debug("enviro: {}".format(environment['PYPE_SCRIPTS']))
clean_environment = {}
for key in environment:
for key, value in environment.items():
clean_path = ""
self.log.debug("key: {}".format(key))
to_process = environment[key]
if key == "PYPE_CORE_MOUNT":
clean_path = environment[key]
elif "://" in environment[key]:
clean_path = environment[key]
elif os.pathsep not in to_process:
try:
path = environment[key]
path.decode('UTF-8', 'strict')
clean_path = os.path.normpath(path)
except UnicodeDecodeError:
print('path contains non UTF characters')
if "://" in value:
clean_path = value
else:
for path in environment[key].split(os.pathsep):
valid_paths = []
for path in value.split(os.pathsep):
if not path:
continue
try:
path.decode('UTF-8', 'strict')
clean_path += os.path.normpath(path) + os.pathsep
valid_paths.append(os.path.normpath(path))
except UnicodeDecodeError:
print('path contains non UTF characters')
# this should replace paths so they are pointing to network share
clean_path = clean_path.replace(
os.path.normpath(environment['PYPE_CORE_MOUNT']),
os.path.normpath(environment['PYPE_CORE_PATH']))
if valid_paths:
clean_path = os.pathsep.join(valid_paths)
clean_environment[key] = clean_path
return clean_environment

View file

@ -194,36 +194,29 @@ class NukeSubmitDeadline(pyblish.api.InstancePlugin):
environment["PATH"] = os.environ["PATH"]
# self.log.debug("enviro: {}".format(environment['PYPE_SCRIPTS']))
clean_environment = {}
for key in environment:
for key, value in environment.items():
clean_path = ""
self.log.debug("key: {}".format(key))
to_process = environment[key]
if key == "PYPE_CORE_MOUNT":
clean_path = environment[key]
elif "://" in environment[key]:
clean_path = environment[key]
elif os.pathsep not in to_process:
try:
path = environment[key]
path.decode('UTF-8', 'strict')
clean_path = os.path.normpath(path)
except UnicodeDecodeError:
print('path contains non UTF characters')
if "://" in value:
clean_path = value
else:
for path in environment[key].split(os.pathsep):
valid_paths = []
for path in value.split(os.pathsep):
if not path:
continue
try:
path.decode('UTF-8', 'strict')
clean_path += os.path.normpath(path) + os.pathsep
valid_paths.append(os.path.normpath(path))
except UnicodeDecodeError:
print('path contains non UTF characters')
if valid_paths:
clean_path = os.pathsep.join(valid_paths)
if key == "PYTHONPATH":
clean_path = clean_path.replace('python2', 'python3')
clean_path = clean_path.replace(
os.path.normpath(environment['PYPE_CORE_MOUNT']),
os.path.normpath(environment['PYPE_CORE_PATH'])
)
self.log.debug("clean path: {}".format(clean_path))
clean_environment[key] = clean_path
environment = clean_environment