From f2fd41546e5651f62688cd691957f11e857edbc1 Mon Sep 17 00:00:00 2001 From: kamangir Date: Fri, 24 May 2024 18:14:52 -0700 Subject: [PATCH] refactor - kamangir/bolt#746 --- .abcli/aka.sh | 9 +++++++++ .abcli/get.sh | 9 +++++++++ .abcli/hubble.sh | 44 +++-------------------------------------- hubblescope/__init__.py | 2 +- 4 files changed, 22 insertions(+), 42 deletions(-) create mode 100644 .abcli/aka.sh create mode 100644 .abcli/get.sh diff --git a/.abcli/aka.sh b/.abcli/aka.sh new file mode 100644 index 0000000..35688ca --- /dev/null +++ b/.abcli/aka.sh @@ -0,0 +1,9 @@ +#! /usr/bin/env bash + +function hubble() { + abcli_hubble "$@" +} + +function hubblescope() { + abcli_hubble "$@" +} diff --git a/.abcli/get.sh b/.abcli/get.sh new file mode 100644 index 0000000..b982dbc --- /dev/null +++ b/.abcli/get.sh @@ -0,0 +1,9 @@ +#! /usr/bin/env bash + +function abcli_hubble_get() { + python3 -m hubble get \ + --what "$1" \ + --dataset_name "$2" \ + --object_name "$3" \ + "${@:4}" +} diff --git a/.abcli/hubble.sh b/.abcli/hubble.sh index 2f40392..4defad2 100755 --- a/.abcli/hubble.sh +++ b/.abcli/hubble.sh @@ -1,13 +1,5 @@ #! /usr/bin/env bash -function hubble() { - abcli_hubble "$@" -} - -function hubblescope() { - abcli_hubble "$@" -} - function abcli_hubble() { local task=$(abcli_unpack_keyword $1 help) @@ -18,39 +10,9 @@ function abcli_hubble() { return fi - local function_name=abcli_hubble_$task - if [[ $(type -t $function_name) == "function" ]]; then - $function_name "${@:2}" - return - fi - - if [ "$task" == "init" ]; then - abcli_init hubble "${@:2}" - return - fi - - if [[ "|pylint|pytest|test|" == *"|$task|"* ]]; then - abcli_${task} plugin=hubble,$2 \ - "${@:3}" - return - fi - - if [[ "|pypi|" == *"|$task|"* ]]; then - abcli_${task} "$2" \ - plugin=hubble,$3 \ - "${@:4}" - return - fi - - python3 -m hubble "$@" -} - -function abcli_hubble_get() { - python3 -m hubble get \ - --what "$1" \ - --dataset_name "$2" \ - --object_name "$3" \ - "${@:4}" + abcli_generic_task \ + plugin=hubble,task=$task \ + "${@:2}" } abcli_source_path \ diff --git a/hubblescope/__init__.py b/hubblescope/__init__.py index c8e393c..8e163fd 100644 --- a/hubblescope/__init__.py +++ b/hubblescope/__init__.py @@ -4,4 +4,4 @@ DESCRIPTION = f"{ICON} tools to access and process Hubble Space Telescope imagery and other datasets on AWS Open Data Registry." -VERSION = "4.3.1" +VERSION = "4.4.1"