mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -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
|
# Create an empty profile - the id will be changed later
|
||||||
profile = InstanceContainer("")
|
profile = InstanceContainer("")
|
||||||
profile.addMetaDataEntry("type", "quality")
|
|
||||||
try:
|
try:
|
||||||
profile.deserialize(serialized)
|
profile.deserialize(serialized)
|
||||||
except Exception as e: # Not a valid g-code file.
|
except Exception as e: # Not a valid g-code file.
|
||||||
Logger.log("e", "Unable to serialise the profile: %s", str(e))
|
Logger.log("e", "Unable to serialise the profile: %s", str(e))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
profile.addMetaDataEntry("type", "quality")
|
||||||
|
|
||||||
#Creating a unique name using the filename of the GCode
|
#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.setName(new_name)
|
||||||
profile._id = new_name
|
profile._id = new_name
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue