mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06: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
2 changed files with 9 additions and 1 deletions
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"source_version": "15.04",
|
"source_version": "15.04",
|
||||||
"target_version": "2.1",
|
"target_version": 1,
|
||||||
|
|
||||||
"translation": {
|
"translation": {
|
||||||
"line_width": "nozzle_size",
|
"line_width": "nozzle_size",
|
||||||
|
|
|
@ -82,6 +82,14 @@ class LegacyProfileReader(ProfileReader):
|
||||||
Logger.log("e", "Could not parse DictionaryOfDoom.json: %s", str(e))
|
Logger.log("e", "Could not parse DictionaryOfDoom.json: %s", str(e))
|
||||||
return None
|
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:
|
if "translation" not in dict_of_doom:
|
||||||
Logger.log("e", "Dictionary of Doom has no translation. Is it the correct JSON file?")
|
Logger.log("e", "Dictionary of Doom has no translation. Is it the correct JSON file?")
|
||||||
return None
|
return None
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue