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:
Lipu Fei 2018-03-09 16:40:55 +01:00
parent c41af83b41
commit a81981a27a
3 changed files with 17 additions and 2 deletions

View file

@ -3,6 +3,13 @@
from UM.PluginObject import PluginObject
# Exception when there is no profile to import from a given files.
# Note that this should not be treated as an exception but as an information instead.
class NoProfileException(Exception):
pass
## A type of plug-ins that reads profiles from a file.
#
# The profile is then stored as instance container of the type user profile.
@ -14,4 +21,4 @@ class ProfileReader(PluginObject):
#
# \return \type{Profile|Profile[]} The profile that was obtained from the file or a list of Profiles.
def read(self, file_name):
raise NotImplementedError("Profile reader plug-in was not correctly implemented. The read function was not implemented.")
raise NotImplementedError("Profile reader plug-in was not correctly implemented. The read function was not implemented.")