Skip to content

Commit

Permalink
Use list comprehension to generate list of all requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdbeek committed Jul 22, 2016
1 parent 7a8265b commit 983f4a0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 3 additions & 8 deletions lib/galaxy/tools/__init__.py
Expand Up @@ -111,14 +111,9 @@ def __init__( self, config_filenames, tool_root_dir, app ):
self._view = views.DependencyResolversView(app)

@property
def all_tools_requirements(self):
reqs = []
for desc, tool in self.tools():
for requirement in tool.requirements:
if requirement.type == 'package':
reqs.append(json.dumps(requirement.to_dict(), sort_keys=True))
reqs = [json.loads(req) for req in set(reqs)]
return reqs
def all_requirements(self):
reqs = [json.dumps(req, sort_keys=True) for _, tool in self.tools() for req in tool.tool_requirements]
return [json.loads(req) for req in set(reqs)]

@property
def tools_by_id( self ):
Expand Down
2 changes: 1 addition & 1 deletion lib/galaxy/webapps/galaxy/api/tools.py
Expand Up @@ -116,7 +116,7 @@ def all_requirements(self, trans, **kwds):
Return list of unique requirements for all tools.
"""

return trans.app.toolbox.all_requirements()
return trans.app.toolbox.all_requirements

@expose_api
@web.require_admin
Expand Down

0 comments on commit 983f4a0

Please sign in to comment.