2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-14 23:37:12 +00:00

moving save_carefully()

This commit is contained in:
Philip Sargent
2021-04-13 00:11:08 +01:00
parent b602f3ae13
commit 2a1710596a
7 changed files with 54 additions and 53 deletions

View File

@@ -7,7 +7,7 @@ from django.conf import settings
from troggle.core.models import DataIssue
from troggle.core.models_caves import QM, Cave, LogbookEntry
from utils import save_carefully
from troggle.core.utils import save_carefully
def deleteQMs():
@@ -110,7 +110,7 @@ def parse_KH_QMs(kh, inputFile):
khQMs=open(os.path.join(settings.EXPOWEB, inputFile),'r')
khQMs=khQMs.readlines()
for line in khQMs:
res=re.search('name=\"[CB](?P<year>\d*)-(?P<cave>\d*)-(?P<number>\d*).*</a> (?P<grade>[ABDCV])<dd>(?P<description>.*)\[(?P<nearest_station>.*)\]',line)
res=re.search(r'name=\"[CB](?P<year>\d*)-(?P<cave>\d*)-(?P<number>\d*).*</a> (?P<grade>[ABDCV])<dd>(?P<description>.*)\[(?P<nearest_station>.*)\]',line)
if res:
res=res.groupdict()
year=int(res['year'])