summaryrefslogtreecommitdiffstats
path: root/parsers/scans.py
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@klebos.com>2022-08-01 17:32:35 +0300
committerPhilip Sargent <philip.sargent@klebos.com>2022-08-01 17:32:49 +0300
commit0fd3cf43e8c9b2f1166d40d7c8edd2f6bc7b4e35 (patch)
treebf4d7a54bd5842a30499872576a12ba2f58c5044 /parsers/scans.py
parentc1aaf0788524e69872162362b73504d89737c55d (diff)
downloadtroggle-0fd3cf43e8c9b2f1166d40d7c8edd2f6bc7b4e35.tar.gz
troggle-0fd3cf43e8c9b2f1166d40d7c8edd2f6bc7b4e35.tar.bz2
troggle-0fd3cf43e8c9b2f1166d40d7c8edd2f6bc7b4e35.zip
formatting
Diffstat (limited to 'parsers/scans.py')
-rw-r--r--parsers/scans.py26
1 files changed, 14 insertions, 12 deletions
diff --git a/parsers/scans.py b/parsers/scans.py
index b78f76f..37578cb 100644
--- a/parsers/scans.py
+++ b/parsers/scans.py
@@ -15,6 +15,7 @@ import settings
from troggle.core.models.survex import SingleScan, Wallet, DrawingFile
from troggle.core.models.troggle import DataIssue
from troggle.core.utils import save_carefully, GetListDir
+from troggle.core.views.scans import datewallet
'''Searches through all the survey scans directories (wallets) in expofiles, looking for images to be referenced.
'''
@@ -61,10 +62,13 @@ wallet_blank_html = '''<html><body><H1>Wallet WALLET</H1>
'''
def CheckEmptyDate(wallet):
- '''If date is not set, get it from a linked survex file. If several, pick the earliest.
-
- Maybe also look at filedates for the scans in expofiles/surveyscans/ , but these can be re-set by copying.
+ '''If date is not set, get it from a linked survex file.
+ Could also look at filedates for the scans in expofiles/surveyscans/ , but these can be re-set by copying.
'''
+ earliest = datetime.datetime.now().date()
+
+ # This is not working, can't see why. An scans parser now taking a very long time..
+ #datewallet(wallet, earliest)
return
def CheckEmptyPeople(wallet):
@@ -73,6 +77,8 @@ def CheckEmptyPeople(wallet):
To be a Troggle model change; a many:many relationship between wallets and people,
as well as being a list in the JSON file (which is the permanent repository). We want the many:many
relationship so that we can filter wallets based on a person.
+
+ For the moment, we will just get a list..
'''
return
@@ -147,6 +153,7 @@ def load_all_scans():
# first do the smkhs (large kh survey scans) directory
# this seems to be never used ?!
+ #We should load all the scans, even for nonstandard names.
manywallets_smkhs = Wallet(fpath=os.path.join(settings.SCANS_ROOT, "../surveys/smkhs"), walletname="smkhs")
print("smkhs", end=' ')
if os.path.isdir(manywallets_smkhs.fpath):
@@ -170,19 +177,14 @@ def load_all_scans():
# this is where we should load the contents.json for people so we can report on them later
# this is where we should record the year explicitly
# line 347 of view/uploads.py and needs refactoring for loading contentsjson
- wallet.save()
- LoadListScansFile(wallet)
CheckEmptyDate(wallet)
CheckEmptyPeople(wallet)
+ wallet.save()
+ LoadListScansFile(wallet)
CopyWalletData(wallet)
-
- # what is this?
- # elif walletname != "thumbs":
- # print(f'\n - Wallet {walletname} - {fpath}')
- # wallet = Wallet(fpath=fpath, walletname=walletname)
- # wallet.save()
- # LoadListScansFile(wallet)
+
else:
+ # but We should load all the scans, even for nonstandard names.
print(f'\n - IGNORE {walletname} - {fpath}')