From 589dc91d2d5ff80f7f4923d640ee0eb3582d9d60 Mon Sep 17 00:00:00 2001 From: Chris Date: Mon, 16 Aug 2021 00:52:14 -0600 Subject: [PATCH] Add arguments to cli to allow disabling of copying image data from share mount (#3544) --- CHANGELOG.md | 1 + utils/cli/core/core.py | 4 ++++ utils/cli/core/definition.py | 13 +++++++++++++ 3 files changed, 18 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e3f6fadc51c..0a215affdb56 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Added ability to import data from share with cli without copying the data () - Notification if the browser does not support nesassary API - Added ability to export project as a dataset () - Additional inline tips in interactors with demo gifs () diff --git a/utils/cli/core/core.py b/utils/cli/core/core.py index 3de53809266c..839dd9b341a4 100644 --- a/utils/cli/core/core.py +++ b/utils/cli/core/core.py @@ -41,6 +41,10 @@ def tasks_data(self, task_id, resource_type, resources, **kwargs): data['image_quality'] = kwargs.get('image_quality') if 'frame_step' in kwargs: data['frame_filter'] = f"step={kwargs.get('frame_step')}" + if 'copy_data' in kwargs: + data['copy_data'] = kwargs.get('copy_data') + if 'use_cache' in kwargs: + data['use_cache'] = kwargs.get('use_cache') response = self.session.post(url, data=data, files=files) response.raise_for_status() diff --git a/utils/cli/core/definition.py b/utils/cli/core/definition.py index daf174e7fce3..fbd1080880d4 100644 --- a/utils/cli/core/definition.py +++ b/utils/cli/core/definition.py @@ -195,6 +195,19 @@ def argparse(s): help='''set the frame step option in the advanced configuration when uploading image series or videos (default: %(default)s)''' ) +task_create_parser.add_argument( + '--copy_data', + default=False, + action='store_true', + help='''set the option to copy the data, only used when resource type is + share (default: %(default)s)''' +) +task_create_parser.add_argument( + '--use_cache', + default=True, + action='store_false', + help='''set the option to use the cache (default: %(default)s)''' +) ####################################################################### # Delete #######################################################################