mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
GCodeProfileReader: Fixing read of profiles from GCode
This commit is contained in:
parent
d49ba80117
commit
93cdce7b33
1 changed files with 3 additions and 2 deletions
|
@ -75,15 +75,16 @@ class GCodeProfileReader(ProfileReader):
|
|||
|
||||
# Create an empty profile - the id will be changed later
|
||||
profile = InstanceContainer("")
|
||||
profile.addMetaDataEntry("type", "quality")
|
||||
try:
|
||||
profile.deserialize(serialized)
|
||||
except Exception as e: # Not a valid g-code file.
|
||||
Logger.log("e", "Unable to serialise the profile: %s", str(e))
|
||||
return None
|
||||
|
||||
profile.addMetaDataEntry("type", "quality")
|
||||
|
||||
#Creating a unique name using the filename of the GCode
|
||||
new_name = catalog.i18nc("@label", "Custom profile (%s)") %(os.path.splitext(os.path.basename(file_name))[0])
|
||||
new_name = catalog.i18nc("@label", "G-Code-imported profile")
|
||||
profile.setName(new_name)
|
||||
profile._id = new_name
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue