2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2026-02-28 17:46:50 +00:00

separated out Model for wallet to its own file

This commit is contained in:
2023-01-29 16:23:58 +00:00
parent f73640522b
commit 432be660a4
7 changed files with 310 additions and 291 deletions

View File

@@ -4,8 +4,9 @@ import stat
from pathlib import Path
import settings
from troggle.core.models.survex import DrawingFile, Wallet
from troggle.core.models.survex import DrawingFile
from troggle.core.models.troggle import DataIssue
from troggle.core.models.wallets import Wallet
"""Searches through all the :drawings: repository looking
for tunnel and therion files

View File

@@ -66,7 +66,7 @@ ENTRIES = {
"2017": 74,
"2016": 86,
"2015": 80,
"2014": 66,
"2014": 67,
"2013": 52,
"2012": 76,
"2011": 71,
@@ -366,14 +366,14 @@ def parser_html(year, expedition, txt, seq=""):
if check in dupl:
dupl[check] += 1
triptitle = f"{triptitle} #{dupl[check]}"
print(f" - {triptitle} -- {date}")
print(f" - {triptitle} -- {ldate}")
else:
dupl[check] = 1
tu = tidy_time_underground(tu)
trippersons, author = tidy_trip_persons(trippeople, expedition, tu, tid)
tripcave = tidy_trip_cave(place)
tripcontent = tidy_trip_image_urls(tripcontent, date)
tripcontent = tidy_trip_image_urls(tripcontent, ldate)
tid = tidy_tid(tid, triptitle)
entrytuple = (ldate, place, tripcave, triptitle, tripcontent, trippersons, author, expedition, tu, tid)

View File

@@ -2,8 +2,9 @@ import datetime
from pathlib import Path
import settings
from troggle.core.models.survex import SingleScan, Wallet
from troggle.core.models.survex import SingleScan
from troggle.core.models.troggle import DataIssue
from troggle.core.models.wallets import Wallet
"""Searches through all the survey scans directories (wallets) in expofiles, looking for images to be referenced.
"""

View File

@@ -121,7 +121,7 @@ def get_offending_filename(path):
"""
return "/survexfile/" + path + ".svx"
trip_people_cache = {} # DANGEROUS, should clean it on PUSH/POP begin/end
trip_people_cache = {} # per survexblock, so robust wrt PUSH/POP begin/end
def get_team_on_trip(survexblock):
"""Uses a cache to avoid a database query if it doesn't need to.
Only used for complete team."""
@@ -145,7 +145,7 @@ def get_people_on_trip(survexblock):
return list(set(people))
trip_person_cache = {} # pre survexblock, so robust wrt PUSH/POP begin/end
trip_person_cache = {} # per survexblock, so robust wrt PUSH/POP begin/end
def put_person_on_trip(survexblock, personexpedition, tm):
"""Uses a cache to avoid a database query if it doesn't need to.
Only used for a single person"""
@@ -170,7 +170,7 @@ def put_person_on_trip(survexblock, personexpedition, tm):
trip_person_cache[(survexblock, personexpedition)] = 1
return False
person_pending_cache = {} # pre survexblock, so robust wrt PUSH/POP begin/end
person_pending_cache = {} # per survexblock, so robust wrt PUSH/POP begin/end
def add_to_pending(survexblock, tm):
"""Collects team names before we have a date so cannot validate against
expo attendance yet"""
@@ -354,7 +354,7 @@ class LoadingSurvex:
knowing the year. Unless its parent has an identified expo"""
if survexblock.parent.name == "troggle_unseens":
# Bolluxed up if we try to inherit from this random junk
# Bolluxed up if we try to inherit from this random junk, so don't.
return
expo = survexblock.expedition # may be None if no *date yet