Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename list methods to prevent name collisions with the list type #277

Merged
merged 1 commit into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion abm/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.9.0-dev.6
2.9.0-dev.7
6 changes: 5 additions & 1 deletion abm/lib/benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,11 @@ def run(context: Context, workflow_path, history_prefix: str, experiment: str):
for key in item.keys():
# print(f"Getting dataset for {key} = {item[key]}")
value = _get_dataset_data(gi, item[key])
size += value['size']
if value is None:
print(f"ERROR: Unable to find dataset {item[key]}")
return
if size in value:
size += value['size']
elements.append(
_make_dataset_element(key, value['id'])
)
Expand Down
2 changes: 1 addition & 1 deletion abm/lib/cloudlaunch.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def h1(text):
'''


def list(context: Context, args: list):
def do_list(context: Context, args: list):
archived = False
filter = None
status = lambda t: t.instance_status if t.instance_status else t.status
Expand Down
2 changes: 1 addition & 1 deletion abm/lib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
print_yaml, save_profiles)


def list(context: Context, args: list):
def do_list(context: Context, args: list):
profiles = load_profiles()
print(f"Loaded {len(profiles)} profiles")
for profile in profiles:
Expand Down
2 changes: 1 addition & 1 deletion abm/lib/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
find_history, print_json)


def list(context: Context, argv: list):
def do_list(context: Context, argv: list):
parser = argparse.ArgumentParser()
parser.add_argument('-s', '--state', help='list jobs in this state')
parser.add_argument('--history', help='show jobs in the given history')
Expand Down
2 changes: 1 addition & 1 deletion abm/lib/folder.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .common import Context, connect


def list(context: Context, args: list):
def do_list(context: Context, args: list):
if len(args) == 0:
print("ERROR: no library ID was provided")
return
Expand Down
2 changes: 1 addition & 1 deletion abm/lib/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
log = logging.getLogger('abm')


def list(context: Context, args: list):
def do_list(context: Context, args: list):
state = ''
history_id = None
log.debug('Processing args')
Expand Down
2 changes: 1 addition & 1 deletion abm/lib/library.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .common import Context, connect, datasets


def list(context: Context, args: list):
def do_list(context: Context, args: list):
gi = connect(context)
if len(args) == 0:
for library in gi.libraries.get_libraries():
Expand Down
16 changes: 8 additions & 8 deletions abm/lib/menu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
help: 'download a workflow'
params: ID PATH
- name: ['list', 'ls']
handler: workflow.list
handler: workflow.do_list
help: 'list workflows available on the serer'
- name: [show]
handler: workflow.show
Expand Down Expand Up @@ -92,7 +92,7 @@
params: KEY [--hs|--hist|--history HISTORY_ID | -c|--create "History name"]
help: imports a dataset to the server from a URL specified in the datasets.yml config file.
- name: ['list', 'ls']
handler: dataset.list
handler: dataset.do_list
help: lists all the datasets on the server
- name: ['find']
handler: dataset.find
Expand Down Expand Up @@ -191,7 +191,7 @@
menu:
- name: [ list, ls ]
help: list all jobs, or jobs in a particular state. Can filter by a history.
handler: job.list
handler: job.do_list
params: "[-s|--state ok|running|error|waiting] [-h|--history historyID]"
- name: [ show ]
help: show detailed information about a job
Expand Down Expand Up @@ -222,7 +222,7 @@
menu:
- name: [list, ls]
help: list all users on the Galaxy instance
handler: users.list
handler: users.do_list
- name: [api_key, apikey, key]
help: obtain the API key for the specified user
handler: users.api_key
Expand Down Expand Up @@ -303,7 +303,7 @@
menu:
- name: [list, ls]
help: list configured servers
handler: config.list
handler: config.do_list
- name: [show, sh]
help: disply URL, API key, and kube config for a specific cloud.
handler: config.show
Expand Down Expand Up @@ -341,7 +341,7 @@
standalone: true
menu:
- name: [list, ls]
handler: cloudlaunch.list
handler: cloudlaunch.do_list
help: list deployments on all cloud providers
- name: [create, launch, new]
handler: cloudlaunch.create
Expand All @@ -356,7 +356,7 @@
menu:
- name: [list, ls]
help: list all libraries on the server
handler: library.list
handler: library.do_list
- name: [show]
help: show detailed information about a library
handler: library.show
Expand All @@ -373,7 +373,7 @@
help: manage folders in data libraries
menu:
- name: [list, ls]
handler: folder.list
handler: folder.do_list
help: list the folders in a data library
params: LIBRARY_ID
- name: [create, new]
Expand Down
2 changes: 1 addition & 1 deletion abm/lib/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from common import Context, connect


def list(context: Context, args: list):
def do_list(context: Context, args: list):
# TODO the master API key needs to be parameterized or specified in a config file.
context.API_KEY = "galaxypassword"
gi = connect(context)
Expand Down
2 changes: 1 addition & 1 deletion abm/lib/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
log = logging.getLogger('abm')


def list(context: Context, args: list):
def do_list(context: Context, args: list):
gi = connect(context)
workflows = gi.workflows.get_workflows(published=True)
if len(workflows) == 0:
Expand Down