diff options
author | Philip Sargent <philip.sargent@klebos.com> | 2022-09-23 23:43:34 +0300 |
---|---|---|
committer | Philip Sargent <philip.sargent@klebos.com> | 2022-09-23 23:43:34 +0300 |
commit | 6e3fdd35c13508c0b767d83e35ee8b22ee3aea81 (patch) | |
tree | 079270e348add8a7ae4ab80e3979b105b98f822b /core | |
parent | c3672b476cdae13674aace3699cacd78ae47fe84 (diff) | |
download | troggle-6e3fdd35c13508c0b767d83e35ee8b22ee3aea81.tar.gz troggle-6e3fdd35c13508c0b767d83e35ee8b22ee3aea81.tar.bz2 troggle-6e3fdd35c13508c0b767d83e35ee8b22ee3aea81.zip |
Replaced maintenance headache with cleaner folder walking
Diffstat (limited to 'core')
-rw-r--r-- | core/utils.py | 21 | ||||
-rw-r--r-- | core/views/scans.py | 4 | ||||
-rw-r--r-- | core/views/uploads.py | 2 |
3 files changed, 3 insertions, 24 deletions
diff --git a/core/utils.py b/core/utils.py index 1081e17..c7f71fa 100644 --- a/core/utils.py +++ b/core/utils.py @@ -70,27 +70,6 @@ def chaosmonkey(n): # print("CHAOS strikes !", file=sys.stderr) return True -# -def GetListDir(sdir): - '''handles url or file, so we can refer to a set of scans (not drawings) on another server - returns a list of f (file), ff (file full path), is_dir (bool) - - REPLACE all use of this with Path.rglob() ! - ''' - res = [ ] - if type(sdir) is str and sdir[:7] == "http://": - # s = urllib.request.urlopen(sdir) - message = f"! Requesting loading from http:// NOT IMPLEMENTED. [{sdir}]" - print(message) - DataIssue.objects.create(parser='Drawings', message=message) - sdir[:7] = "" - - for f in os.listdir(sdir): - if f[0] != ".": - ff = os.path.join(sdir, f) - res.append((f, ff, os.path.isdir(ff))) - return res - def only_commit(fname, message): '''Only used to commit a survex file edited and saved in view/survex.py ''' diff --git a/core/views/scans.py b/core/views/scans.py index 1b9ab95..50e7209 100644 --- a/core/views/scans.py +++ b/core/views/scans.py @@ -208,8 +208,8 @@ def cavewallets(request, caveid): wallets.add(z) else: wurl = f"/scanupload/{z.walletname.replace('#',':')}" - print(f' - Unrecognised cave name \'{zcaveid}\' in {z.walletname}') - message = f" ! In {z.walletname} there is an unrecognised cave name '{zcaveid}'" + print(f' - Unrecognised cave name \'{zcaveid}\' in {z.walletname} (out of {len(Gcavelookup):,} cave names') + message = f" ! In {z.walletname} there is an unrecognised cave name '{zcaveid}' (out of {len(Gcavelookup):,} cave names" DataIssue.objects.update_or_create(parser='scans', message=message, url=wurl) manywallets = list(set(wallets)) diff --git a/core/views/uploads.py b/core/views/uploads.py index 676c554..7e25980 100644 --- a/core/views/uploads.py +++ b/core/views/uploads.py @@ -208,7 +208,7 @@ def get_complaints(complaints, waldata, svxfiles, files, wallet, wurl): if not waldata["description written"]: complaints.append("The guidebook description needs writing into the survex file. Tick the 'Cave description written' checkbox when this is done.") # QMs - if not waldata["qms written"] and int(w.year()) >= 2015: + if not waldata["qms written"] and w.year() and int(w.year()) >= 2015: complaints.append("The QMs needs writing into the survex file. Tick the 'QMs written' checkbox when this is done.") # Website |