diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2022-09-22 22:41:42 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2022-09-22 22:41:42 +0300 |
commit | aa20692ad6d1dea43d63674335c4e4dba7ae07ec (patch) | |
tree | b21c73b78a7e6d4629ed93672cee62e8094414a3 /parsers | |
parent | af88cb4d0faf58029a9c816e2d96d07d2e15e721 (diff) | |
download | troggle-aa20692ad6d1dea43d63674335c4e4dba7ae07ec.tar.gz troggle-aa20692ad6d1dea43d63674335c4e4dba7ae07ec.tar.bz2 troggle-aa20692ad6d1dea43d63674335c4e4dba7ae07ec.zip |
bugfixes and enabling older wallets to be found and listed
Diffstat (limited to 'parsers')
-rw-r--r-- | parsers/scans.py | 45 |
1 files changed, 26 insertions, 19 deletions
diff --git a/parsers/scans.py b/parsers/scans.py index 60b3d17..109d231 100644 --- a/parsers/scans.py +++ b/parsers/scans.py @@ -100,25 +100,32 @@ def load_all_scans(): for walletname, fpath, fisdir in GetListDir(settings.SCANS_ROOT): if not fisdir: continue - - # do the year folders - if re.match(r"\d\d\d\d$", walletname): - print(f"{walletname}", end=' ') - for walletname, fpath, fisdir in GetListDir(fpath): - if fisdir: - wallet = Wallet(fpath=fpath, walletname=walletname) - # this is where we should load the contents.json for people, cave and date 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 - CheckEmptyDate(wallet) - CheckEmptyPeople(wallet) - wallet.save() - LoadListScansFile(wallet) - - - else: - # but We *should* load all the scans, even for nonstandard names. - print(f'\n - IGNORE {walletname} - {fpath}') + + for walletname, fpath, fisdir in GetListDir(fpath): + if fisdir: + wallet = Wallet(fpath=fpath, walletname=walletname) + # this is where we should record the year explicitly + # line 347 of view/uploads.py and needs refactoring for loading contentsjson + CheckEmptyDate(wallet) + CheckEmptyPeople(wallet) + wallet.save() + LoadListScansFile(wallet) + + # # do the year folders + # if re.match(r"\d\d\d\d$", walletname): + # print(f"{walletname}", end=' ') + # for walletname, fpath, fisdir in GetListDir(fpath): + # if fisdir: + # wallet = Wallet(fpath=fpath, walletname=walletname) + # # this is where we should record the year explicitly + # # line 347 of view/uploads.py and needs refactoring for loading contentsjson + # CheckEmptyDate(wallet) + # CheckEmptyPeople(wallet) + # wallet.save() + # LoadListScansFile(wallet) + # else: + # # but We *should* load all the scans, even for nonstandard names. + # print(f'\n - IGNORE {walletname} - {fpath}') # but we also need to check if JSON exists, even if there are no uploaded scan files contents_path = Path(settings.DRAWINGS_DATA, "walletjson") |