diff options
author | goatchurch <goatchurch@ubuntu.clocksoft.dom> | 2009-09-14 22:52:46 +0100 |
---|---|---|
committer | goatchurch <goatchurch@ubuntu.clocksoft.dom> | 2009-09-14 22:52:46 +0100 |
commit | 1294444026718d2c3f46db2febafbe2b685b7a7d (patch) | |
tree | a8c1d13419a33db9453ef18ab6354492da560a69 /parsers/logbooks.py | |
parent | 7578b65573b3c49bab55deecd0198adce4ca84fa (diff) | |
download | troggle-1294444026718d2c3f46db2febafbe2b685b7a7d.tar.gz troggle-1294444026718d2c3f46db2febafbe2b685b7a7d.tar.bz2 troggle-1294444026718d2c3f46db2febafbe2b685b7a7d.zip |
make 2008 logbook correctly parse
Diffstat (limited to 'parsers/logbooks.py')
-rw-r--r-- | parsers/logbooks.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/parsers/logbooks.py b/parsers/logbooks.py index 7d7d7d1..9404414 100644 --- a/parsers/logbooks.py +++ b/parsers/logbooks.py @@ -120,7 +120,7 @@ def Parselogwikitxt(year, expedition, txt): trippara = re.findall("===(.*?)===([\s\S]*?)(?====)", txt)
for triphead, triptext in trippara:
tripheadp = triphead.split("|")
- #print tripheadp
+ #print "ttt", tripheadp
assert len(tripheadp) == 3, (tripheadp, triptext)
tripdate, tripplace, trippeople = tripheadp
tripsplace = tripplace.split(" - ")
@@ -135,7 +135,7 @@ def Parselogwikitxt(year, expedition, txt): tu = ""
#assert tripcave == "Journey", (triphead, triptext)
- print tripdate
+ #print tripdate
ldate = ParseDate(tripdate.strip(), year)
#print "\n", tripcave, "--- ppp", trippeople, len(triptext)
EnterLogIntoDbase(date = ldate, place = tripcave, title = tripplace, text = triptext, trippeople=trippeople, expedition=expedition, logtime_underground=0)
@@ -155,7 +155,8 @@ def Parseloghtmltxt(year, expedition, txt): \s*$
''', trippara)
if not s:
- print "can't parse: ", trippara # this is 2007 which needs editing
+ if not re.search("Rigging Guide", trippara):
+ print "can't parse: ", trippara # this is 2007 which needs editing
#assert s, trippara
continue
@@ -218,7 +219,7 @@ def Parseloghtml01(year, expedition, txt): ltriptext = re.sub("</?b>", "'''", ltriptext)
- print ldate, trippeople.strip()
+ #print ldate, trippeople.strip()
# could includ the tripid (url link for cross referencing)
EnterLogIntoDbase(date=ldate, place=tripcave, title=triptitle, text=ltriptext, trippeople=trippeople, expedition=expedition, logtime_underground=0)
@@ -236,8 +237,7 @@ def Parseloghtml03(year, expedition, txt): if re.match("T/U|Time underwater", sheader[-1]):
tu = sheader.pop()
if len(sheader) != 3:
- print sheader
- # continue
+ print "header not three pieces", sheader
tripdate, triptitle, trippeople = sheader
ldate = ParseDate(tripdate.strip(), year)
triptitles = triptitle.split(" , ")
|