mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-08 23:46:22 -06:00
Fix type of fallback variable
These have to be strings because the configparser getter can only return strings. Contributes to issue CURA-5936.
This commit is contained in:
parent
ae2b312472
commit
b67d8d4103
9 changed files with 11 additions and 11 deletions
|
@ -251,7 +251,7 @@ class VersionUpgrade21to22(VersionUpgrade):
|
||||||
parser = configparser.ConfigParser(interpolation = None)
|
parser = configparser.ConfigParser(interpolation = None)
|
||||||
parser.read_string(serialised)
|
parser.read_string(serialised)
|
||||||
format_version = int(parser.get("general", "version")) #Explicitly give an exception when this fails. That means that the file format is not recognised.
|
format_version = int(parser.get("general", "version")) #Explicitly give an exception when this fails. That means that the file format is not recognised.
|
||||||
setting_version = int(parser.get("metadata", "setting_version", fallback = 0))
|
setting_version = int(parser.get("metadata", "setting_version", fallback = "0"))
|
||||||
return format_version * 1000000 + setting_version
|
return format_version * 1000000 + setting_version
|
||||||
|
|
||||||
## Gets the fallback quality to use for a specific machine-variant-material
|
## Gets the fallback quality to use for a specific machine-variant-material
|
||||||
|
|
|
@ -156,5 +156,5 @@ class VersionUpgrade22to24(VersionUpgrade):
|
||||||
parser = configparser.ConfigParser(interpolation = None)
|
parser = configparser.ConfigParser(interpolation = None)
|
||||||
parser.read_string(serialised)
|
parser.read_string(serialised)
|
||||||
format_version = int(parser.get("general", "version")) #Explicitly give an exception when this fails. That means that the file format is not recognised.
|
format_version = int(parser.get("general", "version")) #Explicitly give an exception when this fails. That means that the file format is not recognised.
|
||||||
setting_version = int(parser.get("metadata", "setting_version", fallback = 0))
|
setting_version = int(parser.get("metadata", "setting_version", fallback = "0"))
|
||||||
return format_version * 1000000 + setting_version
|
return format_version * 1000000 + setting_version
|
||||||
|
|
|
@ -43,7 +43,7 @@ class VersionUpgrade25to26(VersionUpgrade):
|
||||||
parser = configparser.ConfigParser(interpolation = None)
|
parser = configparser.ConfigParser(interpolation = None)
|
||||||
parser.read_string(serialised)
|
parser.read_string(serialised)
|
||||||
format_version = int(parser.get("general", "version")) #Explicitly give an exception when this fails. That means that the file format is not recognised.
|
format_version = int(parser.get("general", "version")) #Explicitly give an exception when this fails. That means that the file format is not recognised.
|
||||||
setting_version = int(parser.get("metadata", "setting_version", fallback = 0))
|
setting_version = int(parser.get("metadata", "setting_version", fallback = "0"))
|
||||||
return format_version * 1000000 + setting_version
|
return format_version * 1000000 + setting_version
|
||||||
|
|
||||||
## Upgrades the preferences file from version 2.5 to 2.6.
|
## Upgrades the preferences file from version 2.5 to 2.6.
|
||||||
|
|
|
@ -84,7 +84,7 @@ class VersionUpgrade26to27(VersionUpgrade):
|
||||||
parser = configparser.ConfigParser(interpolation = None)
|
parser = configparser.ConfigParser(interpolation = None)
|
||||||
parser.read_string(serialised)
|
parser.read_string(serialised)
|
||||||
format_version = int(parser.get("general", "version")) #Explicitly give an exception when this fails. That means that the file format is not recognised.
|
format_version = int(parser.get("general", "version")) #Explicitly give an exception when this fails. That means that the file format is not recognised.
|
||||||
setting_version = int(parser.get("metadata", "setting_version", fallback = 0))
|
setting_version = int(parser.get("metadata", "setting_version", fallback = "0"))
|
||||||
return format_version * 1000000 + setting_version
|
return format_version * 1000000 + setting_version
|
||||||
|
|
||||||
## Upgrades a preferences file from version 2.6 to 2.7.
|
## Upgrades a preferences file from version 2.6 to 2.7.
|
||||||
|
@ -92,7 +92,7 @@ class VersionUpgrade26to27(VersionUpgrade):
|
||||||
# \param serialised The serialised form of a preferences file.
|
# \param serialised The serialised form of a preferences file.
|
||||||
# \param filename The name of the file to upgrade.
|
# \param filename The name of the file to upgrade.
|
||||||
def upgradePreferences(self, serialised: str, filename: str) -> Tuple[List[str], List[str]]:
|
def upgradePreferences(self, serialised: str, filename: str) -> Tuple[List[str], List[str]]:
|
||||||
parser = configparser.ConfigParser(interpolation=None)
|
parser = configparser.ConfigParser(interpolation = None)
|
||||||
parser.read_string(serialised)
|
parser.read_string(serialised)
|
||||||
|
|
||||||
# Update version numbers
|
# Update version numbers
|
||||||
|
|
|
@ -48,7 +48,7 @@ class VersionUpgrade27to30(VersionUpgrade):
|
||||||
parser = configparser.ConfigParser(interpolation = None)
|
parser = configparser.ConfigParser(interpolation = None)
|
||||||
parser.read_string(serialised)
|
parser.read_string(serialised)
|
||||||
format_version = int(parser.get("general", "version")) #Explicitly give an exception when this fails. That means that the file format is not recognised.
|
format_version = int(parser.get("general", "version")) #Explicitly give an exception when this fails. That means that the file format is not recognised.
|
||||||
setting_version = int(parser.get("metadata", "setting_version", fallback = 0))
|
setting_version = int(parser.get("metadata", "setting_version", fallback = "0"))
|
||||||
return format_version * 1000000 + setting_version
|
return format_version * 1000000 + setting_version
|
||||||
|
|
||||||
## Upgrades a preferences file from version 2.7 to 3.0.
|
## Upgrades a preferences file from version 2.7 to 3.0.
|
||||||
|
@ -158,7 +158,7 @@ class VersionUpgrade27to30(VersionUpgrade):
|
||||||
# \param serialised The serialised form of the container file.
|
# \param serialised The serialised form of the container file.
|
||||||
# \param filename The name of the file to upgrade.
|
# \param filename The name of the file to upgrade.
|
||||||
def upgradeOtherContainer(self, serialised: str, filename: str) -> Tuple[List[str], List[str]]:
|
def upgradeOtherContainer(self, serialised: str, filename: str) -> Tuple[List[str], List[str]]:
|
||||||
parser = configparser.ConfigParser(interpolation=None)
|
parser = configparser.ConfigParser(interpolation = None)
|
||||||
parser.read_string(serialised)
|
parser.read_string(serialised)
|
||||||
|
|
||||||
# Update the skin pre-shrink settings:
|
# Update the skin pre-shrink settings:
|
||||||
|
|
|
@ -77,7 +77,7 @@ class VersionUpgrade30to31(VersionUpgrade):
|
||||||
parser = configparser.ConfigParser(interpolation = None)
|
parser = configparser.ConfigParser(interpolation = None)
|
||||||
parser.read_string(serialised)
|
parser.read_string(serialised)
|
||||||
format_version = int(parser.get("general", "version")) #Explicitly give an exception when this fails. That means that the file format is not recognised.
|
format_version = int(parser.get("general", "version")) #Explicitly give an exception when this fails. That means that the file format is not recognised.
|
||||||
setting_version = int(parser.get("metadata", "setting_version", fallback = 0))
|
setting_version = int(parser.get("metadata", "setting_version", fallback = "0"))
|
||||||
return format_version * 1000000 + setting_version
|
return format_version * 1000000 + setting_version
|
||||||
|
|
||||||
## Upgrades a preferences file from version 3.0 to 3.1.
|
## Upgrades a preferences file from version 3.0 to 3.1.
|
||||||
|
|
|
@ -83,7 +83,7 @@ class VersionUpgrade32to33(VersionUpgrade):
|
||||||
parser = configparser.ConfigParser(interpolation = None)
|
parser = configparser.ConfigParser(interpolation = None)
|
||||||
parser.read_string(serialised)
|
parser.read_string(serialised)
|
||||||
format_version = int(parser.get("general", "version")) #Explicitly give an exception when this fails. That means that the file format is not recognised.
|
format_version = int(parser.get("general", "version")) #Explicitly give an exception when this fails. That means that the file format is not recognised.
|
||||||
setting_version = int(parser.get("metadata", "setting_version", fallback = 0))
|
setting_version = int(parser.get("metadata", "setting_version", fallback = "0"))
|
||||||
return format_version * 1000000 + setting_version
|
return format_version * 1000000 + setting_version
|
||||||
|
|
||||||
## Upgrades a preferences file from version 3.2 to 3.3.
|
## Upgrades a preferences file from version 3.2 to 3.3.
|
||||||
|
|
|
@ -29,7 +29,7 @@ class VersionUpgrade33to34(VersionUpgrade):
|
||||||
parser = configparser.ConfigParser(interpolation = None)
|
parser = configparser.ConfigParser(interpolation = None)
|
||||||
parser.read_string(serialised)
|
parser.read_string(serialised)
|
||||||
format_version = int(parser.get("general", "version")) #Explicitly give an exception when this fails. That means that the file format is not recognised.
|
format_version = int(parser.get("general", "version")) #Explicitly give an exception when this fails. That means that the file format is not recognised.
|
||||||
setting_version = int(parser.get("metadata", "setting_version", fallback = 0))
|
setting_version = int(parser.get("metadata", "setting_version", fallback = "0"))
|
||||||
return format_version * 1000000 + setting_version
|
return format_version * 1000000 + setting_version
|
||||||
|
|
||||||
## Upgrades instance containers to have the new version
|
## Upgrades instance containers to have the new version
|
||||||
|
|
|
@ -78,7 +78,7 @@ class VersionUpgrade34to35(VersionUpgrade):
|
||||||
parser = configparser.ConfigParser(interpolation = None)
|
parser = configparser.ConfigParser(interpolation = None)
|
||||||
parser.read_string(serialised)
|
parser.read_string(serialised)
|
||||||
format_version = int(parser.get("general", "version")) #Explicitly give an exception when this fails. That means that the file format is not recognised.
|
format_version = int(parser.get("general", "version")) #Explicitly give an exception when this fails. That means that the file format is not recognised.
|
||||||
setting_version = int(parser.get("metadata", "setting_version", fallback = 0))
|
setting_version = int(parser.get("metadata", "setting_version", fallback = "0"))
|
||||||
return format_version * 1000000 + setting_version
|
return format_version * 1000000 + setting_version
|
||||||
|
|
||||||
## Upgrades Preferences to have the new version number.
|
## Upgrades Preferences to have the new version number.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue