diff --git a/lib/galaxy/config.py b/lib/galaxy/config.py index 1d2f8607ecb..5da66be1ea5 100644 --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -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 ) diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index 57baeaa8e47..f7ed2cb82e1 100755 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -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':