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:
authorSimon Edwards <s.edwards@ultimaker.com>2016-06-09 15:14:09 +0300
committerSimon Edwards <s.edwards@ultimaker.com>2016-06-09 15:14:50 +0300
commitb93137545f8db44383985ddf02c7b2a8500afd04 (patch)
tree7316e1bfd2b63cba9b671e2663c860e7c68b41d8 /plugins/CuraProfileReader
parent97d64a0749633606e57ed2d566bbadcc96d4dc00 (diff)
Support for importing a profile.
Contributes to CURA-1667 Profile import/export
Diffstat (limited to 'plugins/CuraProfileReader')
-rw-r--r--plugins/CuraProfileReader/CuraProfileReader.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/CuraProfileReader/CuraProfileReader.py b/plugins/CuraProfileReader/CuraProfileReader.py
index 9ff2955b22..b9c1f208ea 100644
--- a/plugins/CuraProfileReader/CuraProfileReader.py
+++ b/plugins/CuraProfileReader/CuraProfileReader.py
@@ -1,11 +1,13 @@
# Copyright (c) 2015 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
+import os.path
+
from UM.Application import Application #To get the machine manager to create the new profile in.
from UM.Logger import Logger
+from UM.Settings.InstanceContainer import InstanceContainer #The new profile to make.
from cura.ProfileReader import ProfileReader
-
## A plugin that reads profile data from Cura profile files.
#
# It reads a profile from a .curaprofile file, and returns it as a profile
@@ -24,7 +26,8 @@ class CuraProfileReader(ProfileReader):
# returned.
def read(self, file_name):
# Create an empty profile.
- profile = Profile(machine_manager = Application.getInstance().getMachineManager(), read_only = False)
+ profile = InstanceContainer(os.path.basename(os.path.splitext(file_name)[0]))
+ profile.addMetaDataEntry("type", "quality")
try:
with open(file_name) as f: # Open file for reading.
serialized = f.read()