Skip to content

Commit 321ba58

Browse files
committed
Fix syntax warnings in Python script
1 parent 8474af4 commit 321ba58

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

resources/l10n/template.pot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
#, fuzzy
77
msgid ""
88
msgstr ""
9-
"Project-Id-Version: LOOT 0.22.0\n"
9+
"Project-Id-Version: LOOT 0.22.1\n"
1010
"Report-Msgid-Bugs-To: https://github.com/loot/loot/issues\n"
11-
"POT-Creation-Date: 2023-10-15 19:15+0100\n"
11+
"POT-Creation-Date: 2023-11-05 12:33+0000\n"
1212
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414
"Language-Team: LANGUAGE <[email protected]>\n"

scripts/set_version_number.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ def replace_in_file(path, regex, replacement):
1818
outfile.write(line)
1919

2020
def update_pre_commit_hook_script(path, version):
21-
replace_in_file(path, '--package-version=[\d.]+', '--package-version={}'.format(version))
21+
replace_in_file(path, '--package-version=[\\d.]+', '--package-version={}'.format(version))
2222

2323
def update_installer_script(path, version):
24-
replace_in_file(path, '#define MyAppVersion "[\d.]+"', '#define MyAppVersion "{}"'.format(version))
24+
replace_in_file(path, '#define MyAppVersion "[\\d.]+"', '#define MyAppVersion "{}"'.format(version))
2525

2626
def update_cpp_file(path, version):
2727
version_parts = version.split('.')
2828

29-
replace_in_file(path, 'Version::major = \d+;', 'Version::major = {};'.format(version_parts[0]))
30-
replace_in_file(path, 'Version::minor = \d+;', 'Version::minor = {};'.format(version_parts[1]))
31-
replace_in_file(path, 'Version::patch = \d+;', 'Version::patch = {};'.format(version_parts[2]))
29+
replace_in_file(path, 'Version::major = \\d+;', 'Version::major = {};'.format(version_parts[0]))
30+
replace_in_file(path, 'Version::minor = \\d+;', 'Version::minor = {};'.format(version_parts[1]))
31+
replace_in_file(path, 'Version::patch = \\d+;', 'Version::patch = {};'.format(version_parts[2]))
3232

3333
def update_resource_file(path, version):
3434
comma_separated_version = version.replace('.', ', ')
3535

36-
replace_in_file(path, 'VERSION \d+, \d+, \d+', 'VERSION {}'.format(comma_separated_version))
37-
replace_in_file(path, 'Version", "\d+\.\d+\.\d+"', 'Version", "{}"'.format(version))
36+
replace_in_file(path, 'VERSION \\d+, \\d+, \\d+', 'VERSION {}'.format(comma_separated_version))
37+
replace_in_file(path, 'Version", "\\d+\\.\\d+\\.\\d+"', 'Version", "{}"'.format(version))
3838

3939
if __name__ == "__main__":
4040
parser = argparse.ArgumentParser(description = 'Set the LOOT version number')

0 commit comments

Comments
 (0)