From 8679afb8976a033416a1cfee4403ce9c26526cf7 Mon Sep 17 00:00:00 2001 From: MrTeferi Date: Wed, 15 Jun 2022 12:45:11 -0500 Subject: [PATCH] Pathing issues? - Fixed some potential pathing issues --- main.py | 3 ++- proxyshop/core.py | 3 ++- proxyshop/templates.py | 6 ++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 2ec0298f..444d4767 100644 --- a/main.py +++ b/main.py @@ -460,10 +460,11 @@ def initial_state(setting): # Ensure mandatory folders are created Path(os.path.join(cwd, "out")).mkdir(mode=511, parents=True, exist_ok=True) Path(os.path.join(cwd, "tmp")).mkdir(mode=511, parents=True, exist_ok=True) + Path(os.path.join(cwd, "templates")).mkdir(mode=511, parents=True, exist_ok=True) Path(os.path.join(cwd, "proxyshop/datas")).mkdir(mode=511, parents=True, exist_ok=True) # Launch the app - __version__ = "v1.1.3" + __version__ = "v1.1.5" Factory.register('HoverBehavior', gui.HoverBehavior) Builder.load_file(os.path.join(cwd, "proxyshop/proxyshop.kv")) ProxyshopApp().run() diff --git a/proxyshop/core.py b/proxyshop/core.py index e716a764..0de99379 100644 --- a/proxyshop/core.py +++ b/proxyshop/core.py @@ -321,7 +321,8 @@ def update_template(temp, callback): @param temp: Dict containing template information. @param callback: Callback method to update progress bar. """ - # Download using authorization? + # Download using authorization + Path(os.path.dirname(temp['path'])).mkdir(mode=511, parents=True, exist_ok=True) gdrive_download(temp['id'], temp['path'], callback) # Change the version to match the new version diff --git a/proxyshop/templates.py b/proxyshop/templates.py index 8d4f8da7..5063a3f7 100644 --- a/proxyshop/templates.py +++ b/proxyshop/templates.py @@ -2,6 +2,8 @@ CORE TEMPLATES """ import os +from pathlib import Path + import proxyshop.text_layers as txt_layers from proxyshop import format_text, gui from proxyshop.constants import con @@ -109,8 +111,8 @@ def load_template(self): Opens the template's PSD file in Photoshop. """ console.update("Loading PSD template file...") - file_path = os.path.join(con.cwd, f"templates\\{self.template_file_name()}{cfg.file_ext}") - app.load(file_path) + file_path = Path(os.path.join(con.cwd, f"templates\\{self.template_file_name()}{cfg.file_ext}")) + app.load(str(file_path)) return file_path def load_artwork(self):