2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2025-12-14 02:07:07 +00:00

Replaced maintenance headache with cleaner folder walking

This commit is contained in:
Philip Sargent
2022-09-23 23:43:34 +03:00
parent c3672b476c
commit 6e3fdd35c1
6 changed files with 107 additions and 109 deletions

View File

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