mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 21:32:15 +01:00
renamed 'work_root' to 'job_queue_root'
This commit is contained in:
parent
b3de979cf8
commit
42e46ded6c
5 changed files with 30 additions and 30 deletions
|
|
@ -55,10 +55,10 @@ class BaseCommand:
|
|||
self._command_data = data
|
||||
self._done = False
|
||||
|
||||
def work_root(self):
|
||||
def job_queue_root(self):
|
||||
if self._parent is None:
|
||||
return None
|
||||
return self._parent.work_root()
|
||||
return self._parent.job_queue_root()
|
||||
|
||||
def set_parent(self, parent):
|
||||
self._parent = parent
|
||||
|
|
@ -160,9 +160,9 @@ class ExecuteGeorgeScript(BaseCommand):
|
|||
filepath_by_key[key] = output_path
|
||||
|
||||
if self._root_dir_key:
|
||||
work_root = self.work_root()
|
||||
job_queue_root = self.job_queue_root()
|
||||
format_key = "{" + self._root_dir_key + "}"
|
||||
self._script.replace(format_key, work_root.replace("\\", "/"))
|
||||
self._script.replace(format_key, job_queue_root.replace("\\", "/"))
|
||||
|
||||
self.execute_george_through_file(self._script)
|
||||
|
||||
|
|
@ -232,8 +232,8 @@ class TVPaintCommands:
|
|||
job_queue_module = manager.modules_by_name["job_queue"]
|
||||
self._job_queue_module = job_queue_module
|
||||
|
||||
def work_root(self):
|
||||
return self._job_queue_module.get_work_root_from_settings()
|
||||
def job_queue_root(self):
|
||||
return self._job_queue_module.get_jobs_root_from_settings()
|
||||
|
||||
@property
|
||||
def log(self):
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class CollectTVPaintWorkfileData(pyblish.api.InstancePlugin):
|
|||
job_queue_module = modules["job_queue"]
|
||||
|
||||
context_staging_dir = self._create_context_staging_dir(
|
||||
context, job_queue_module
|
||||
job_queue_module
|
||||
)
|
||||
workfile_path = self._extract_workfile_path(
|
||||
context, context_staging_dir
|
||||
|
|
@ -85,16 +85,16 @@ class CollectTVPaintWorkfileData(pyblish.api.InstancePlugin):
|
|||
context.data["layersExposureFrames"] = exposure_frames_by_layer_id
|
||||
context.data["layersPrePostBehavior"] = pre_post_beh_by_layer_id
|
||||
|
||||
def _create_context_staging_dir(self, context, job_queue_module):
|
||||
work_root = job_queue_module.get_work_root()
|
||||
if not work_root:
|
||||
def _create_context_staging_dir(self, job_queue_module):
|
||||
jobs_root = job_queue_module.get_jobs_root()
|
||||
if not jobs_root:
|
||||
raise ValueError("Work root in JobQueue module is not set.")
|
||||
|
||||
if not os.path.exists(work_root):
|
||||
os.makedirs(work_root)
|
||||
if not os.path.exists(jobs_root):
|
||||
os.makedirs(jobs_root)
|
||||
|
||||
random_folder_name = str(uuid.uuid4())
|
||||
full_path = os.path.join(work_root, random_folder_name)
|
||||
full_path = os.path.join(jobs_root, random_folder_name)
|
||||
if not os.path.exists(full_path):
|
||||
os.makedirs(full_path)
|
||||
return full_path
|
||||
|
|
|
|||
|
|
@ -19,14 +19,14 @@ class JobQueueModule(OpenPypeModule):
|
|||
server_url = modules_settings.get("server_url") or ""
|
||||
|
||||
self._server_url = self.url_conversion(server_url)
|
||||
work_root_mapping = modules_settings.get("work_root")
|
||||
if not work_root_mapping:
|
||||
work_root_mapping = {
|
||||
jobs_root_mapping = modules_settings.get("jobs_root")
|
||||
if not jobs_root_mapping:
|
||||
jobs_root_mapping = {
|
||||
"windows": "",
|
||||
"linux": "",
|
||||
"darwin": ""
|
||||
}
|
||||
self._work_root_mapping = work_root_mapping
|
||||
self._jobs_root_mapping = jobs_root_mapping
|
||||
|
||||
# Is always enabled
|
||||
# - the module does nothing until is used
|
||||
|
|
@ -61,23 +61,23 @@ class JobQueueModule(OpenPypeModule):
|
|||
|
||||
return urlunsplit(url_parts)
|
||||
|
||||
def get_work_root_mapping(self):
|
||||
return copy.deepcopy(self._work_root_mapping)
|
||||
def get_jobs_root_mapping(self):
|
||||
return copy.deepcopy(self._jobs_root_mapping)
|
||||
|
||||
def get_work_root(self):
|
||||
self._work_root_mapping.get(platform.system().lower())
|
||||
def get_jobs_root(self):
|
||||
self._jobs_root_mapping.get(platform.system().lower())
|
||||
|
||||
@classmethod
|
||||
def get_work_root_from_settings(cls):
|
||||
def get_jobs_root_from_settings(cls):
|
||||
module_settings = get_system_settings()["modules"]
|
||||
work_root_mapping = module_settings.get(cls.name, {}).get("work_root")
|
||||
if not work_root_mapping:
|
||||
work_root_mapping = {
|
||||
jobs_root_mapping = module_settings.get(cls.name, {}).get("jobs_root")
|
||||
if not jobs_root_mapping:
|
||||
jobs_root_mapping = {
|
||||
"windows": "",
|
||||
"linux": "",
|
||||
"darwin": ""
|
||||
}
|
||||
return work_root_mapping.get(platform.system().lower())
|
||||
return jobs_root_mapping.get(platform.system().lower())
|
||||
|
||||
@property
|
||||
def server_url(self):
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@
|
|||
},
|
||||
"job_queue": {
|
||||
"server_url": "",
|
||||
"work_root": {
|
||||
"jobs_root": {
|
||||
"windows": "",
|
||||
"darwin": "",
|
||||
"linux": ""
|
||||
|
|
|
|||
|
|
@ -258,11 +258,11 @@
|
|||
},
|
||||
{
|
||||
"type": "label",
|
||||
"label": "Work root is used as temporary directory for workers where source is copied and render output can be stored."
|
||||
"label": "Jobs root is used as temporary directory for workers where source is copied and render output can be stored."
|
||||
},
|
||||
{
|
||||
"key": "work_root",
|
||||
"label": "Work root",
|
||||
"key": "jobs_root",
|
||||
"label": "Jobs root",
|
||||
"type": "path",
|
||||
"multipath": false,
|
||||
"multiplatform": true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue