From 1e366958826e05e140cf7624dfc42f3853cca189 Mon Sep 17 00:00:00 2001 From: daid Date: Fri, 2 Jan 2015 14:04:08 +0100 Subject: [PATCH] Fix user defined quickprint profiles. --- Cura/util/resources.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Cura/util/resources.py b/Cura/util/resources.py index 0259ef97..305cc4b1 100644 --- a/Cura/util/resources.py +++ b/Cura/util/resources.py @@ -53,14 +53,18 @@ def getSimpleModeProfiles(): path = os.path.normpath(os.path.join(resourceBasePath, 'quickprint', 'profiles', '*.ini')) user_path = os.path.normpath(os.path.expanduser(os.path.join('~', '.Cura', 'quickprint', 'profiles'))) if os.path.isdir(user_path): - return sorted(glob.glob(user_path)) + files = sorted(glob.glob(os.path.join(user_path, '*.ini'))) + if len(files) > 0: + return files return sorted(glob.glob(path)) def getSimpleModeMaterials(): path = os.path.normpath(os.path.join(resourceBasePath, 'quickprint', 'materials', '*.ini')) user_path = os.path.normpath(os.path.expanduser(os.path.join('~', '.Cura', 'quickprint', 'materials'))) if os.path.isdir(user_path): - return sorted(glob.glob(user_path)) + files = sorted(glob.glob(os.path.join(user_path, '*.ini'))) + if len(files) > 0: + return files return sorted(glob.glob(path)) def setupLocalization(selectedLanguage = None): -- 2.30.2