Skip to content

Commit

Permalink
Restructure check_categories function
Browse files Browse the repository at this point in the history
Co-authored-by: Nicola Soranzo <[email protected]>
  • Loading branch information
bebatut and nsoranzo authored Oct 31, 2023
1 parent 183a102 commit eff7c73
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions bin/extract_galaxy_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,14 +134,12 @@ def check_categories(ts_categories, ts_cat):
:param ts_categories: tool ToolShed categories
:param ts_cat: list of ToolShed categories to keep in the extraction
"""
if ts_categories is not None and len(ts_cat) > 0:
if not ts_cat:
return True
if not ts_categories:
return False
ts_cats = ts_categories.split(", ")
to_keep = False
for cat in ts_cats:
if cat in ts_cat:
to_keep = True
return to_keep
return True
return bool(set(ts_cat) & set(ts_cats))


def get_tool_metadata(tool: ContentFile, repo: Repository) -> :
Expand Down

0 comments on commit eff7c73

Please sign in to comment.