Skip to content

Commit

Permalink
Merge pull request #586 from machawk1/issue-585
Browse files Browse the repository at this point in the history
Fix regexes for version checks to be raw string
  • Loading branch information
machawk1 authored Feb 11, 2025
2 parents 263ca1e + e23068f commit e3be5d8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions bundledApps/WAIL.py
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,7 @@ def get_heritrix_version(self):

for file in os.listdir(htrix_lib_path):
if file.startswith("heritrix-commons"):
regex = re.compile("commons-(.*)\.")
regex = re.compile(r"commons-(.*)\.")
h_version = regex.findall(file)[0]
try:
h_version = f'{h_version[: h_version.index("-")]}*'
Expand All @@ -958,7 +958,7 @@ def get_wayback_version():

for file in os.listdir(tomcat_lib_path):
if file.startswith("openwayback-core"):
regex = re.compile("core-(.*)\.")
regex = re.compile(r"core-(.*)\.")
return regex.findall(file)[0]

@staticmethod
Expand All @@ -980,7 +980,7 @@ def get_tomcat_version():
version = ""
for line in f.readlines():
if "Apache Tomcat Version " in line:
version = re.sub("[^0-9^\.]", "", line)
version = re.sub(r"[^0-9^\.]", "", line)
break
f.close()
return version
Expand Down Expand Up @@ -2162,7 +2162,7 @@ def set_versions_in_panel(self) -> None:
def get_heritrix_version() -> str:
for file in os.listdir(f"{config.heritrix_path}lib/"):
if file.startswith("heritrix-commons"):
regex = re.compile("commons-(.*)\.")
regex = re.compile(r"commons-(.*)\.")
h_version = regex.findall(file)[0]
try:
h_version = f'{h_version[: h_version.index("-")]}*'
Expand All @@ -2176,7 +2176,7 @@ def get_heritrix_version() -> str:
def get_wayback_version() -> str:
for file in os.listdir(f"{config.tomcat_path}/webapps/lib/"):
if file.startswith("openwayback-core"):
regex = re.compile("core-(.*)\.")
regex = re.compile(r"core-(.*)\.")
return regex.findall(file)[0]

# TODO: move layout management to responsibility of sub-panels, UNUSED now
Expand Down

0 comments on commit e3be5d8

Please sign in to comment.