From 81d9d7533e91a1f835c0f3aeabb02e22e02d5913 Mon Sep 17 00:00:00 2001 From: wookey Date: Tue, 25 Jun 2013 15:59:19 +0100 Subject: [PATCH] Add a function for running people parser And comments on how logbooks can't be read in until 'year' exists in database --- parsers/logbooks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/parsers/logbooks.py b/parsers/logbooks.py index 9c5b106..4180345 100644 --- a/parsers/logbooks.py +++ b/parsers/logbooks.py @@ -253,6 +253,8 @@ def Parseloghtml03(year, expedition, txt): EnterLogIntoDbase(date = ldate, place = tripcave, title = triptitle, text = ltriptext, trippeople=trippeople, expedition=expedition, logtime_underground=0) yearlinks = [ +# ("2013", "2013/logbook.html", Parseloghtmltxt), + ("2012", "2012/logbook.html", Parseloghtmltxt), ("2011", "2011/logbook.html", Parseloghtmltxt), ("2010", "2010/logbook.html", Parselogwikitxt), ("2009", "2009/2009logbook.txt", Parselogwikitxt), @@ -323,6 +325,8 @@ def LoadLogbooks(): #yearlinks = [ ("1996", "1996/log.htm", Parseloghtml01),] # overwrite for year, lloc, parsefunc in yearlinks: + # This will not work until the corresponding year exists in the database. + # In 2012 this needed noscript/folk.csv to be updated first. expedition = models.Expedition.objects.filter(year = year)[0] fin = open(os.path.join(expowebbase, lloc)) txt = fin.read().decode("latin1")