From 17fa3b47ab547110b259a3c7ed4f4c5471c46587 Mon Sep 17 00:00:00 2001 From: Nate Buttke Date: Thu, 31 Aug 2023 15:06:48 -0700 Subject: remove default dict. small logic change in check_path --- server.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'server.py') 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: -- cgit v1.2.3