Skip to content

Commit

Permalink
Convert doxygen to rst for VersionUpgrades 40+
Browse files Browse the repository at this point in the history
  • Loading branch information
ninovanhooff committed May 28, 2020
1 parent 5af9faf commit bb2a176
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ def upgradeStack(self, serialized: str, filename: str) -> Tuple[List[str], List[
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)

Expand All @@ -48,9 +49,9 @@ def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str],
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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@
} # 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)

Expand All @@ -46,8 +48,9 @@ def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List
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)

Expand All @@ -66,8 +69,9 @@ def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str],
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)

Expand Down
26 changes: 16 additions & 10 deletions plugins/VersionUpgrade/VersionUpgrade41to42/VersionUpgrade41to42.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,17 @@
}


## 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)

Expand Down Expand Up @@ -257,10 +260,12 @@ def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List
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)

Expand All @@ -284,8 +289,9 @@ def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str],
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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@
} # 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)
Expand All @@ -82,11 +84,11 @@ def upgradePreferences(self, serialized: str, filename: str):
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)

Expand All @@ -111,8 +113,9 @@ def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List
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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@

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)

Expand All @@ -41,11 +43,11 @@ def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str],
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)

Expand All @@ -72,8 +74,9 @@ def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List
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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,12 @@ def removeHiddenStacks(self) -> None:
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)

Expand All @@ -136,11 +138,11 @@ def upgradePreferences(self, serialized: str, filename: str) -> Tuple[List[str],
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)

Expand All @@ -166,8 +168,9 @@ def upgradeInstanceContainer(self, serialized: str, filename: str) -> Tuple[List
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)

Expand Down

0 comments on commit bb2a176

Please sign in to comment.