Browse Source

Add typing for all version upgrade plug-ins

Hopefully we'll take this typing along when we next copy-paste the stuffs.

Contributes to issue CURA-5936.
Ghostkeeper 6 years ago
parent
commit
ae2b312472

+ 9 - 8
plugins/VersionUpgrade/VersionUpgrade21to22/MachineInstance.py

@@ -1,15 +1,16 @@
-# Copyright (c) 2016 Ultimaker B.V.
+# Copyright (c) 2018 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 # Cura is released under the terms of the LGPLv3 or higher.
 
 
-import UM.VersionUpgrade #To indicate that a file is of incorrect format.
-import UM.VersionUpgradeManager #To schedule more files to be upgraded.
-from UM.Resources import Resources #To get the config storage path.
-
 import configparser #To read config files.
 import configparser #To read config files.
 import io #To write config files to strings as if they were files.
 import io #To write config files to strings as if they were files.
 import os.path #To get the path to write new user profiles to.
 import os.path #To get the path to write new user profiles to.
+from typing import List, Optional, Tuple
 import urllib #To serialise the user container file name properly.
 import urllib #To serialise the user container file name properly.
 
 
+import UM.VersionUpgrade #To indicate that a file is of incorrect format.
+import UM.VersionUpgradeManager #To schedule more files to be upgraded.
+from UM.Resources import Resources #To get the config storage path.
+
 ##  Creates a new machine instance instance by parsing a serialised machine
 ##  Creates a new machine instance instance by parsing a serialised machine
 #   instance in version 1 of the file format.
 #   instance in version 1 of the file format.
 #
 #
@@ -18,7 +19,7 @@ import urllib #To serialise the user container file name properly.
 #   extension.
 #   extension.
 #   \return A machine instance instance, or None if the file format is
 #   \return A machine instance instance, or None if the file format is
 #   incorrect.
 #   incorrect.
-def importFrom(serialised, filename):
+def importFrom(serialised: str, filename: str) -> Optional["MachineInstance"]:
     try:
     try:
         return MachineInstance(serialised, filename)
         return MachineInstance(serialised, filename)
     except (configparser.Error, UM.VersionUpgrade.FormatException, UM.VersionUpgrade.InvalidVersionException):
     except (configparser.Error, UM.VersionUpgrade.FormatException, UM.VersionUpgrade.InvalidVersionException):
@@ -32,7 +33,7 @@ class MachineInstance:
     #   \param serialised A string with the contents of a machine instance file,
     #   \param serialised A string with the contents of a machine instance file,
     #   without extension.
     #   without extension.
     #   \param filename The supposed file name of this machine instance.
     #   \param filename The supposed file name of this machine instance.
-    def __init__(self, serialised, filename):
+    def __init__(self, serialised: str, filename: str) -> str:
         self._filename = filename
         self._filename = filename
 
 
         config = configparser.ConfigParser(interpolation = None)
         config = configparser.ConfigParser(interpolation = None)
@@ -67,7 +68,7 @@ class MachineInstance:
     #
     #
     #   \return A tuple containing the new filename and a serialised form of
     #   \return A tuple containing the new filename and a serialised form of
     #   this machine instance, serialised in version 2 of the file format.
     #   this machine instance, serialised in version 2 of the file format.
-    def export(self):
+    def export(self) -> Tuple[List[str], List[str]]:
         config = configparser.ConfigParser(interpolation = None) # Build a config file in the form of version 2.
         config = configparser.ConfigParser(interpolation = None) # Build a config file in the form of version 2.
 
 
         config.add_section("general")
         config.add_section("general")

+ 5 - 4
plugins/VersionUpgrade/VersionUpgrade21to22/Preferences.py

@@ -1,8 +1,9 @@
-# Copyright (c) 2016 Ultimaker B.V.
+# Copyright (c) 2018 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 # Cura is released under the terms of the LGPLv3 or higher.
 
 
 import configparser #To read config files.
 import configparser #To read config files.
 import io #To output config files to string.
 import io #To output config files to string.
+from typing import List, Optional, Tuple
 
 
 import UM.VersionUpgrade #To indicate that a file is of the wrong format.
 import UM.VersionUpgrade #To indicate that a file is of the wrong format.
 
 
@@ -14,7 +15,7 @@ import UM.VersionUpgrade #To indicate that a file is of the wrong format.
 #   extension.
 #   extension.
 #   \return A representation of those preferences, or None if the file format is
 #   \return A representation of those preferences, or None if the file format is
 #   incorrect.
 #   incorrect.
-def importFrom(serialised, filename):
+def importFrom(serialised: str, filename: str) -> Optional["Preferences"]:
     try:
     try:
         return Preferences(serialised, filename)
         return Preferences(serialised, filename)
     except (configparser.Error, UM.VersionUpgrade.FormatException, UM.VersionUpgrade.InvalidVersionException):
     except (configparser.Error, UM.VersionUpgrade.FormatException, UM.VersionUpgrade.InvalidVersionException):
@@ -28,7 +29,7 @@ class Preferences:
     #   \param serialised A serialised version 2 preferences file.
     #   \param serialised A serialised version 2 preferences file.
     #   \param filename The supposed filename of the preferences file, without
     #   \param filename The supposed filename of the preferences file, without
     #   extension.
     #   extension.
-    def __init__(self, serialised, filename):
+    def __init__(self, serialised: str, filename: str) -> None:
         self._filename = filename
         self._filename = filename
 
 
         self._config = configparser.ConfigParser(interpolation = None)
         self._config = configparser.ConfigParser(interpolation = None)
@@ -50,7 +51,7 @@ class Preferences:
     #
     #
     #   \return A tuple containing the new filename and a serialised version of
     #   \return A tuple containing the new filename and a serialised version of
     #   a preferences file in version 3.
     #   a preferences file in version 3.
-    def export(self):
+    def export(self) -> Tuple[List[str], List[str]]:
         #Reset the cura/categories_expanded property since it works differently now.
         #Reset the cura/categories_expanded property since it works differently now.
         if self._config.has_section("cura") and self._config.has_option("cura", "categories_expanded"):
         if self._config.has_section("cura") and self._config.has_option("cura", "categories_expanded"):
             self._config.remove_option("cura", "categories_expanded")
             self._config.remove_option("cura", "categories_expanded")

+ 5 - 6
plugins/VersionUpgrade/VersionUpgrade21to22/Profile.py

@@ -1,10 +1,9 @@
-# Copyright (c) 2016 Ultimaker B.V.
+# Copyright (c) 2018 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 # Cura is released under the terms of the LGPLv3 or higher.
 
 
 import configparser #To read config files.
 import configparser #To read config files.
 import io #To write config files to strings as if they were files.
 import io #To write config files to strings as if they were files.
-from typing import Dict
-from typing import List
+from typing import Dict, List, Optional, Tuple
 
 
 import UM.VersionUpgrade
 import UM.VersionUpgrade
 from UM.Logger import Logger
 from UM.Logger import Logger
@@ -15,7 +14,7 @@ from UM.Logger import Logger
 #   \param serialised The serialised form of a profile in version 1.
 #   \param serialised The serialised form of a profile in version 1.
 #   \param filename The supposed filename of the profile, without extension.
 #   \param filename The supposed filename of the profile, without extension.
 #   \return A profile instance, or None if the file format is incorrect.
 #   \return A profile instance, or None if the file format is incorrect.
-def importFrom(serialised, filename):
+def importFrom(serialised: str, filename: str) -> Optional["Profile"]:
     try:
     try:
         return Profile(serialised, filename)
         return Profile(serialised, filename)
     except (configparser.Error, UM.VersionUpgrade.FormatException, UM.VersionUpgrade.InvalidVersionException):
     except (configparser.Error, UM.VersionUpgrade.FormatException, UM.VersionUpgrade.InvalidVersionException):
@@ -77,11 +76,11 @@ class Profile:
     #
     #
     #   \return A tuple containing the new filename and a serialised form of
     #   \return A tuple containing the new filename and a serialised form of
     #   this profile, serialised in version 2 of the file format.
     #   this profile, serialised in version 2 of the file format.
-    def export(self):
+    def export(self) -> Optional[Tuple[List[str], List[str]]]:
         import VersionUpgrade21to22 # Import here to prevent circular dependencies.
         import VersionUpgrade21to22 # Import here to prevent circular dependencies.
 
 
         if self._name == "Current settings":
         if self._name == "Current settings":
-            return None, None #Can't upgrade these, because the new current profile needs to specify the definition ID and the old file only had the machine instance, not the definition.
+            return None #Can't upgrade these, because the new current profile needs to specify the definition ID and the old file only had the machine instance, not the definition.
 
 
         config = configparser.ConfigParser(interpolation = None)
         config = configparser.ConfigParser(interpolation = None)
 
 

+ 35 - 34
plugins/VersionUpgrade/VersionUpgrade21to22/VersionUpgrade21to22.py

@@ -1,7 +1,8 @@
-# Copyright (c) 2017 Ultimaker B.V.
+# Copyright (c) 2018 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 # Cura is released under the terms of the LGPLv3 or higher.
 
 
 import configparser #To get version numbers from config files.
 import configparser #To get version numbers from config files.
+from typing import Dict, Iterable, List, Optional, Set, Tuple
 
 
 from UM.VersionUpgrade import VersionUpgrade # Superclass of the plugin.
 from UM.VersionUpgrade import VersionUpgrade # Superclass of the plugin.
 
 
@@ -30,7 +31,7 @@ _machines_with_machine_quality = {
         "materials": { "generic_abs", "generic_cpe", "generic_pla", "generic_pva", "generic_cpe_plus", "generic_nylon", "generic_pc", "generic_tpu" },
         "materials": { "generic_abs", "generic_cpe", "generic_pla", "generic_pva", "generic_cpe_plus", "generic_nylon", "generic_pc", "generic_tpu" },
         "variants": { "0.25 mm", "0.4 mm", "0.6 mm", "0.8 mm" }
         "variants": { "0.25 mm", "0.4 mm", "0.6 mm", "0.8 mm" }
     }
     }
-}
+} # type: Dict[str, Dict[str, Set[str]]]
 
 
 ##  How to translate material names from the old version to the new.
 ##  How to translate material names from the old version to the new.
 _material_translations = {
 _material_translations = {
@@ -41,7 +42,7 @@ _material_translations = {
     "Nylon": "generic_nylon",
     "Nylon": "generic_nylon",
     "PC": "generic_pc",
     "PC": "generic_pc",
     "TPU": "generic_tpu",
     "TPU": "generic_tpu",
-}
+} # type: Dict[str, str]
 
 
 ##  How to translate material names for in the profile names.
 ##  How to translate material names for in the profile names.
 _material_translations_profiles = {
 _material_translations_profiles = {
@@ -52,17 +53,17 @@ _material_translations_profiles = {
     "Nylon": "nylon",
     "Nylon": "nylon",
     "PC": "pc",
     "PC": "pc",
     "TPU": "tpu",
     "TPU": "tpu",
-}
+} # type: Dict[str, str]
 
 
 ##  How to translate printer names from the old version to the new.
 ##  How to translate printer names from the old version to the new.
 _printer_translations = {
 _printer_translations = {
     "ultimaker2plus": "ultimaker2_plus"
     "ultimaker2plus": "ultimaker2_plus"
-}
+} # type: Dict[str, str]
 
 
 _printer_translations_profiles = {
 _printer_translations_profiles = {
     "ultimaker2plus": "um2p", #Does NOT get included in PLA profiles!
     "ultimaker2plus": "um2p", #Does NOT get included in PLA profiles!
     "ultimaker2_extended_plus": "um2ep" #Has no profiles for CPE+, Nylon, PC and TPU!
     "ultimaker2_extended_plus": "um2ep" #Has no profiles for CPE+, Nylon, PC and TPU!
-}
+} # type: Dict[str, str]
 
 
 ##  How to translate profile names from the old version to the new.
 ##  How to translate profile names from the old version to the new.
 #
 #
@@ -116,13 +117,13 @@ _profile_translations = {
     "tpu_0.25_high": "um2p_tpu_0.25_high",
     "tpu_0.25_high": "um2p_tpu_0.25_high",
     "tpu_0.4_normal": "um2p_tpu_0.4_normal",
     "tpu_0.4_normal": "um2p_tpu_0.4_normal",
     "tpu_0.6_fast": "um2p_tpu_0.6_fast"
     "tpu_0.6_fast": "um2p_tpu_0.6_fast"
-}
+} # type: Dict[str, str]
 
 
 ##  Settings that are no longer in the new version.
 ##  Settings that are no longer in the new version.
 _removed_settings = {
 _removed_settings = {
     "fill_perimeter_gaps",
     "fill_perimeter_gaps",
     "support_area_smoothing"
     "support_area_smoothing"
-}
+} # type: Set[str]
 
 
 ##  How to translate setting names from the old version to the new.
 ##  How to translate setting names from the old version to the new.
 _setting_name_translations = {
 _setting_name_translations = {
@@ -142,7 +143,7 @@ _setting_name_translations = {
     "support_roof_line_distance": "support_interface_line_distance",
     "support_roof_line_distance": "support_interface_line_distance",
     "support_roof_line_width": "support_interface_line_width",
     "support_roof_line_width": "support_interface_line_width",
     "support_roof_pattern": "support_interface_pattern"
     "support_roof_pattern": "support_interface_pattern"
-}
+} # type: Dict[str, str]
 
 
 ##  Custom profiles become quality_changes. This dictates which quality to base
 ##  Custom profiles become quality_changes. This dictates which quality to base
 #   the quality_changes profile on.
 #   the quality_changes profile on.
@@ -190,7 +191,7 @@ _quality_fallbacks = {
             #No TPU.
             #No TPU.
         }
         }
     }
     }
-}
+} # type: Dict[str, Dict[str, Dict[str, str]]]
 
 
 ##  How to translate variants of specific machines from the old version to the
 ##  How to translate variants of specific machines from the old version to the
 #   new.
 #   new.
@@ -207,7 +208,7 @@ _variant_translations = {
         "0.6 mm": "ultimaker2_extended_plus_0.6",
         "0.6 mm": "ultimaker2_extended_plus_0.6",
         "0.8 mm": "ultimaker2_extended_plus_0.8"
         "0.8 mm": "ultimaker2_extended_plus_0.8"
     }
     }
-}
+} # type: Dict[str, Dict[str, str]]
 
 
 ##  How to translate variant names for in the profile names.
 ##  How to translate variant names for in the profile names.
 _variant_translations_profiles = {
 _variant_translations_profiles = {
@@ -215,7 +216,7 @@ _variant_translations_profiles = {
     "0.4 mm": "0.4",
     "0.4 mm": "0.4",
     "0.6 mm": "0.6",
     "0.6 mm": "0.6",
     "0.8 mm": "0.8"
     "0.8 mm": "0.8"
-}
+} # type: Dict[str, str]
 
 
 ##  Cura 2.2's material profiles use a different naming scheme for variants.
 ##  Cura 2.2's material profiles use a different naming scheme for variants.
 #
 #
@@ -233,7 +234,7 @@ _variant_translations_materials = {
         "0.6 mm": "ultimaker2_plus_0.6_mm",
         "0.6 mm": "ultimaker2_plus_0.6_mm",
         "0.8 mm": "ultimaker2_plus_0.8_mm"
         "0.8 mm": "ultimaker2_plus_0.8_mm"
     }
     }
-}
+} # type: Dict[str, Dict[str, str]]
 
 
 ##  Converts configuration from Cura 2.1's file formats to Cura 2.2's.
 ##  Converts configuration from Cura 2.1's file formats to Cura 2.2's.
 #
 #
@@ -245,8 +246,8 @@ class VersionUpgrade21to22(VersionUpgrade):
     #   number is stored in general/version, so get the data from that key.
     #   number is stored in general/version, so get the data from that key.
     #
     #
     #   \param serialised The contents of a config file.
     #   \param serialised The contents of a config file.
-    #   \return \type{int} The version number of that config file.
-    def getCfgVersion(self, serialised):
+    #   \return The version number of that config file.
+    def getCfgVersion(self, serialised: str) -> int:
         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.
@@ -263,7 +264,7 @@ class VersionUpgrade21to22(VersionUpgrade):
     #   \param variant The variant ID of the user's configuration in 2.2.
     #   \param variant The variant ID of the user's configuration in 2.2.
     #   \param material The material ID of the user's configuration in 2.2.
     #   \param material The material ID of the user's configuration in 2.2.
     @staticmethod
     @staticmethod
-    def getQualityFallback(machine, variant, material):
+    def getQualityFallback(machine: str, variant: str, material: str) -> str:
         if machine not in _quality_fallbacks:
         if machine not in _quality_fallbacks:
             return "normal"
             return "normal"
         if variant not in _quality_fallbacks[machine]:
         if variant not in _quality_fallbacks[machine]:
@@ -277,14 +278,14 @@ class VersionUpgrade21to22(VersionUpgrade):
     #   This is required to test if profiles should be converted to a quality
     #   This is required to test if profiles should be converted to a quality
     #   profile or a quality-changes profile.
     #   profile or a quality-changes profile.
     @staticmethod
     @staticmethod
-    def builtInProfiles():
+    def builtInProfiles() -> Iterable[str]:
         return _profile_translations.keys()
         return _profile_translations.keys()
 
 
     ##  Gets a set of the machines which now have per-material quality profiles.
     ##  Gets a set of the machines which now have per-material quality profiles.
     #
     #
     #   \return A set of machine identifiers.
     #   \return A set of machine identifiers.
     @staticmethod
     @staticmethod
-    def machinesWithMachineQuality():
+    def machinesWithMachineQuality() -> Dict[str, Dict[str, Set[str]]]:
         return _machines_with_machine_quality
         return _machines_with_machine_quality
 
 
     ##  Converts machine instances from format version 1 to version 2.
     ##  Converts machine instances from format version 1 to version 2.
@@ -295,10 +296,10 @@ class VersionUpgrade21to22(VersionUpgrade):
     #   \return A tuple containing the new filename and the serialised machine
     #   \return A tuple containing the new filename and the serialised machine
     #   instance in version 2, or None if the input was not of the correct
     #   instance in version 2, or None if the input was not of the correct
     #   format.
     #   format.
-    def upgradeMachineInstance(self, serialised, filename):
+    def upgradeMachineInstance(self, serialised: str, filename: str) -> Optional[Tuple[List[str], List[str]]]:
         machine_instance = MachineInstance.importFrom(serialised, filename)
         machine_instance = MachineInstance.importFrom(serialised, filename)
         if not machine_instance: #Invalid file format.
         if not machine_instance: #Invalid file format.
-            return filename, None
+            return None
         return machine_instance.export()
         return machine_instance.export()
 
 
     ##  Converts preferences from format version 2 to version 3.
     ##  Converts preferences from format version 2 to version 3.
@@ -309,10 +310,10 @@ class VersionUpgrade21to22(VersionUpgrade):
     #   \return A tuple containing the new filename and the serialised
     #   \return A tuple containing the new filename and the serialised
     #   preferences in version 3, or None if the input was not of the correct
     #   preferences in version 3, or None if the input was not of the correct
     #   format.
     #   format.
-    def upgradePreferences(self, serialised, filename):
+    def upgradePreferences(self, serialised: str, filename: str) -> Optional[Tuple[List[str], List[str]]]:
         preferences = Preferences.importFrom(serialised, filename)
         preferences = Preferences.importFrom(serialised, filename)
         if not preferences: #Invalid file format.
         if not preferences: #Invalid file format.
-            return filename, None
+            return None
         return preferences.export()
         return preferences.export()
 
 
     ##  Converts profiles from format version 1 to version 2.
     ##  Converts profiles from format version 1 to version 2.
@@ -322,10 +323,10 @@ class VersionUpgrade21to22(VersionUpgrade):
     #   extension.
     #   extension.
     #   \return A tuple containing the new filename and the serialised profile
     #   \return A tuple containing the new filename and the serialised profile
     #   in version 2, or None if the input was not of the correct format.
     #   in version 2, or None if the input was not of the correct format.
-    def upgradeProfile(self, serialised, filename):
+    def upgradeProfile(self, serialised: str, filename: str) -> Optional[Tuple[List[str], List[str]]]:
         profile = Profile.importFrom(serialised, filename)
         profile = Profile.importFrom(serialised, filename)
         if not profile: # Invalid file format.
         if not profile: # Invalid file format.
-            return filename, None
+            return None
         return profile.export()
         return profile.export()
 
 
     ##  Translates a material name for the change from Cura 2.1 to 2.2.
     ##  Translates a material name for the change from Cura 2.1 to 2.2.
@@ -333,7 +334,7 @@ class VersionUpgrade21to22(VersionUpgrade):
     #   \param material A material name in Cura 2.1.
     #   \param material A material name in Cura 2.1.
     #   \return The name of the corresponding material in Cura 2.2.
     #   \return The name of the corresponding material in Cura 2.2.
     @staticmethod
     @staticmethod
-    def translateMaterial(material):
+    def translateMaterial(material: str) -> str:
         if material in _material_translations:
         if material in _material_translations:
             return _material_translations[material]
             return _material_translations[material]
         return material
         return material
@@ -345,7 +346,7 @@ class VersionUpgrade21to22(VersionUpgrade):
     #   \return The name of the corresponding material in the quality profiles
     #   \return The name of the corresponding material in the quality profiles
     #   in Cura 2.2.
     #   in Cura 2.2.
     @staticmethod
     @staticmethod
-    def translateMaterialForProfiles(material):
+    def translateMaterialForProfiles(material: str) -> str:
         if material in _material_translations_profiles:
         if material in _material_translations_profiles:
             return _material_translations_profiles[material]
             return _material_translations_profiles[material]
         return material
         return material
@@ -356,7 +357,7 @@ class VersionUpgrade21to22(VersionUpgrade):
     #   \param printer A printer name in Cura 2.1.
     #   \param printer A printer name in Cura 2.1.
     #   \return The name of the corresponding printer in Cura 2.2.
     #   \return The name of the corresponding printer in Cura 2.2.
     @staticmethod
     @staticmethod
-    def translatePrinter(printer):
+    def translatePrinter(printer: str) -> str:
         if printer in _printer_translations:
         if printer in _printer_translations:
             return _printer_translations[printer]
             return _printer_translations[printer]
         return printer #Doesn't need to be translated.
         return printer #Doesn't need to be translated.
@@ -367,7 +368,7 @@ class VersionUpgrade21to22(VersionUpgrade):
     #   \param printer A printer name in 2.1.
     #   \param printer A printer name in 2.1.
     #   \return The name of the corresponding printer in Cura 2.2.
     #   \return The name of the corresponding printer in Cura 2.2.
     @staticmethod
     @staticmethod
-    def translatePrinterForProfile(printer):
+    def translatePrinterForProfile(printer: str) -> str:
         if printer in _printer_translations_profiles:
         if printer in _printer_translations_profiles:
             return _printer_translations_profiles[printer]
             return _printer_translations_profiles[printer]
         return printer
         return printer
@@ -378,7 +379,7 @@ class VersionUpgrade21to22(VersionUpgrade):
     #   \param profile A profile name in the old version.
     #   \param profile A profile name in the old version.
     #   \return The corresponding profile name in the new version.
     #   \return The corresponding profile name in the new version.
     @staticmethod
     @staticmethod
-    def translateProfile(profile):
+    def translateProfile(profile: str) -> str:
         if profile in _profile_translations:
         if profile in _profile_translations:
             return _profile_translations[profile]
             return _profile_translations[profile]
         return profile #Doesn't need to be translated.
         return profile #Doesn't need to be translated.
@@ -392,7 +393,7 @@ class VersionUpgrade21to22(VersionUpgrade):
     #   \param settings A dictionary of settings (as key-value pairs) to update.
     #   \param settings A dictionary of settings (as key-value pairs) to update.
     #   \return The same dictionary.
     #   \return The same dictionary.
     @staticmethod
     @staticmethod
-    def translateSettings(settings):
+    def translateSettings(settings: Dict[str, str]) -> Dict[str, str]:
         new_settings = {}
         new_settings = {}
         for key, value in settings.items():
         for key, value in settings.items():
             if key in _removed_settings:
             if key in _removed_settings:
@@ -414,7 +415,7 @@ class VersionUpgrade21to22(VersionUpgrade):
     #   \param setting The name of a setting in Cura 2.1.
     #   \param setting The name of a setting in Cura 2.1.
     #   \return The name of the corresponding setting in Cura 2.2.
     #   \return The name of the corresponding setting in Cura 2.2.
     @staticmethod
     @staticmethod
-    def translateSettingName(setting):
+    def translateSettingName(setting: str) -> str:
         if setting in _setting_name_translations:
         if setting in _setting_name_translations:
             return _setting_name_translations[setting]
             return _setting_name_translations[setting]
         return setting #Doesn't need to be translated.
         return setting #Doesn't need to be translated.
@@ -426,7 +427,7 @@ class VersionUpgrade21to22(VersionUpgrade):
     #   2.2's naming.
     #   2.2's naming.
     #   \return The name of the corresponding variant in Cura 2.2.
     #   \return The name of the corresponding variant in Cura 2.2.
     @staticmethod
     @staticmethod
-    def translateVariant(variant, machine):
+    def translateVariant(variant: str, machine: str) -> str:
         if machine in _variant_translations and variant in _variant_translations[machine]:
         if machine in _variant_translations and variant in _variant_translations[machine]:
             return _variant_translations[machine][variant]
             return _variant_translations[machine][variant]
         return variant
         return variant
@@ -440,7 +441,7 @@ class VersionUpgrade21to22(VersionUpgrade):
     #   \return The name of the corresponding variant for in material profiles
     #   \return The name of the corresponding variant for in material profiles
     #   in Cura 2.2.
     #   in Cura 2.2.
     @staticmethod
     @staticmethod
-    def translateVariantForMaterials(variant, machine):
+    def translateVariantForMaterials(variant: str, machine: str) -> str:
         if machine in _variant_translations_materials and variant in _variant_translations_materials[machine]:
         if machine in _variant_translations_materials and variant in _variant_translations_materials[machine]:
             return _variant_translations_materials[machine][variant]
             return _variant_translations_materials[machine][variant]
         return variant
         return variant
@@ -452,7 +453,7 @@ class VersionUpgrade21to22(VersionUpgrade):
     #   \return The name of the corresponding variant for in quality profiles in
     #   \return The name of the corresponding variant for in quality profiles in
     #   Cura 2.2.
     #   Cura 2.2.
     @staticmethod
     @staticmethod
-    def translateVariantForProfiles(variant):
+    def translateVariantForProfiles(variant: str) -> str:
         if variant in _variant_translations_profiles:
         if variant in _variant_translations_profiles:
             return _variant_translations_profiles[variant]
             return _variant_translations_profiles[variant]
         return variant
         return variant

+ 8 - 3
plugins/VersionUpgrade/VersionUpgrade21to22/__init__.py

@@ -1,11 +1,16 @@
-# Copyright (c) 2016 Ultimaker B.V.
+# Copyright (c) 2018 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 # Cura is released under the terms of the LGPLv3 or higher.
 
 
+from typing import Any, Dict, TYPE_CHECKING
+
 from . import VersionUpgrade21to22
 from . import VersionUpgrade21to22
 
 
+if TYPE_CHECKING:
+    from UM.Application import Application
+
 upgrade = VersionUpgrade21to22.VersionUpgrade21to22()
 upgrade = VersionUpgrade21to22.VersionUpgrade21to22()
 
 
-def getMetaData():
+def getMetaData() -> Dict[str, Any]:
     return {
     return {
         "version_upgrade": {
         "version_upgrade": {
             # From                         To                         Upgrade function
             # From                         To                         Upgrade function
@@ -33,5 +38,5 @@ def getMetaData():
         }
         }
     }
     }
 
 
-def register(app):
+def register(app: "Application") -> Dict[str, Any]:
     return { "version_upgrade": upgrade }
     return { "version_upgrade": upgrade }

+ 10 - 10
plugins/VersionUpgrade/VersionUpgrade22to24/VersionUpgrade.py

@@ -1,18 +1,18 @@
-# Copyright (c) 2017 Ultimaker B.V.
+# Copyright (c) 2018 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 # Cura is released under the terms of the LGPLv3 or higher.
 
 
 import configparser #To get version numbers from config files.
 import configparser #To get version numbers from config files.
+import io
 import os
 import os
 import os.path
 import os.path
-import io
+from typing import Dict, List, Optional, Tuple
 
 
 from UM.Resources import Resources
 from UM.Resources import Resources
 from UM.VersionUpgrade import VersionUpgrade # Superclass of the plugin.
 from UM.VersionUpgrade import VersionUpgrade # Superclass of the plugin.
 import UM.VersionUpgrade
 import UM.VersionUpgrade
 
 
 class VersionUpgrade22to24(VersionUpgrade):
 class VersionUpgrade22to24(VersionUpgrade):
-
-    def upgradeMachineInstance(self, serialised, filename):
+    def upgradeMachineInstance(self, serialised: str, filename: str) -> Optional[Tuple[List[str], List[str]]]:
         # All of this is needed to upgrade custom variant machines from old Cura to 2.4 where
         # All of this is needed to upgrade custom variant machines from old Cura to 2.4 where
         # `definition_changes` instance container has been introduced. Variant files which
         # `definition_changes` instance container has been introduced. Variant files which
         # look like the the handy work of the old machine settings plugin are converted directly
         # look like the the handy work of the old machine settings plugin are converted directly
@@ -71,7 +71,7 @@ class VersionUpgrade22to24(VersionUpgrade):
         config.write(output)
         config.write(output)
         return [filename], [output.getvalue()]
         return [filename], [output.getvalue()]
 
 
-    def __convertVariant(self, variant_path):
+    def __convertVariant(self, variant_path: str) -> str:
         # Copy the variant to the machine_instances/*_settings.inst.cfg
         # Copy the variant to the machine_instances/*_settings.inst.cfg
         variant_config = configparser.ConfigParser(interpolation = None)
         variant_config = configparser.ConfigParser(interpolation = None)
         with open(variant_path, "r", encoding = "utf-8") as fhandle:
         with open(variant_path, "r", encoding = "utf-8") as fhandle:
@@ -99,7 +99,7 @@ class VersionUpgrade22to24(VersionUpgrade):
 
 
         return config_name
         return config_name
 
 
-    def __getUserVariants(self):
+    def __getUserVariants(self) -> List[Dict[str, str]]:
         resource_path = Resources.getDataStoragePath()
         resource_path = Resources.getDataStoragePath()
         variants_dir = os.path.join(resource_path, "variants")
         variants_dir = os.path.join(resource_path, "variants")
 
 
@@ -113,7 +113,7 @@ class VersionUpgrade22to24(VersionUpgrade):
                     result.append( { "path": entry.path, "name": config.get("general", "name") } )
                     result.append( { "path": entry.path, "name": config.get("general", "name") } )
         return result
         return result
 
 
-    def upgradeExtruderTrain(self, serialised, filename):
+    def upgradeExtruderTrain(self, serialised: str, filename: str) -> Tuple[List[str], List[str]]:
         config = configparser.ConfigParser(interpolation = None)
         config = configparser.ConfigParser(interpolation = None)
         config.read_string(serialised) # Read the input string as config file.
         config.read_string(serialised) # Read the input string as config file.
         config.set("general", "version", "3")   # Just bump the version number. That is all we need for now.
         config.set("general", "version", "3")   # Just bump the version number. That is all we need for now.
@@ -122,7 +122,7 @@ class VersionUpgrade22to24(VersionUpgrade):
         config.write(output)
         config.write(output)
         return [filename], [output.getvalue()]
         return [filename], [output.getvalue()]
 
 
-    def upgradePreferences(self, serialised, filename):
+    def upgradePreferences(self, serialised: str, filename: str) -> Tuple[List[str], List[str]]:
         config = configparser.ConfigParser(interpolation = None)
         config = configparser.ConfigParser(interpolation = None)
         config.read_string(serialised)
         config.read_string(serialised)
 
 
@@ -142,7 +142,7 @@ class VersionUpgrade22to24(VersionUpgrade):
         config.write(output)
         config.write(output)
         return [filename], [output.getvalue()]
         return [filename], [output.getvalue()]
 
 
-    def upgradeQuality(self, serialised, filename):
+    def upgradeQuality(self, serialised: str, filename: str) -> Tuple[List[str], List[str]]:
         config = configparser.ConfigParser(interpolation = None)
         config = configparser.ConfigParser(interpolation = None)
         config.read_string(serialised) # Read the input string as config file.
         config.read_string(serialised) # Read the input string as config file.
         config.set("metadata", "type", "quality_changes")   # Update metadata/type to quality_changes
         config.set("metadata", "type", "quality_changes")   # Update metadata/type to quality_changes
@@ -152,7 +152,7 @@ class VersionUpgrade22to24(VersionUpgrade):
         config.write(output)
         config.write(output)
         return [filename], [output.getvalue()]
         return [filename], [output.getvalue()]
 
 
-    def getCfgVersion(self, serialised):
+    def getCfgVersion(self, serialised: str) -> int:
         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.

+ 8 - 3
plugins/VersionUpgrade/VersionUpgrade22to24/__init__.py

@@ -1,11 +1,16 @@
-# Copyright (c) 2016 Ultimaker B.V.
+# Copyright (c) 2018 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 # Cura is released under the terms of the LGPLv3 or higher.
 
 
+from typing import Any, Dict, TYPE_CHECKING
+
 from . import VersionUpgrade
 from . import VersionUpgrade
 
 
+if TYPE_CHECKING:
+    from UM.Application import Application
+
 upgrade = VersionUpgrade.VersionUpgrade22to24()
 upgrade = VersionUpgrade.VersionUpgrade22to24()
 
 
-def getMetaData():
+def getMetaData() -> Dict[str, Any]:
     return {
     return {
         "version_upgrade": {
         "version_upgrade": {
             # From                         To                 Upgrade function
             # From                         To                 Upgrade function
@@ -26,5 +31,5 @@ def getMetaData():
         }
         }
     }
     }
 
 
-def register(app):
+def register(app: "Application"):
     return { "version_upgrade": upgrade }
     return { "version_upgrade": upgrade }

+ 13 - 13
plugins/VersionUpgrade/VersionUpgrade25to26/VersionUpgrade25to26.py

@@ -4,6 +4,7 @@
 import configparser #To parse the files we need to upgrade and write the new files.
 import configparser #To parse the files we need to upgrade and write the new files.
 import io #To serialise configparser output to a string.
 import io #To serialise configparser output to a string.
 import os
 import os
+from typing import Dict, List, Set, Tuple
 from urllib.parse import quote_plus
 from urllib.parse import quote_plus
 
 
 from UM.Resources import Resources
 from UM.Resources import Resources
@@ -12,19 +13,18 @@ from UM.VersionUpgrade import VersionUpgrade
 _removed_settings = { #Settings that were removed in 2.5.
 _removed_settings = { #Settings that were removed in 2.5.
     "start_layers_at_same_position",
     "start_layers_at_same_position",
     "sub_div_rad_mult"
     "sub_div_rad_mult"
-}
+} # type: Set[str]
 
 
 _split_settings = { #These settings should be copied to all settings it was split into.
 _split_settings = { #These settings should be copied to all settings it was split into.
     "support_interface_line_distance": {"support_roof_line_distance", "support_bottom_line_distance"}
     "support_interface_line_distance": {"support_roof_line_distance", "support_bottom_line_distance"}
-}
+} # type: Dict[str, Set[str]]
 
 
 ##  A collection of functions that convert the configuration of the user in Cura
 ##  A collection of functions that convert the configuration of the user in Cura
 #   2.5 to a configuration for Cura 2.6.
 #   2.5 to a configuration for Cura 2.6.
 #
 #
 #   All of these methods are essentially stateless.
 #   All of these methods are essentially stateless.
 class VersionUpgrade25to26(VersionUpgrade):
 class VersionUpgrade25to26(VersionUpgrade):
-
-    def __init__(self):
+    def __init__(self) -> None:
         super().__init__()
         super().__init__()
         self._current_fdm_printer_count = 2
         self._current_fdm_printer_count = 2
 
 
@@ -39,7 +39,7 @@ class VersionUpgrade25to26(VersionUpgrade):
     #   \raises ValueError The format of the version number in the file is
     #   \raises ValueError The format of the version number in the file is
     #   incorrect.
     #   incorrect.
     #   \raises KeyError The format of the file is incorrect.
     #   \raises KeyError The format of the file is incorrect.
-    def getCfgVersion(self, serialised):
+    def getCfgVersion(self, serialised: str) -> int:
         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.
@@ -50,7 +50,7 @@ class VersionUpgrade25to26(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, filename):
+    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)
 
 
@@ -86,7 +86,7 @@ class VersionUpgrade25to26(VersionUpgrade):
     #
     #
     #   \param serialised The serialised form of a quality profile.
     #   \param serialised The serialised form of a quality profile.
     #   \param filename The name of the file to upgrade.
     #   \param filename The name of the file to upgrade.
-    def upgradeInstanceContainer(self, serialised, filename):
+    def upgradeInstanceContainer(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)
 
 
@@ -116,7 +116,7 @@ class VersionUpgrade25to26(VersionUpgrade):
     #
     #
     #   \param serialised The serialised form of a quality profile.
     #   \param serialised The serialised form of a quality profile.
     #   \param filename The name of the file to upgrade.
     #   \param filename The name of the file to upgrade.
-    def upgradeMachineStack(self, serialised, filename):
+    def upgradeMachineStack(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)
 
 
@@ -149,7 +149,7 @@ class VersionUpgrade25to26(VersionUpgrade):
         return [filename], [output.getvalue()]
         return [filename], [output.getvalue()]
 
 
     ##  Acquires the next unique extruder stack index number for the Custom FDM Printer.
     ##  Acquires the next unique extruder stack index number for the Custom FDM Printer.
-    def _acquireNextUniqueCustomFdmPrinterExtruderStackIdIndex(self):
+    def _acquireNextUniqueCustomFdmPrinterExtruderStackIdIndex(self) -> int:
         extruder_stack_dir = os.path.join(Resources.getDataStoragePath(), "extruders")
         extruder_stack_dir = os.path.join(Resources.getDataStoragePath(), "extruders")
         file_name_list = os.listdir(extruder_stack_dir)
         file_name_list = os.listdir(extruder_stack_dir)
         file_name_list = [os.path.basename(file_name) for file_name in file_name_list]
         file_name_list = [os.path.basename(file_name) for file_name in file_name_list]
@@ -169,7 +169,7 @@ class VersionUpgrade25to26(VersionUpgrade):
 
 
         return self._current_fdm_printer_count
         return self._current_fdm_printer_count
 
 
-    def _checkCustomFdmPrinterHasExtruderStack(self, machine_id):
+    def _checkCustomFdmPrinterHasExtruderStack(self, machine_id: str) -> bool:
         # go through all extruders and make sure that this custom FDM printer has extruder stacks.
         # go through all extruders and make sure that this custom FDM printer has extruder stacks.
         extruder_stack_dir = os.path.join(Resources.getDataStoragePath(), "extruders")
         extruder_stack_dir = os.path.join(Resources.getDataStoragePath(), "extruders")
         has_extruders = False
         has_extruders = False
@@ -197,7 +197,7 @@ class VersionUpgrade25to26(VersionUpgrade):
 
 
         return has_extruders
         return has_extruders
 
 
-    def _createCustomFdmPrinterExtruderStack(self, machine_id: str, position: int, quality_id: str, material_id: str):
+    def _createCustomFdmPrinterExtruderStack(self, machine_id: str, position: int, quality_id: str, material_id: str) -> None:
         stack_id = "custom_extruder_%s" % (position + 1)
         stack_id = "custom_extruder_%s" % (position + 1)
         if self._current_fdm_printer_count > 1:
         if self._current_fdm_printer_count > 1:
             stack_id += " #%s" % self._current_fdm_printer_count
             stack_id += " #%s" % self._current_fdm_printer_count
@@ -256,7 +256,7 @@ class VersionUpgrade25to26(VersionUpgrade):
 
 
     ##  Creates a definition changes container which doesn't contain anything for the Custom FDM Printers.
     ##  Creates a definition changes container which doesn't contain anything for the Custom FDM Printers.
     #   The container ID will be automatically generated according to the given stack name.
     #   The container ID will be automatically generated according to the given stack name.
-    def _getCustomFdmPrinterDefinitionChanges(self, stack_id: str):
+    def _getCustomFdmPrinterDefinitionChanges(self, stack_id: str) -> configparser.ConfigParser:
         # In 2.5, there is no definition_changes container for the Custom FDM printer, so it should be safe to use the
         # In 2.5, there is no definition_changes container for the Custom FDM printer, so it should be safe to use the
         # default name unless some one names the printer as something like "Custom FDM Printer_settings".
         # default name unless some one names the printer as something like "Custom FDM Printer_settings".
         definition_changes_id = stack_id + "_settings"
         definition_changes_id = stack_id + "_settings"
@@ -277,7 +277,7 @@ class VersionUpgrade25to26(VersionUpgrade):
 
 
     ##  Creates a user settings container which doesn't contain anything for the Custom FDM Printers.
     ##  Creates a user settings container which doesn't contain anything for the Custom FDM Printers.
     #   The container ID will be automatically generated according to the given stack name.
     #   The container ID will be automatically generated according to the given stack name.
-    def _getCustomFdmPrinterUserSettings(self, stack_id: str):
+    def _getCustomFdmPrinterUserSettings(self, stack_id: str) -> configparser.ConfigParser:
         # For the extruder stacks created in the upgrade, also create user_settings containers so the user changes
         # For the extruder stacks created in the upgrade, also create user_settings containers so the user changes
         # will be saved.
         # will be saved.
         user_settings_id = stack_id + "_user"
         user_settings_id = stack_id + "_user"

+ 8 - 3
plugins/VersionUpgrade/VersionUpgrade25to26/__init__.py

@@ -1,11 +1,16 @@
-# Copyright (c) 2017 Ultimaker B.V.
+# Copyright (c) 2018 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 # Cura is released under the terms of the LGPLv3 or higher.
 
 
+from typing import Any, Dict, TYPE_CHECKING
+
 from . import VersionUpgrade25to26
 from . import VersionUpgrade25to26
 
 
+if TYPE_CHECKING:
+    from UM.Application import Application
+
 upgrade = VersionUpgrade25to26.VersionUpgrade25to26()
 upgrade = VersionUpgrade25to26.VersionUpgrade25to26()
 
 
-def getMetaData():
+def getMetaData() -> Dict[str, Any]:
     return {
     return {
         "version_upgrade": {
         "version_upgrade": {
             # From                          To                          Upgrade function
             # From                          To                          Upgrade function
@@ -41,5 +46,5 @@ def getMetaData():
         }
         }
     }
     }
 
 
-def register(app):
+def register(app: "Application") -> Dict[str, Any]:
     return { "version_upgrade": upgrade }
     return { "version_upgrade": upgrade }

+ 7 - 6
plugins/VersionUpgrade/VersionUpgrade26to27/VersionUpgrade26to27.py

@@ -3,6 +3,7 @@
 
 
 import configparser #To parse the files we need to upgrade and write the new files.
 import configparser #To parse the files we need to upgrade and write the new files.
 import io #To serialise configparser output to a string.
 import io #To serialise configparser output to a string.
+from typing import Dict, List, Tuple
 
 
 from UM.VersionUpgrade import VersionUpgrade
 from UM.VersionUpgrade import VersionUpgrade
 
 
@@ -61,7 +62,7 @@ _renamed_quality_profiles = {
 
 
     "um3_bb0.8_TPU_Not_Supported_Quality": "um3_bb0.8_TPU_Fast_print",
     "um3_bb0.8_TPU_Not_Supported_Quality": "um3_bb0.8_TPU_Fast_print",
     "um3_bb0.8_TPU_Not_Supported_Superdraft_Quality": "um3_bb0.8_TPU_Superdraft_Print",
     "um3_bb0.8_TPU_Not_Supported_Superdraft_Quality": "um3_bb0.8_TPU_Superdraft_Print",
-}
+} # type: Dict[str, str]
 
 
 ##  A collection of functions that convert the configuration of the user in Cura
 ##  A collection of functions that convert the configuration of the user in Cura
 #   2.6 to a configuration for Cura 2.7.
 #   2.6 to a configuration for Cura 2.7.
@@ -79,7 +80,7 @@ class VersionUpgrade26to27(VersionUpgrade):
     #   \raises ValueError The format of the version number in the file is
     #   \raises ValueError The format of the version number in the file is
     #   incorrect.
     #   incorrect.
     #   \raises KeyError The format of the file is incorrect.
     #   \raises KeyError The format of the file is incorrect.
-    def getCfgVersion(self, serialised):
+    def getCfgVersion(self, serialised: str) -> int:
         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.
@@ -90,7 +91,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, filename):
+    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)
 
 
@@ -117,8 +118,8 @@ class VersionUpgrade26to27(VersionUpgrade):
     #
     #
     #   \param serialised The serialised form of a container file.
     #   \param serialised The serialised form of a container file.
     #   \param filename The name of the file to upgrade.
     #   \param filename The name of the file to upgrade.
-    def upgradeOtherContainer(self, serialised, filename):
-        parser = configparser.ConfigParser(interpolation=None)
+    def upgradeOtherContainer(self, serialised: str, filename: str) -> Tuple[List[str], List[str]]:
+        parser = configparser.ConfigParser(interpolation = None)
         parser.read_string(serialised)
         parser.read_string(serialised)
 
 
         # Update version numbers
         # Update version numbers
@@ -139,7 +140,7 @@ class VersionUpgrade26to27(VersionUpgrade):
     #
     #
     #   \param serialised The serialised form of a container stack.
     #   \param serialised The serialised form of a container stack.
     #   \param filename The name of the file to upgrade.
     #   \param filename The name of the file to upgrade.
-    def upgradeStack(self, serialised, filename):
+    def upgradeStack(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)
 
 

Some files were not shown because too many files changed in this diff