From 7189336ef4538e232a851246476d09cb41ffc660 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Sat, 11 Jan 2020 02:35:03 +0100 Subject: get results folder id from api --- cli/app/utils/cortex_utils.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cli/app/utils') diff --git a/cli/app/utils/cortex_utils.py b/cli/app/utils/cortex_utils.py index bf49f96..0de9596 100644 --- a/cli/app/utils/cortex_utils.py +++ b/cli/app/utils/cortex_utils.py @@ -13,6 +13,12 @@ def api_url(path): def cortex_folder(opt_folder_id): return fetch_json(os.path.join(api_url('folder'), str(opt_folder_id) + "/")) +def results_folder(name="results", module="biggan"): + res = fetch_json(api_url('folder'), name=name, module=module) + if len(res): + return res[0] + raise Exception("No results folder!") + def download_cortex_files(opt_folder_id): """Fetch all new, non-generated files in a Cortex folder""" rows = fetch_json(api_url('file'), folder_id=opt_folder_id) -- cgit v1.2.3-70-g09d2