mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-24 02:04:04 +08:00
Reduce code duplication by reusing get_installed_repository() function.
Conflicts: lib/galaxy/tools/toolbox/base.py
This commit is contained in:
committed by
John Chilton
parent
e36d33ce74
commit
47361f12ec
@@ -18,7 +18,6 @@ from cgi import FieldStorage
|
||||
from xml.etree import ElementTree
|
||||
from mako.template import Template
|
||||
from paste import httpexceptions
|
||||
from sqlalchemy import and_
|
||||
|
||||
from galaxy import model
|
||||
from galaxy.managers import histories
|
||||
@@ -194,14 +193,13 @@ class ToolBox( BaseGalaxyToolBox ):
|
||||
# Abstract toolbox doesn't have a dependency on the the database, so
|
||||
# override _get_tool_shed_repository here to provide this information.
|
||||
|
||||
# We store only the port, if one exists, in the database.
|
||||
tool_shed = common_util.remove_protocol_from_tool_shed_url( tool_shed )
|
||||
return self.app.install_model.context.query( self.app.install_model.ToolShedRepository ) \
|
||||
.filter( and_( self.app.install_model.ToolShedRepository.table.c.tool_shed == tool_shed,
|
||||
self.app.install_model.ToolShedRepository.table.c.name == name,
|
||||
self.app.install_model.ToolShedRepository.table.c.owner == owner,
|
||||
self.app.install_model.ToolShedRepository.table.c.installed_changeset_revision == installed_changeset_revision ) ) \
|
||||
.first()
|
||||
return suc.get_installed_repository(
|
||||
self.app,
|
||||
tool_shed=tool_shed,
|
||||
name=name,
|
||||
owner=owner,
|
||||
installed_changeset_revision=installed_changeset_revision
|
||||
)
|
||||
|
||||
def __build_tool_version_select_field( self, tools, tool_id, set_selected ):
|
||||
"""Build a SelectField whose options are the ids for the received list of tools."""
|
||||
|
||||
@@ -560,7 +560,6 @@ class AbstractToolBox( Dictifiable, ManagesIntegratedToolPanelMixin, object ):
|
||||
repository_name,
|
||||
repository_owner,
|
||||
installed_changeset_revision )
|
||||
|
||||
if tool_shed_repository:
|
||||
# Only load tools if the repository is not deactivated or uninstalled.
|
||||
can_load_into_panel_dict = not tool_shed_repository.deleted
|
||||
|
||||
Reference in New Issue
Block a user