diff options
author | substantialnoninfringinguser <substantialnoninfringinguser@gmail.com> | 2009-05-13 05:15:49 +0100 |
---|---|---|
committer | substantialnoninfringinguser <substantialnoninfringinguser@gmail.com> | 2009-05-13 05:15:49 +0100 |
commit | 32e1e6b9ab56729f92101d5d60746ae22ef0aa06 (patch) | |
tree | 8c092735880560c1204515e2a63fca8ac9178d42 /parsers/logbooks.py | |
parent | 01073863f37d7b0a6e6b27627907d9e3ef99fc3e (diff) | |
download | troggle-32e1e6b9ab56729f92101d5d60746ae22ef0aa06.tar.gz troggle-32e1e6b9ab56729f92101d5d60746ae22ef0aa06.tar.bz2 troggle-32e1e6b9ab56729f92101d5d60746ae22ef0aa06.zip |
[svn] make the person logbooks work
Copied from http://cucc@cucc.survex.com/svn/trunk/expoweb/troggle/, rev. 8044 by julian @ 10/30/2008 1:13 PM
Diffstat (limited to 'parsers/logbooks.py')
-rw-r--r-- | parsers/logbooks.py | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/parsers/logbooks.py b/parsers/logbooks.py index 95e410f..2c66a0d 100644 --- a/parsers/logbooks.py +++ b/parsers/logbooks.py @@ -132,8 +132,8 @@ def Parselogwikitxt(year, expedition, txt): ldate = datetime.date(int(tripdate[:4]), int(tripdate[5:7]), int(tripdate[8:10]))
print "ppp", trippeople, len(triptext)
trippersons, author = GetTripPersons(trippeople, expedition)
- triptext = triptext[:10] # seems to have aproblem with this
- print "ttt", triptext
+ #triptext = triptext[:10] # seems to have aproblem with this
+ #print "ttt", triptext
lbo = models.LogbookEntry(date = ldate, place = tripcave, title = tripsplace[-1], text = triptext, author=author)
lbo.save()
@@ -170,7 +170,10 @@ def Parseloghtmltxt(year, expedition, txt): #assert tripid[:-1] == "t" + tripdate, (tripid, tripdate)
trippersons, author = GetTripPersons(trippeople, expedition)
tripcave = ""
- lbo = models.LogbookEntry(date = ldate, place = tripcave, title = triptitle, text = triptext, author=author)
+ ltriptext = re.sub("</p>", "", triptext)
+ ltriptext = re.sub("\s*?\n\s*", " ", ltriptext)
+ ltriptext = re.sub("<p>", "\n\n", ltriptext).strip()
+ lbo = models.LogbookEntry(date = ldate, place = tripcave, title = triptitle, text = ltriptext, author=author)
lbo.save()
tu = timeug or ""
@@ -186,7 +189,7 @@ def LoadLogbooks(): models.LogbookEntry.objects.all().delete()
expowebbase = os.path.join(settings.EXPOWEB, "years")
yearlinks = [
-# ("2008", "2008/logbook/2008logbook.txt"),
+ ("2008", "2008/logbook/2008logbook.txt"),
("2007", "2007/logbook/2007logbook.txt"),
("2005", "2005/logbook.html"),
("2004", "2004/logbook.html"),
@@ -210,4 +213,3 @@ def LoadLogbooks(): #LoadPersons()
LoadLogbooks()
-
|