summaryrefslogtreecommitdiffstats
path: root/parsers
diff options
context:
space:
mode:
authorgoatchurch <goatchurch@ubuntu.clocksoft.dom>2009-09-11 09:04:59 +0100
committergoatchurch <goatchurch@ubuntu.clocksoft.dom>2009-09-11 09:04:59 +0100
commitf21cddb2d04bcdfbb8aa5e93501902460087dee0 (patch)
treefb29934eedff3c09551774a5325b61f77f5346ba /parsers
parent735b729a414fdda2e4b832c58707decb19aaae6c (diff)
downloadtroggle-f21cddb2d04bcdfbb8aa5e93501902460087dee0.tar.gz
troggle-f21cddb2d04bcdfbb8aa5e93501902460087dee0.tar.bz2
troggle-f21cddb2d04bcdfbb8aa5e93501902460087dee0.zip
modelviz added
Diffstat (limited to 'parsers')
-rw-r--r--parsers/logbooks.py9
-rw-r--r--parsers/survex.py3
2 files changed, 7 insertions, 5 deletions
diff --git a/parsers/logbooks.py b/parsers/logbooks.py
index cc5db5a..ec314b6 100644
--- a/parsers/logbooks.py
+++ b/parsers/logbooks.py
@@ -91,10 +91,11 @@ def EnterLogIntoDbase(date, place, title, text, trippeople, expedition, logtime_
lookupAttribs={'date':date, 'title':title}
nonLookupAttribs={'place':place, 'text':text, 'author':author, 'expedition':expedition, 'cave':cave, 'slug':slugify(title)[:50]}
lbo, created=save_carefully(models.LogbookEntry, lookupAttribs, nonLookupAttribs)
-
+ expeditiondate = expedition.get_expedition_date(date)
+
for tripperson, time_underground in trippersons:
lookupAttribs={'person_expedition':tripperson, 'logbook_entry':lbo}
- nonLookupAttribs={'time_underground':time_underground, 'date':date, 'is_logbook_entry_author':(tripperson == author)}
+ nonLookupAttribs={'time_underground':time_underground, 'date':date, 'expeditiondate':expeditiondate, 'is_logbook_entry_author':(tripperson == author)}
#print nonLookupAttribs
save_carefully(models.PersonTrip, lookupAttribs, nonLookupAttribs)
@@ -186,7 +187,7 @@ def Parseloghtml01(year, expedition, txt):
tripid = mtripid and mtripid.group(1) or ""
tripheader = re.sub("</?(?:[ab]|span)[^>]*>", "", tripheader)
- #print [tripheader]
+ #print " ", [tripheader]
#continue
tripdate, triptitle, trippeople = tripheader.split("|")
@@ -270,7 +271,7 @@ yearlinks = [
("1994", "1994/log.htm", Parseloghtml01),
("1993", "1993/log.htm", Parseloghtml01),
("1992", "1992/log.htm", Parseloghtml01),
- #("1991", "1991/log.htm", Parseloghtml01),
+ ("1991", "1991/log.htm", Parseloghtml01),
]
def SetDatesFromLogbookEntries(expedition):
diff --git a/parsers/survex.py b/parsers/survex.py
index e9b018d..985d4e5 100644
--- a/parsers/survex.py
+++ b/parsers/survex.py
@@ -123,8 +123,9 @@ def RecursiveLoad(survexblock, survexfile, fin, textlines):
survexblock.date = re.sub("\.", "-", line)
expeditions = models.Expedition.objects.filter(year=line[:4])
if expeditions:
+ assert len(expeditions) == 1
survexblock.expedition = expeditions[0]
-
+ survexblock.expeditiondate = survexblock.expedition.get_expedition_day(survexblock.date)
elif re.match("team$(?i)", cmd):
mteammember = re.match("(Insts|Notes|Tape|Dog|Useless|Pics|Helper|Disto|Consultant)\s+(.*)$(?i)", line)
if mteammember: