2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-16 08:47:12 +00:00

formatting

This commit is contained in:
Philip Sargent
2022-08-01 17:32:35 +03:00
parent c1aaf07885
commit 0fd3cf43e8
10 changed files with 44 additions and 49 deletions

View File

@@ -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}')