mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-12 09:17:50 -06:00
Don't read machine instances as preferences
Machine instances have the exact same file structure as preferences, except that machine instances require a name field (was already correctly implemented), but preferences didn't require it. This now forbids preferences to have a name field, so that the distinction between the two can be made. Contributes to issue CURA-844.
This commit is contained in:
parent
07b6507133
commit
922b0df60b
1 changed files with 2 additions and 0 deletions
|
@ -35,6 +35,8 @@ class Preferences:
|
|||
raise UM.VersionUpgrade.FormatException("No \"version\" in \"general\" section.")
|
||||
if int(self._config.get("general", "version")) != 2: # Explicitly hard-code version 2, since if this number changes the programmer MUST change this entire function.
|
||||
raise UM.VersionUpgrade.InvalidVersionException("The version of this preferences file is wrong. It must be 2.")
|
||||
if self._config.has_option("general", "name"): #This is probably a machine instance.
|
||||
raise UM.VersionUpgrade.FormatException("There is a \"name\" field in this configuration file. I suspect it is not a preferences file.")
|
||||
|
||||
## Serialises these preferences as a preferences file of version 3.
|
||||
#
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue