mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 01:29:00 +08:00
GCodeProfileReader: Fixing read of profiles from GCode
This commit is contained in:
parent
d49ba80117
commit
93cdce7b33
@ -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…
x
Reference in New Issue
Block a user