mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-09-13 16:13:16 +08:00
Add check for profile version
The profile reader now checks whether the profile version is the same as the target version in the Dictionary of Doom. Contributes to issue CURA-37.
This commit is contained in:
parent
68496349a9
commit
482f0461fc
@ -1,6 +1,6 @@
|
||||
{
|
||||
"source_version": "15.04",
|
||||
"target_version": "2.1",
|
||||
"target_version": 1,
|
||||
|
||||
"translation": {
|
||||
"line_width": "nozzle_size",
|
||||
|
@ -82,6 +82,14 @@ class LegacyProfileReader(ProfileReader):
|
||||
Logger.log("e", "Could not parse DictionaryOfDoom.json: %s", str(e))
|
||||
return None
|
||||
|
||||
#Check the target version in the Dictionary of Doom with this application version.
|
||||
if "target_version" not in dict_of_doom:
|
||||
Logger.log("e", "Dictionary of Doom has no target version. Is it the correct JSON file?")
|
||||
return None
|
||||
if Profile.ProfileVersion != dict_of_doom["target_version"]:
|
||||
Logger.log("e", "Dictionary of Doom of legacy profile reader (version %s) is not in sync with the profile version (version %s)!", dict_of_doom["target_version"], str(Profile.ProfileVersion))
|
||||
return None
|
||||
|
||||
if "translation" not in dict_of_doom:
|
||||
Logger.log("e", "Dictionary of Doom has no translation. Is it the correct JSON file?")
|
||||
return None
|
||||
|
Loading…
x
Reference in New Issue
Block a user