summaryrefslogtreecommitdiff
path: root/cli/app/utils/cortex_utils.py
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2020-01-11 02:35:03 +0100
committerJules Laplace <julescarbon@gmail.com>2020-01-11 02:35:03 +0100
commit7189336ef4538e232a851246476d09cb41ffc660 (patch)
treeb60e24d680926886039852ae4f4bb41d9d34276c /cli/app/utils/cortex_utils.py
parente4a32154c0f55f974c8fd210495898cb15027d8c (diff)
get results folder id from api
Diffstat (limited to 'cli/app/utils/cortex_utils.py')
-rw-r--r--cli/app/utils/cortex_utils.py6
1 files changed, 6 insertions, 0 deletions
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)