summaryrefslogtreecommitdiffstats
path: root/logbooksdump.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2021-04-27 00:31:23 +0100
committerPhilip Sargent <philip.sargent@klebos.com>2021-04-27 00:31:23 +0100
commit9e7414e0e002d6a8c3c3458fb9557ffd46ddd455 (patch)
treea402dfaed88e723262fccf485ace5d4bca5861c9 /logbooksdump.py
parente6eeaf167491fcfa40305a1a17af13d3776e41f5 (diff)
downloadtroggle-9e7414e0e002d6a8c3c3458fb9557ffd46ddd455.tar.gz
troggle-9e7414e0e002d6a8c3c3458fb9557ffd46ddd455.tar.bz2
troggle-9e7414e0e002d6a8c3c3458fb9557ffd46ddd455.zip
remove autologbooks function
Diffstat (limited to 'logbooksdump.py')
-rw-r--r--logbooksdump.py28
1 files changed, 3 insertions, 25 deletions
diff --git a/logbooksdump.py b/logbooksdump.py
index 4df4c93..877a1d8 100644
--- a/logbooksdump.py
+++ b/logbooksdump.py
@@ -3,7 +3,7 @@ import time
import timeit
import settings
-"""Two currently unused functions. To be re-engineered to produce a logbook file
+"""currently unused function. To be re-engineered to produce a logbook file
in canonical post-2010 Parseloghtmltxt() format after importing from one of the
older more artisanal formats which will then be retired. For example, 2003 used
a unique HTML format and we should regularise this and deprecate the unique parser
@@ -21,30 +21,6 @@ from django.urls import reverse
from troggle.core.models.caves import Cave, Entrance
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-def import_auto_logbooks():
- '''For logbook entries which have been 'typed up' by entering the data in a form,
- which makes a copy of the LBE in years/<year>/autologbook/<tripname>.html
- this will then re-import all thoise individual LBE files.
- Gosh. How complicated. Thank goodness we don't do anything like this anymore.
- '''
- import os
- import troggle.parsers.logbooks
-
- for pt in troggle.core.models.PersonTrip.objects.all():
- pt.delete()
- for lbe in troggle.core.models.LogbookEntry.objects.all():
- lbe.delete()
- for expedition in troggle.core.models.Expedition.objects.all():
- directory = os.path.join(settings.EXPOWEB,
- "years",
- expedition.year,
- "autologbook")
- for root, dirs, filenames in os.walk(directory):
- for filename in filenames:
- print((os.path.join(root, filename)))
- parsers.logbooks.parseAutoLogBookEntry(os.path.join(root, filename))
-
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#Temporary function until definitive source of data transfered.
from django.template.defaultfilters import slugify
from django.template import loader
@@ -53,6 +29,8 @@ def dumplogbooks():
so that they can be re-imported.
This is the sort of silly thing you have to do when you started out thinking that the database was
going to be the Source Of All Truth and then retrofitting to make inthe input files be the master.
+
+ To be rewritten to produce a single logbook.html in a modern format
'''
def get_name(pe):
if pe.nickname: