From bb2a176e36dba2d5963f09e539986da3ae2ec5ec Mon Sep 17 00:00:00 2001 From: Nino van Hooff Date: Thu, 28 May 2020 16:21:49 +0200 Subject: [PATCH] Convert doxygen to rst for VersionUpgrades 40+ --- .../VersionUpgrade35to40.py | 7 ++--- .../VersionUpgrade40to41.py | 16 +++++++----- .../VersionUpgrade41to42.py | 26 ++++++++++++------- .../VersionUpgrade42to43.py | 17 +++++++----- .../VersionUpgrade43to44.py | 19 ++++++++------ .../VersionUpgrade44to45.py | 19 ++++++++------ 6 files changed, 62 insertions(+), 42 deletions(-) diff --git a/plugins/VersionUpgrade/VersionUpgrade35to40/VersionUpgrade35to40.py b/plugins/VersionUpgrade/VersionUpgrade35to40/VersionUpgrade35to40.py index fdca7d15df..85a7e3135a 100644 --- a/plugins/VersionUpgrade/VersionUpgrade35to40/VersionUpgrade35to40.py +++ b/plugins/VersionUpgrade/VersionUpgrade35to40/VersionUpgrade35to40.py @@ -34,8 +34,9 @@ class VersionUpgrade35to40(VersionUpgrade): parser.write(result) return [filename], [result.getvalue()] - ## Upgrades Preferences to have the new version number. def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: + """Upgrades Preferences to have the new version number.""" + parser = configparser.ConfigParser(interpolation=None) parser.read_string(serialized) @@ -48,9 +49,9 @@ class VersionUpgrade35to40(VersionUpgrade): parser.write(result) return [filename], [result.getvalue()] - ## Upgrades instance containers to have the new version - # number. def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: + """Upgrades instance containers to have the new version number.""" + parser = configparser.ConfigParser(interpolation=None) parser.read_string(serialized) diff --git a/plugins/VersionUpgrade/VersionUpgrade40to41/VersionUpgrade40to41.py b/plugins/VersionUpgrade/VersionUpgrade40to41/VersionUpgrade40to41.py index 1cccbef7da..c1df23e040 100644 --- a/plugins/VersionUpgrade/VersionUpgrade40to41/VersionUpgrade40to41.py +++ b/plugins/VersionUpgrade/VersionUpgrade40to41/VersionUpgrade40to41.py @@ -20,12 +20,14 @@ _renamed_quality_profiles = { } # type: Dict[str, str] -## Upgrades configurations from the state they were in at version 4.0 to the -# state they should be in at version 4.1. class VersionUpgrade40to41(VersionUpgrade): - ## Upgrades instance containers to have the new version - # number. + """Upgrades configurations from the state they were in at version 4.0 to the + state they should be in at version 4.1. + """ + def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: + """Upgrades instance containers to have the new version number.""" + parser = configparser.ConfigParser(interpolation = None) parser.read_string(serialized) @@ -46,8 +48,9 @@ class VersionUpgrade40to41(VersionUpgrade): parser.write(result) return [filename], [result.getvalue()] - ## Upgrades Preferences to have the new version number. def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: + """Upgrades Preferences to have the new version number.""" + parser = configparser.ConfigParser(interpolation = None) parser.read_string(serialized) @@ -66,8 +69,9 @@ class VersionUpgrade40to41(VersionUpgrade): parser.write(result) return [filename], [result.getvalue()] - ## Upgrades stacks to have the new version number. def upgradeStack(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: + """Upgrades stacks to have the new version number.""" + parser = configparser.ConfigParser(interpolation = None) parser.read_string(serialized) diff --git a/plugins/VersionUpgrade/VersionUpgrade41to42/VersionUpgrade41to42.py b/plugins/VersionUpgrade/VersionUpgrade41to42/VersionUpgrade41to42.py index 43d8561567..39d02c078c 100644 --- a/plugins/VersionUpgrade/VersionUpgrade41to42/VersionUpgrade41to42.py +++ b/plugins/VersionUpgrade/VersionUpgrade41to42/VersionUpgrade41to42.py @@ -214,14 +214,17 @@ _creality_limited_quality_type = { } -## Upgrades configurations from the state they were in at version 4.1 to the -# state they should be in at version 4.2. class VersionUpgrade41to42(VersionUpgrade): - ## Upgrades instance containers to have the new version - # number. - # - # This renames the renamed settings in the containers. + """Upgrades configurations from the state they were in at version 4.1 to the + + state they should be in at version 4.2. + """ + def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: + """Upgrades instance containers to have the new version number. + + This renames the renamed settings in the containers. + """ parser = configparser.ConfigParser(interpolation = None, comment_prefixes = ()) parser.read_string(serialized) @@ -257,10 +260,12 @@ class VersionUpgrade41to42(VersionUpgrade): parser.write(result) return [filename], [result.getvalue()] - ## Upgrades Preferences to have the new version number. - # - # This renames the renamed settings in the list of visible settings. def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: + """Upgrades Preferences to have the new version number. + + This renames the renamed settings in the list of visible settings. + """ + parser = configparser.ConfigParser(interpolation = None) parser.read_string(serialized) @@ -284,8 +289,9 @@ class VersionUpgrade41to42(VersionUpgrade): parser.write(result) return [filename], [result.getvalue()] - ## Upgrades stacks to have the new version number. def upgradeStack(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: + """Upgrades stacks to have the new version number.""" + parser = configparser.ConfigParser(interpolation = None) parser.read_string(serialized) diff --git a/plugins/VersionUpgrade/VersionUpgrade42to43/VersionUpgrade42to43.py b/plugins/VersionUpgrade/VersionUpgrade42to43/VersionUpgrade42to43.py index b139ede83c..7359e88179 100644 --- a/plugins/VersionUpgrade/VersionUpgrade42to43/VersionUpgrade42to43.py +++ b/plugins/VersionUpgrade/VersionUpgrade42to43/VersionUpgrade42to43.py @@ -57,9 +57,11 @@ _renamed_settings = { } # type: Dict[str, str] -## Upgrades configurations from the state they were in at version 4.2 to the -# state they should be in at version 4.3. class VersionUpgrade42to43(VersionUpgrade): + """Upgrades configurations from the state they were in at version 4.2 to the + + state they should be in at version 4.3. + """ def upgradePreferences(self, serialized: str, filename: str): parser = configparser.ConfigParser(interpolation = None) parser.read_string(serialized) @@ -82,11 +84,11 @@ class VersionUpgrade42to43(VersionUpgrade): parser.write(result) return [filename], [result.getvalue()] - ## Upgrades instance containers to have the new version - # number. - # - # This renames the renamed settings in the containers. def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: + """Upgrades instance containers to have the new version number. + + This renames the renamed settings in the containers. + """ parser = configparser.ConfigParser(interpolation = None, comment_prefixes = ()) parser.read_string(serialized) @@ -111,8 +113,9 @@ class VersionUpgrade42to43(VersionUpgrade): parser.write(result) return [filename], [result.getvalue()] - ## Upgrades stacks to have the new version number. def upgradeStack(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: + """Upgrades stacks to have the new version number.""" + parser = configparser.ConfigParser(interpolation = None) parser.read_string(serialized) diff --git a/plugins/VersionUpgrade/VersionUpgrade43to44/VersionUpgrade43to44.py b/plugins/VersionUpgrade/VersionUpgrade43to44/VersionUpgrade43to44.py index b5825af62e..249f55a42c 100644 --- a/plugins/VersionUpgrade/VersionUpgrade43to44/VersionUpgrade43to44.py +++ b/plugins/VersionUpgrade/VersionUpgrade43to44/VersionUpgrade43to44.py @@ -27,10 +27,12 @@ _renamed_container_id_map = { class VersionUpgrade43to44(VersionUpgrade): - ## Upgrades Preferences to have the new version number. - # - # This renames the renamed settings in the list of visible settings. def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: + """Upgrades Preferences to have the new version number. + + This renames the renamed settings in the list of visible settings. + """ + parser = configparser.ConfigParser(interpolation = None) parser.read_string(serialized) @@ -41,11 +43,11 @@ class VersionUpgrade43to44(VersionUpgrade): parser.write(result) return [filename], [result.getvalue()] - ## Upgrades instance containers to have the new version - # number. - # - # This renames the renamed settings in the containers. def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: + """Upgrades instance containers to have the new version number. + + This renames the renamed settings in the containers. + """ parser = configparser.ConfigParser(interpolation = None, comment_prefixes = ()) parser.read_string(serialized) @@ -72,8 +74,9 @@ class VersionUpgrade43to44(VersionUpgrade): parser.write(result) return [filename], [result.getvalue()] - ## Upgrades stacks to have the new version number. def upgradeStack(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: + """Upgrades stacks to have the new version number.""" + parser = configparser.ConfigParser(interpolation = None) parser.read_string(serialized) diff --git a/plugins/VersionUpgrade/VersionUpgrade44to45/VersionUpgrade44to45.py b/plugins/VersionUpgrade/VersionUpgrade44to45/VersionUpgrade44to45.py index 0747ad280b..df4f95d74d 100644 --- a/plugins/VersionUpgrade/VersionUpgrade44to45/VersionUpgrade44to45.py +++ b/plugins/VersionUpgrade/VersionUpgrade44to45/VersionUpgrade44to45.py @@ -122,10 +122,12 @@ class VersionUpgrade44to45(VersionUpgrade): except OSError: # Is a directory, file not found, or insufficient rights. continue - ## Upgrades Preferences to have the new version number. - # - # This renames the renamed settings in the list of visible settings. def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: + """Upgrades Preferences to have the new version number. + + This renames the renamed settings in the list of visible settings. + """ + parser = configparser.ConfigParser(interpolation = None) parser.read_string(serialized) @@ -136,11 +138,11 @@ class VersionUpgrade44to45(VersionUpgrade): parser.write(result) return [filename], [result.getvalue()] - ## Upgrades instance containers to have the new version - # number. - # - # This renames the renamed settings in the containers. def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: + """Upgrades instance containers to have the new version number. + + This renames the renamed settings in the containers. + """ parser = configparser.ConfigParser(interpolation = None, comment_prefixes = ()) parser.read_string(serialized) @@ -166,8 +168,9 @@ class VersionUpgrade44to45(VersionUpgrade): parser.write(result) return [filename], [result.getvalue()] - ## Upgrades stacks to have the new version number. def upgradeStack(self, serialized: str, filename: str) -> Tuple[List[str], List[str]]: + """Upgrades stacks to have the new version number.""" + parser = configparser.ConfigParser(interpolation = None) parser.read_string(serialized)