mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 14:37:29 -06:00
Better info on no profiles to import for gcode
CIRA-4946 If a gcode is sliced with default profiles, there won't be any custom profiles to import from that gcode. In that case, we show a info message telling the user about this instead of showing an error message.
This commit is contained in:
parent
c41af83b41
commit
a81981a27a
3 changed files with 17 additions and 2 deletions
|
@ -9,7 +9,7 @@ from UM.Logger import Logger
|
|||
from UM.i18n import i18nCatalog
|
||||
catalog = i18nCatalog("cura")
|
||||
|
||||
from cura.ProfileReader import ProfileReader
|
||||
from cura.ProfileReader import ProfileReader, NoProfileException
|
||||
|
||||
## A class that reads profile data from g-code files.
|
||||
#
|
||||
|
@ -66,6 +66,11 @@ class GCodeProfileReader(ProfileReader):
|
|||
return None
|
||||
|
||||
serialized = unescapeGcodeComment(serialized)
|
||||
serialized = serialized.strip()
|
||||
|
||||
if not serialized:
|
||||
Logger.log("i", "No custom profile to import from this g-code: %s", file_name)
|
||||
raise NoProfileException()
|
||||
|
||||
# serialized data can be invalid JSON
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue