From 94e305613e2150951dcf7bc1d3c20ce9762652ae Mon Sep 17 00:00:00 2001 From: pavlemarinkovic Date: Mon, 13 Nov 2023 10:14:39 +0100 Subject: [PATCH] Remove __str__ from ExecMode EXTENSIONS yaml_all and json_all do not overlap --- sbpack/noncwl/constants.py | 5 +---- sbpack/noncwl/utils.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/sbpack/noncwl/constants.py b/sbpack/noncwl/constants.py index d870282..c0f0b3a 100644 --- a/sbpack/noncwl/constants.py +++ b/sbpack/noncwl/constants.py @@ -12,7 +12,7 @@ class EXTENSIONS: cwl = 'cwl' yaml_all = [yaml, yml, cwl] - json_all = [json, cwl] + json_all = [json] all_ = [yaml, yml, json, cwl] @@ -96,6 +96,3 @@ class EXTENSIONS: class ExecMode(Enum): single = 'single-instance' multi = 'multi-instance' - - def __str__(self): - return self.value diff --git a/sbpack/noncwl/utils.py b/sbpack/noncwl/utils.py index 35f278e..711d613 100644 --- a/sbpack/noncwl/utils.py +++ b/sbpack/noncwl/utils.py @@ -354,7 +354,7 @@ def update_schema_code_package(sb_schema, schema_ext, new_code_package): sb_schema_dict = pack(sb_schema) sb_schema_dict['app_content']['code_package'] = new_code_package - if schema_ext.lower() == EXTENSIONS.json: + if schema_ext.lower() in EXTENSIONS.json_all: with open(sb_schema, 'w') as file: json.dump(sb_schema_dict, file)