mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
clean up the code for implementating variable for self.file when the self.ext is image format
This commit is contained in:
parent
13b46070fe
commit
253c895363
1 changed files with 5 additions and 9 deletions
|
|
@ -817,15 +817,11 @@ class ExporterReviewMov(ExporterReview):
|
|||
|
||||
self.file = self.fhead + self.name + ".{}".format(self.ext)
|
||||
if ".{}".format(self.ext) not in VIDEO_EXTENSIONS:
|
||||
filename = os.path.basename(self.path_in)
|
||||
self.file = re.sub(
|
||||
self.fhead, self.fhead + self.name + ".", filename)
|
||||
# make sure the filename are in
|
||||
# correct image output format
|
||||
if not self.file.endswith(".{}".format(ext)):
|
||||
filename_no_ext, _ = os.path.splitext(self.file)
|
||||
self.file = "{}.{}".format(filename_no_ext, self.ext)
|
||||
|
||||
filename_no_ext = os.path.splitext(
|
||||
os.path.basename(self.path_in))[0]
|
||||
after_head = filename_no_ext[len(self.fhead):]
|
||||
self.file = "{}{}.{}.{}".format(
|
||||
self.fhead, self.name, after_head, self.ext)
|
||||
self.path = os.path.join(
|
||||
self.staging_dir, self.file).replace("\\", "/")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue