summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNate Buttke <nate-web@riseup.net>2023-08-31 15:06:48 -0700
committerNate Buttke <nate-web@riseup.net>2023-08-31 15:06:48 -0700
commit17fa3b47ab547110b259a3c7ed4f4c5471c46587 (patch)
tree356c5424b904b28aee44b4d8e9cc18d68cf94c52
parent8abc176c440499a4de8406fd58b7d2c0a4e5b9ff (diff)
remove default dict. small logic change in check_pathHEADmaster
-rw-r--r--server.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/server.py b/server.py
index cd27865..677f266 100644
--- a/server.py
+++ b/server.py
@@ -1,4 +1,3 @@
-from collections import defaultdict
import os
import sys
from pathlib import PurePosixPath
@@ -105,14 +104,13 @@ def check_path(path, dirstructure):
kids = list(subdict["children"].keys())
return True, str(ftype), kids
else:
+ found = False
for c in components[1:]:
if c in subdict["children"]:
found = True
subdict = subdict["children"].get(c)
ftype = subdict["filetype"]
kids = list(subdict["children"].keys()) if ftype == 'dir' else None
- else:
- found = False
if found:
return found, str(ftype), kids
else: