2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-02-08 09:26:47 +00:00

python 3.12 discovered syntax issues

This commit is contained in:
2023-11-23 18:46:44 +00:00
parent 521fd20e37
commit 8fd09bef92
6 changed files with 8 additions and 8 deletions

View File

@@ -326,7 +326,7 @@ def parser_date(tripdate, year):
def parser_html(year, expedition, txt, seq=""):
"""This uses some of the more obscure capabilities of regular expressions,
r"""This uses some of the more obscure capabilities of regular expressions,
see https://docs.python.org/3/library/re.html
e.g.

View File

@@ -68,13 +68,13 @@ def troggle_slugify(longname):
This function copied intact to expoweb/scripts/make-folklist.py
"""
slug = longname.strip().lower().replace(" ","-")
slug = re.sub('\([^\)]*\)','',slug) # remove nickname in brackets
slug = re.sub(r'\([^\)]*\)','',slug) # remove nickname in brackets
slug = slug.replace('é', 'e')
slug = slug.replace('á', 'a')
slug = slug.replace('ä', 'a')
slug = slug.replace('&', '') # otherwise just remove the &
slug = slug.replace(';', '') # otherwise just remove the ;
slug = re.sub('<[^>]*>','',slug) # remove <span-lang = "hu">
slug = re.sub(r'<[^>]*>','',slug) # remove <span-lang = "hu">
if len(slug) > 40: # slugfield is 50 chars
slug = slug[:40]

View File

@@ -2428,9 +2428,9 @@ def FindAndLoadSurvex():
ff = survexblock.survexfile
if comment:
# print(f"FIX {survexblock} {altitude} {comment}")
if re.match("(?i)[^s]*srtm[\s\S]*", comment.lower()):
if re.match(r"(?i)[^s]*srtm[\s\S]*", comment.lower()):
print(f"SRTM {ff}.svx::{survexblock} - {spath}.svx - alt={altitude} '{comment}'")
if re.match("(?i)[^s]*radost[\s\S]*", comment.lower()):
if re.match(r"(?i)[^s]*radost[\s\S]*", comment.lower()):
print(f"RDST {ff}.svx::{survexblock} - {spath}.svx - alt={altitude} '{comment}'")
svx_load = None