commit/galaxy-central: dan: Display line errors in data table registry display encountered when loading a location file.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/d963b05c497c/ Changeset: d963b05c497c User: dan Date: 2014-05-13 22:10:27 Summary: Display line errors in data table registry display encountered when loading a location file. Affected #: 2 files diff -r d0ab4f31e0e0178f58bd2bafb0b38d7a0fee9913 -r d963b05c497cc17d36a16696077e5a0f3158e52b lib/galaxy/tools/data/__init__.py --- a/lib/galaxy/tools/data/__init__.py +++ b/lib/galaxy/tools/data/__init__.py @@ -285,8 +285,9 @@ filename = corrected_filename found = True + errors = [] if found: - self.data.extend( self.parse_file_fields( open( filename ) ) ) + self.data.extend( self.parse_file_fields( open( filename ), errors=errors ) ) self._update_version() else: self.missing_index_file = filename @@ -294,7 +295,7 @@ if filename not in self.filenames or not self.filenames[ filename ][ 'found' ]: self.filenames[ filename ] = dict( found=found, filename=filename, from_shed_config=from_shed_config, tool_data_path=tool_data_path, - config_element=config_element, tool_shed_repository=repo_info ) + config_element=config_element, tool_shed_repository=repo_info, errors=errors ) else: log.debug( "Filename '%s' already exists in filenames (%s), not adding", filename, self.filenames.keys() ) @@ -353,7 +354,7 @@ if 'name' not in self.columns: self.columns['name'] = self.columns['value'] - def parse_file_fields( self, reader ): + def parse_file_fields( self, reader, errors=None ): """ Parse separated lines from file and return a list of tuples. @@ -371,9 +372,10 @@ if self.largest_index < len( fields ): rval.append( fields ) else: - log.warn( "Line %i in tool data table '%s' is invalid (HINT: " - "'%s' characters must be used to separate fields):\n%s" - % ( ( i + 1 ), self.name, separator_char, line ) ) + line_error = "Line %i in tool data table '%s' is invalid (HINT: '%s' characters must be used to separate fields):\n%s" % ( ( i + 1 ), self.name, separator_char, line ) + if errors is not None: + errors.append( line_error ) + log.warn( line_error ) return rval def get_column_name_list( self ): diff -r d0ab4f31e0e0178f58bd2bafb0b38d7a0fee9913 -r d963b05c497cc17d36a16696077e5a0f3158e52b templates/admin/view_data_tables_registry.mako --- a/templates/admin/view_data_tables_registry.mako +++ b/templates/admin/view_data_tables_registry.mako @@ -18,7 +18,7 @@ <th bgcolor="#D8D8D8">Name</th><th bgcolor="#D8D8D8">Filename</th><th bgcolor="#D8D8D8">Tool data path</th> - <th bgcolor="#D8D8D8">Missing index file</th> + <th bgcolor="#D8D8D8">Errors</th></tr> %for data_table_elem_name, data_table in sorted_data_tables: %if ctr % 2 == 1: @@ -35,8 +35,11 @@ <td>${ file_dict.get( 'tool_data_path' ) | h }</td><td> %if not file_dict.get( 'found' ): - missing + file missing %endif + %for error in file_dict.get( 'errors', [] ): + ${ error | h } <br/> + %endfor </td></tr> %endfor 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