deprecated non-raw regex

This commit is contained in:
Philip Sargent 2021-04-13 00:18:30 +01:00
parent ca1df94be5
commit 304bbd230a
2 changed files with 3 additions and 3 deletions

View File

@ -40,7 +40,7 @@ TROG = {
} }
} }
# This is module-level executable. This is a Bad Thing. # This is module-level executable. This is a Bad Thing. Especially when it touches the file system.
try: try:
logging.basicConfig(level=logging.DEBUG, logging.basicConfig(level=logging.DEBUG,
filename=settings.LOGFILE, filename=settings.LOGFILE,

View File

@ -281,7 +281,7 @@ def Parseloghtml01(year, expedition, txt):
logbook_entry_count += 1 logbook_entry_count += 1
try: try:
tripentry = year + "." + str(logbook_entry_count) tripentry = year + "." + str(logbook_entry_count)
s = re.match("(?s)\s*(?:<p>)?(.*?)</?p>(.*)$(?i)", trippara) s = re.match(r"(?s)\s*(?:<p>)?(.*?)</?p>(.*)$(?i)", trippara)
if not s: if not s:
message = " ! - Skipping logentry on failure to parse header: " + tripentry + trippara[:300] + "..." message = " ! - Skipping logentry on failure to parse header: " + tripentry + trippara[:300] + "..."
DataIssue.objects.create(parser='logbooks', message=message) DataIssue.objects.create(parser='logbooks', message=message)
@ -351,7 +351,7 @@ def Parseloghtml03(year, expedition, txt):
for trippara in tripparas: for trippara in tripparas:
logbook_entry_count += 1 logbook_entry_count += 1
s = re.match("(?s)\s*<p>(.*?)</p>(.*)$", trippara) s = re.match(r"(?s)\s*<p>(.*?)</p>(.*)$", trippara)
#assert s, trippara #assert s, trippara
if not ( s ) : if not ( s ) :
message = " ! - Skipping logentry on failure to parse Parseloghtml03: {} {} {}...".format(tripentry,s,trippara[:300]) message = " ! - Skipping logentry on failure to parse Parseloghtml03: {} {} {}...".format(tripentry,s,trippara[:300])