diff options
author | Simon Edwards <s.edwards@ultimaker.com> | 2016-06-08 16:36:26 +0300 |
---|---|---|
committer | Simon Edwards <s.edwards@ultimaker.com> | 2016-06-09 15:14:49 +0300 |
commit | 97d64a0749633606e57ed2d566bbadcc96d4dc00 (patch) | |
tree | 408e10b3cf0b36b8bdb8761f1b3e83eb5099c965 /plugins/CuraProfileReader | |
parent | c03588c6e576f3e164f5b28baf848b8072e2e78c (diff) |
Move ProfileReader and ProfileWriter over to Cura itself.
Contributes to CURA-1667 Profile import/export
Diffstat (limited to 'plugins/CuraProfileReader')
-rw-r--r-- | plugins/CuraProfileReader/CuraProfileReader.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/plugins/CuraProfileReader/CuraProfileReader.py b/plugins/CuraProfileReader/CuraProfileReader.py index c9b4e60046..9ff2955b22 100644 --- a/plugins/CuraProfileReader/CuraProfileReader.py +++ b/plugins/CuraProfileReader/CuraProfileReader.py @@ -3,7 +3,7 @@ from UM.Application import Application #To get the machine manager to create the new profile in. from UM.Logger import Logger -from UM.Settings.ProfileReader import ProfileReader +from cura.ProfileReader import ProfileReader ## A plugin that reads profile data from Cura profile files. @@ -25,16 +25,15 @@ class CuraProfileReader(ProfileReader): def read(self, file_name): # Create an empty profile. profile = Profile(machine_manager = Application.getInstance().getMachineManager(), read_only = False) - serialised = "" try: with open(file_name) as f: # Open file for reading. - serialised = f.read() + serialized = f.read() except IOError as e: Logger.log("e", "Unable to open file %s for reading: %s", file_name, str(e)) return None try: - profile.unserialise(serialised) + profile.deserialize(serialized) except Exception as e: # Parsing error. This is not a (valid) Cura profile then. Logger.log("e", "Error while trying to parse profile: %s", str(e)) return None |