Skip to content

Commit

Permalink
Remove operations from custom_datatype_manager
Browse files Browse the repository at this point in the history
Updating the upload file formats is handled when loading the datatype
into the registry, and reloading the upload tool seems unnecessary and
insufficient, since this would only affect the current web handler. In
any case removed and added datatypes are immediately propagated to the
upload tool.
  • Loading branch information
mvdbeek committed May 1, 2017
1 parent cdad5be commit 2587ab5
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 32 deletions.
8 changes: 0 additions & 8 deletions lib/galaxy/tools/__init__.py
Expand Up @@ -34,7 +34,6 @@
from galaxy.tools.actions.data_manager import DataManagerToolAction
from galaxy.tools.actions.data_source import DataSourceToolAction
from galaxy.tools.actions.model_operations import ModelOperationToolAction
from galaxy.tools.actions.upload import UploadToolAction
from galaxy.tools.deps import (
CachedDependencyManager,
views
Expand Down Expand Up @@ -249,13 +248,6 @@ def create_tool( self, config_file, repository_id=None, guid=None, **kwds ):
tool = ToolClass( config_file, tool_source, self.app, guid=guid, repository_id=repository_id, **kwds )
return tool

def handle_datatypes_changed( self ):
""" Refresh upload tools when new datatypes are added. """
for tool_id in self._tools_by_id:
tool = self._tools_by_id[ tool_id ]
if isinstance( tool.tool_action, UploadToolAction ):
self.reload_tool_by_id( tool_id )

def get_tool_components( self, tool_id, tool_version=None, get_loaded_tools_by_lineage=False, set_selected=False ):
"""
Retrieve all loaded versions of a tool from the toolbox and return a select list enabling
Expand Down
@@ -1,9 +1,8 @@
import logging
import os

from galaxy.util import asbool
from tool_shed.util import basic_util, hg_util, shed_util_common as suc
from tool_shed.util import tool_util, xml_util
from tool_shed.util import xml_util

log = logging.getLogger( __name__ )

Expand Down Expand Up @@ -84,25 +83,8 @@ def alter_config_and_load_prorietary_datatypes( self, datatypes_config, relative
config=datatypes_config_root,
deactivate=deactivate,
override=override )
if deactivate:
# Reload the upload tool to eliminate deactivated datatype extensions from the file_type
# select list.
tool_util.reload_upload_tools( self.app )
else:
self.append_to_datatypes_registry_upload_file_formats( registration )
tool_util.reload_upload_tools( self.app )
return converter_path, display_path

def append_to_datatypes_registry_upload_file_formats( self, elem ):
# See if we have any datatypes that should be displayed in the upload tool's file_type select list.
for datatype_elem in elem.findall( 'datatype' ):
extension = datatype_elem.get( 'extension', None )
display_in_upload = datatype_elem.get( 'display_in_upload', None )
if extension is not None and display_in_upload is not None:
display_in_upload = asbool( str( display_in_upload ) )
if display_in_upload and extension not in self.app.datatypes_registry.upload_file_formats:
self.app.datatypes_registry.upload_file_formats.append( extension )

def create_repository_dict_for_proprietary_datatypes( self, tool_shed, name, owner, installed_changeset_revision,
tool_dicts, converter_path=None, display_path=None ):
return dict( tool_shed=tool_shed,
Expand Down
5 changes: 0 additions & 5 deletions lib/tool_shed/util/tool_util.py
Expand Up @@ -272,8 +272,3 @@ def panel_entry_per_tool( tool_section_dict ):
if k not in [ 'id', 'version', 'name' ]:
return True
return False


def reload_upload_tools( app ):
if hasattr( app, 'toolbox' ):
app.toolbox.handle_datatypes_changed()

0 comments on commit 2587ab5

Please sign in to comment.