mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
renamed 'root' to '_workfiles_root'
This commit is contained in:
parent
c00f9a98bd
commit
f66f679710
1 changed files with 17 additions and 13 deletions
|
|
@ -367,7 +367,7 @@ class FilesWidget(QtWidgets.QWidget):
|
|||
self.template_key = "work"
|
||||
|
||||
# This is not root but workfile directory
|
||||
self.root = None
|
||||
self._workfiles_root = None
|
||||
self.host = api.registered_host()
|
||||
|
||||
# Whether to automatically select the latest modified
|
||||
|
|
@ -465,8 +465,8 @@ class FilesWidget(QtWidgets.QWidget):
|
|||
# This way we can browse it even before we enter it.
|
||||
if self._asset_id and self._task_name and self._task_type:
|
||||
session = self._get_session()
|
||||
self.root = self.host.work_root(session)
|
||||
self.files_model.set_root(self.root)
|
||||
self._workfiles_root = self.host.work_root(session)
|
||||
self.files_model.set_root(self._workfiles_root)
|
||||
|
||||
else:
|
||||
self.files_model.set_root(None)
|
||||
|
|
@ -590,7 +590,7 @@ class FilesWidget(QtWidgets.QWidget):
|
|||
|
||||
window = NameWindow(
|
||||
parent=self,
|
||||
root=self.root,
|
||||
root=self._workfiles_root,
|
||||
anatomy=self.anatomy,
|
||||
template_key=self.template_key,
|
||||
session=session
|
||||
|
|
@ -605,7 +605,7 @@ class FilesWidget(QtWidgets.QWidget):
|
|||
return
|
||||
|
||||
src = self._get_selected_filepath()
|
||||
dst = os.path.join(self.root, work_file)
|
||||
dst = os.path.join(self._workfiles_root, work_file)
|
||||
shutil.copy(src, dst)
|
||||
|
||||
self.workfile_created.emit(dst)
|
||||
|
|
@ -638,9 +638,9 @@ class FilesWidget(QtWidgets.QWidget):
|
|||
"filter": ext_filter
|
||||
}
|
||||
if Qt.__binding__ in ("PySide", "PySide2"):
|
||||
kwargs["dir"] = self.root
|
||||
kwargs["dir"] = self._workfiles_root
|
||||
else:
|
||||
kwargs["directory"] = self.root
|
||||
kwargs["directory"] = self._workfiles_root
|
||||
|
||||
work_file = QtWidgets.QFileDialog.getOpenFileName(**kwargs)[0]
|
||||
if work_file:
|
||||
|
|
@ -652,17 +652,21 @@ class FilesWidget(QtWidgets.QWidget):
|
|||
return
|
||||
|
||||
# Initialize work directory if it has not been initialized before
|
||||
if not os.path.exists(self.root):
|
||||
log.debug("Initializing Work Directory: %s", self.root)
|
||||
if not os.path.exists(self._workfiles_root):
|
||||
log.debug("Initializing Work Directory: %s", self._workfiles_root)
|
||||
self.initialize_work_directory()
|
||||
if not os.path.exists(self.root):
|
||||
if not os.path.exists(self._workfiles_root):
|
||||
# Failed to initialize Work Directory
|
||||
log.error(
|
||||
"Failed to initialize Work Directory: {}".format(self.root)
|
||||
"Failed to initialize Work Directory: {}".format(
|
||||
self._workfiles_root
|
||||
)
|
||||
)
|
||||
return
|
||||
|
||||
file_path = os.path.join(os.path.normpath(self.root), work_file)
|
||||
file_path = os.path.join(
|
||||
os.path.normpath(self._workfiles_root), work_file
|
||||
)
|
||||
|
||||
pipeline.emit("before.workfile.save", [file_path])
|
||||
|
||||
|
|
@ -673,7 +677,7 @@ class FilesWidget(QtWidgets.QWidget):
|
|||
self._asset_id, self._task_name, self._task_type
|
||||
)
|
||||
create_workdir_extra_folders(
|
||||
self.root,
|
||||
self._workfiles_root,
|
||||
api.Session["AVALON_APP"],
|
||||
self._task_type,
|
||||
self._task_name,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue