From 11c00dd8f5f8d52a26d4c0f8c6fb0e5f0b7d9756 Mon Sep 17 00:00:00 2001 From: i-h4x <130828882+i-h4x@users.noreply.github.com> Date: Sat, 15 Apr 2023 10:07:42 +0100 Subject: [PATCH] make work on old python --- server.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server.py b/server.py index a49887b6e..472064741 100644 --- a/server.py +++ b/server.py @@ -268,7 +268,12 @@ class PromptServer(): @routes.get("/workflows") async def get_workflows(request): dir = folder_paths.get_workflows_directory() - files = glob.glob('**/*.json', root_dir=dir, recursive=True) + files = [] + for dirpath, directories, file in os.walk(dir): + for file in file: + print(directories, file) + if(file.endswith(".json")): + files.append(os.path.relpath(os.path.join(dirpath, file), dir)) return web.json_response(list(map(lambda f: os.path.splitext(f)[0].replace("\\", "/"), files))) @routes.get("/workflows/{name:.+}")