Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornickthetait <tait@alephobjects.com>2015-06-09 00:01:25 +0300
committernickthetait <tait@alephobjects.com>2015-06-09 00:01:25 +0300
commita42c06d85385da7ce2e77c5f21f5fdf2bf9ca46c (patch)
treeb99c196cda837bc1d868dde3f086ce24ffd457aa
parentb004b8069699c441e9b4dfd638165fa62e22385c (diff)
Enhance profile importing robustnesslulzbot-15.02.1-1.02
Older style, missing or invalid settings will revert to default values. Fixes #117.
-rw-r--r--Cura/util/profile.py15
1 files changed, 10 insertions, 5 deletions
diff --git a/Cura/util/profile.py b/Cura/util/profile.py
index 301b9c9b89..733a953746 100644
--- a/Cura/util/profile.py
+++ b/Cura/util/profile.py
@@ -737,11 +737,16 @@ def loadProfile(filename, allMachines = False):
section = 'profile'
if set.isAlteration():
section = 'alterations'
- if profileParser.has_option(section, set.getName()):
- set.setValue(unicode(profileParser.get(section, set.getName()), 'utf-8', 'replace'))
- #Upgrade setting from older ini file
- if getProfileSetting('retraction_combing') == '1':
- putProfileSetting('retraction_combing', 'All')
+ setting_name = set.getName()
+ if profileParser.has_option(section, setting_name):
+ try:
+ setting = profileParser.get(section, setting_name)
+ if setting == "Invalid Value":
+ raise Exception
+ set.setValue(unicode(setting, 'utf-8', 'replace'))
+ pass
+ except:
+ set.setValue(set.getDefault())
def saveProfile(filename, allMachines = False):
"""