diff options
author | Philip Sargent <philip.sargent@gmail.com> | 2024-08-11 15:19:59 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@gmail.com> | 2024-08-11 15:19:59 +0300 |
commit | 74ce8894d2c0fa154f58b2dc2afb6e3332120284 (patch) | |
tree | cf7f5316d321457348b8e6c490a90c035b3bac1b /parsers | |
parent | e64cb212c19cd7bca1771381dd43740044ca5a5b (diff) | |
download | troggle-74ce8894d2c0fa154f58b2dc2afb6e3332120284.tar.gz troggle-74ce8894d2c0fa154f58b2dc2afb6e3332120284.tar.bz2 troggle-74ce8894d2c0fa154f58b2dc2afb6e3332120284.zip |
wallets subfolders fiddling
Diffstat (limited to 'parsers')
-rw-r--r-- | parsers/scans.py | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/parsers/scans.py b/parsers/scans.py index ad9c110..e5138c3 100644 --- a/parsers/scans.py +++ b/parsers/scans.py @@ -85,15 +85,15 @@ def load_all_scans(): seen = [] c = 0 wallets = {} - for p in scans_path.rglob("*"): + for p in scans_path.rglob("*"): # this implicitly ignoires empty folders as it looks only for files if p.is_file(): - if p.suffix.lower() not in valids and p.name.lower() not in validnames: + # if p.suffix.lower() not in valids and p.name.lower() not in validnames: + # # we do not care how the files are called. Many have no suffices at all. # print(f"'{p}'", end='\n') - pass - elif p.parent == scans_path: # skip files directly in /surveyscans/ + # pass + if p.parent == scans_path: # skip files directly in /surveyscans/ pass else: - c += 1 if c % 15 == 0: print(".", end="") @@ -101,6 +101,7 @@ def load_all_scans(): print("\n ", end="") if p.parent.parent.parent.parent == scans_path: + # the wallet has subfolders, which we are uninterested in at this point. # print(f"too deep {p}", end='\n') fpath = p.parent.parent walletname = p.parent.parent.name # wallet is one level higher @@ -167,7 +168,7 @@ def load_all_scans(): ) print(f"\n - found another {wjson:,} JSON files, making a total of {len(wallets):,} wallets") - # Only the 1999 wallets have filenames which mean that the walletyear will be unset: + # Only the 1999 wallets have filepaths which would mean that the walletyear will be unset: wallets = Wallet.objects.filter(walletyear=None) for w in wallets: w.walletyear = datetime.date(1999, 1, 1) |