Skip to content

Commit

Permalink
Fix invalid string escapes
Browse files Browse the repository at this point in the history
Invalid string escapes print ugly DeprecationWarnings, but might result
in SyntaxErrors somewhen in the future. I'd rather fix them, so my Log
files aren't cluttered with pointless warnings.
  • Loading branch information
Patschke committed Jan 28, 2022
1 parent 536aca0 commit 1915968
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions UM/Settings/InstanceContainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ class InstanceContainer(QObject, ContainerInterface, PluginObject):
"""A container for SettingInstance objects."""

Version = 4
version_regex = re.compile("\nversion ?= ?(\d+)")
setting_version_regex = re.compile("\nsetting_version ?= ?(\d+)")
type_regex = re.compile("\ntype ?= ?(\w+)")
version_regex = re.compile(r"\nversion ?= ?(\d+)")
setting_version_regex = re.compile(r"\nsetting_version ?= ?(\d+)")
type_regex = re.compile(r"\ntype ?= ?(\w+)")

def __init__(self, container_id: str, parent: QObject = None, *args: Any, **kwargs: Any) -> None:
"""Constructor
Expand Down
4 changes: 2 additions & 2 deletions UM/VersionUpgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ def __init__(self):
"""Initialises a version upgrade plugin instance."""

super().__init__()
self._version_regex = re.compile("\nversion ?= ?(\d+)")
self._setting_version_regex = re.compile("\nsetting_version ?= ?(\d+)")
self._version_regex = re.compile(r"\nversion ?= ?(\d+)")
self._setting_version_regex = re.compile(r"\nsetting_version ?= ?(\d+)")

def getCfgVersion(self, serialised: str) -> int:
"""
Expand Down
14 changes: 7 additions & 7 deletions UM/VersionUpgradeManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ def __init__(self, application: Application) -> None:

#Regular expressions of the files that should not be checked, such as log files.
self._ignored_files = [
".*\.lock", # Don't upgrade the configuration file lock. It's not persistent.
"plugins\.json", # plugins.json and packages.json need to remain the same for the version upgrade plug-ins.
"packages\.json",
".*\.log", # Don't process the log. It's not needed and it could be really big.
".*\.log.?", # Don't process the backup of the log. It's not needed and it could be really big.
".*\\.lock", # Don't upgrade the configuration file lock. It's not persistent.
"plugins\\.json", # plugins.json and packages.json need to remain the same for the version upgrade plug-ins.
"packages\\.json",
".*\\.log", # Don't process the log. It's not needed and it could be really big.
".*\\.log.?", # Don't process the backup of the log. It's not needed and it could be really big.
"3.[0-3]\\.*", # Don't upgrade folders that are back-ups from older version upgrades. Until v3.3 we stored the back-up in the config folder itself.
"3.[0-3]/.*",
"2.[0-7]\\.*",
Expand All @@ -108,8 +108,8 @@ def __init__(self, application: Application) -> None:
"cura/.*",
"plugins\\.*", # Don't upgrade manually installed plug-ins.
"plugins/.*",
"./*packages\.json",
"./*plugins\.json"
"./*packages\\.json",
"./*plugins\\.json"
] # type: List[str]

def registerIgnoredFile(self, file_name: str) -> None:
Expand Down

0 comments on commit 1915968

Please sign in to comment.