commit/galaxy-central: greg: 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.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/5fc775a03f0b/ changeset: 5fc775a03f0b user: greg date: 2012-10-22 16:43:59 summary: 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. affected #: 2 files diff -r d2c998e06f0ef7b117bf2e05150bbed877d5dcb3 -r 5fc775a03f0bcb083b375629518924138aed1a88 lib/galaxy/config.py --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -313,7 +313,7 @@ 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 -r d2c998e06f0ef7b117bf2e05150bbed877d5dcb3 -r 5fc775a03f0bcb083b375629518924138aed1a88 lib/galaxy/tools/__init__.py --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -73,6 +73,7 @@ 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 @@ 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 @@ 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': Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
Bitbucket