Apply patches from John Chilton to resolve the issues where (1) Galaxy doesn't load tool sections from multiple files in a consistent manner, and (2) John's standing request in the now-defunct Galaxy bitbucket bug tracker to allow directories to appear in the tool_config_file option.

This commit is contained in:
Greg Von Kuster
2012-10-22 10:43:59 -04:00
parent 2607d1b3c0
commit c702cc0fe5
2 changed files with 13 additions and 3 deletions
+1 -1
View File
@@ -313,7 +313,7 @@ class Configuration( object ):
if self.migrated_tools_config not in tool_configs:
tool_configs.append( self.migrated_tools_config )
for path in tool_configs:
if not os.path.isfile( path ):
if not os.path.exists( path ):
raise ConfigurationError("File not found: %s" % path )
if not os.path.isfile( self.datatypes_config ):
raise ConfigurationError("File not found: %s" % self.datatypes_config )
+12 -2
View File
@@ -73,6 +73,7 @@ class ToolBox( object ):
self.workflows_by_id = {}
# In-memory dictionary that defines the layout of the tool panel.
self.tool_panel = odict()
self.index = 0
# File that contains the XML section and tool tags from all tool panel config files integrated into a
# single file that defines the tool panel layout. This file can be changed by the Galaxy administrator
# (in a way similar to the single tool_conf.xml file in the past) to alter the layout of the tool panel.
@@ -87,7 +88,14 @@ class ToolBox( object ):
self.tool_root_dir = tool_root_dir
self.app = app
self.init_dependency_manager()
for config_filename in listify( config_filenames ):
config_filenames = listify( config_filenames )
for config_filename in config_filenames:
if os.path.isdir( config_filename ):
directory_contents = sorted( os.listdir( config_filename ) )
directory_config_files = [ config_file for config_file in directory_contents if config_file.endswith( ".xml" ) ]
config_filenames.remove( config_filename )
config_filenames.extend( directory_config_files )
for config_filename in config_filenames:
try:
self.init_tools( config_filename )
except:
@@ -134,7 +142,9 @@ class ToolBox( object ):
tool_path = self.tool_root_dir
# Only load the panel_dict under certain conditions.
load_panel_dict = not self.integrated_tool_panel_config_has_contents
for index, elem in enumerate( root ):
for _, elem in enumerate( root ):
index = self.index
self.index += 1
if parsing_shed_tool_conf:
config_elems.append( elem )
if elem.tag == 'tool':