tdf#158803 Fix issues detected by pyflakes

Use raw strings for regex patterns with escape sequences in
bin/checkExternalLibraries.py and bin/crashreportScraper.py to fix
SyntaxWarning for invalid escape sequences. Remove unused exception
variable in solenv/bin/hrcex and solenv/bin/uiex.

Change-Id: Ib43ed0705e52abfcae646236364c8bffd8e7d583
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198943
Tested-by: Jenkins
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
This commit is contained in:
RHUSHYA.K.C
2026-02-25 07:37:37 +01:00
committed by Ilmari Lauhakangas
parent a8ae0abbd6
commit f2ec97d177
4 changed files with 7 additions and 7 deletions
+4 -4
View File
@@ -64,14 +64,14 @@ libraryNames = {
def get_current_version(libName):
if "sqlite" in libName:
# 3XXYYZZ -> 3.X.Y.Z
s = re.search("(\d{7})", libName )
s = re.search(r"(\d{7})", libName )
if s:
num = str(s.group(1))
return parse("{}.{}.{}.{}".format(num[0], num[1:3], num[3:5], num[6:7]))
else:
libraryName = libName.replace("_", ".")
libraryName = re.sub("[0-9a-f]{5,40}", "", libraryName) #SHA1
s = re.search("\d[\d\.]+\d", libraryName )
s = re.search(r"\d[\d\.]+\d", libraryName )
if s:
return parse(s.group())
@@ -97,9 +97,9 @@ def get_library_list(fileName):
for libraryBranch in libraryBranches:
if libraryName.lower().startswith(libraryBranch):
if libraryBranch == "postgres":
branch = ''.join(re.findall("\d{1,2}", libraryName)[0])
branch = ''.join(re.findall(r"\d{1,2}", libraryName)[0])
else:
branch = ''.join(re.findall("\d{1,2}\.\d{1,2}", libraryName)[0])
branch = ''.join(re.findall(r"\d{1,2}\.\d{1,2}", libraryName)[0])
branches[libraryBranch] = branch
print(libraryBranch + " is on branch: " + str(branch))
break
+1 -1
View File
@@ -116,7 +116,7 @@ def parse_reports_and_get_most_recent_report_from_last_page(signature, session):
td_list = tr.find_all("td")
currentID = td_list[0].a.text.strip()
currentVersion = int(''.join(re.findall("\d+", td_list[2].text)))
currentVersion = int(''.join(re.findall(r"\d+", td_list[2].text)))
currentOS = td_list[3].text.strip()
# get most recent version
+1 -1
View File
@@ -8,7 +8,7 @@ from subprocess import check_output, Popen, PIPE
try:
myopts, args = getopt.getopt(sys.argv[1:], "i:o:")
except getopt.GetoptError as e:
except getopt.GetoptError:
print(" Syntax: hrcex -i FileIn -o FileOut")
print(" FileIn: Source files (*.hrc)")
print(" FileOut: Destination file (*.*)")
+1 -1
View File
@@ -8,7 +8,7 @@ from subprocess import check_output
try:
myopts, args = getopt.getopt(sys.argv[1:], "i:o:")
except getopt.GetoptError as e:
except getopt.GetoptError:
print(" Syntax: uiex -i FileIn -o FileOut")
print(" FileIn: Source files (*.ui)")
print(" FileOut: Destination file (*.*)")