commit/galaxy-central: dan: Allow for an arbitrary number of tool_data_table_config_path files to be defined in ini file. Values are comma separated.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/8b8b08da7231/ Changeset: 8b8b08da7231 User: dan Date: 2014-05-14 17:52:20 Summary: Allow for an arbitrary number of tool_data_table_config_path files to be defined in ini file. Values are comma separated. Affected #: 2 files diff -r 6b86b4186c455317cba726c7ad6579a030922421 -r 8b8b08da7231d3ea2bf7ccb6585a20f7e0c64cad lib/galaxy/config.py --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -102,7 +102,7 @@ self.shed_tool_data_path = resolve_path( self.shed_tool_data_path, self.root ) else: self.shed_tool_data_path = self.tool_data_path - self.tool_data_table_config_path = resolve_path( kwargs.get( 'tool_data_table_config_path', 'tool_data_table_conf.xml' ), self.root ) + self.tool_data_table_config_path = [ resolve_path( x, self.root ) for x in kwargs.get( 'tool_data_table_config_path', 'tool_data_table_conf.xml' ).split( ',' ) ] self.shed_tool_data_table_config = resolve_path( kwargs.get( 'shed_tool_data_table_config', 'shed_tool_data_table_conf.xml' ), self.root ) self.enable_tool_shed_check = string_as_bool( kwargs.get( 'enable_tool_shed_check', False ) ) self.manage_dependency_relationships = string_as_bool( kwargs.get( 'manage_dependency_relationships', False ) ) diff -r 6b86b4186c455317cba726c7ad6579a030922421 -r 8b8b08da7231d3ea2bf7ccb6585a20f7e0c64cad lib/galaxy/tools/data/__init__.py --- a/lib/galaxy/tools/data/__init__.py +++ b/lib/galaxy/tools/data/__init__.py @@ -56,19 +56,22 @@ 3. When a tool shed repository that includes a tool_data_table_conf.xml.sample file is being installed into a local Galaxy instance. In this case, we have 2 entry types to handle, files whose root tag is <tables>, for example: """ - tree = util.parse_xml( config_filename ) - root = tree.getroot() table_elems = [] - for table_elem in root.findall( 'table' ): - table = ToolDataTable.from_elem( table_elem, tool_data_path, from_shed_config ) - table_elems.append( table_elem ) - if table.name not in self.data_tables: - self.data_tables[ table.name ] = table - log.debug( "Loaded tool data table '%s'", table.name ) - else: - log.debug( "Loading another instance of data table '%s', attempting to merge content.", table.name ) - self.data_tables[ table.name ].merge_tool_data_table( table, allow_duplicates=False ) #only merge content, do not persist to disk, do not allow duplicate rows when merging - # FIXME: This does not account for an entry with the same unique build ID, but a different path. + if not isinstance( config_filename, list ): + config_filename = [ config_filename ] + for filename in config_filename: + tree = util.parse_xml( filename ) + root = tree.getroot() + for table_elem in root.findall( 'table' ): + table = ToolDataTable.from_elem( table_elem, tool_data_path, from_shed_config ) + table_elems.append( table_elem ) + if table.name not in self.data_tables: + self.data_tables[ table.name ] = table + log.debug( "Loaded tool data table '%s'", table.name ) + else: + log.debug( "Loading another instance of data table '%s', attempting to merge content.", table.name ) + self.data_tables[ table.name ].merge_tool_data_table( table, allow_duplicates=False ) #only merge content, do not persist to disk, do not allow duplicate rows when merging + # FIXME: This does not account for an entry with the same unique build ID, but a different path. return table_elems def add_new_entries_from_config_file( self, config_filename, tool_data_path, shed_tool_data_table_config, persist=False ): 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)
-
commits-noreply@bitbucket.org