commit/galaxy-central: jgoecks: Unicode fixes and refactoring.
1 new changeset in galaxy-central: http://bitbucket.org/galaxy/galaxy-central/changeset/6005fbf6fc4d/ changeset: 6005fbf6fc4d user: jgoecks date: 2011-06-08 17:32:55 summary: Unicode fixes and refactoring. affected #: 3 files (231 bytes) --- a/lib/galaxy/tools/search/__init__.py Wed Jun 08 11:15:42 2011 -0400 +++ b/lib/galaxy/tools/search/__init__.py Wed Jun 08 11:32:55 2011 -0400 @@ -1,4 +1,5 @@ from galaxy.eggs import require +from galaxy.web.framework.helpers import to_unicode # Whoosh is compatible with Python 2.5+ Try to import Whoosh and set flag to indicate whether tool search is enabled. try: require( "Whoosh" ) @@ -35,12 +36,6 @@ writer = self.index.writer() ## TODO: would also be nice to search section headers. for id, tool in self.toolbox.tools_by_id.iteritems(): - def to_unicode( a_basestr ): - if type( a_basestr ) is str: - return unicode( a_basestr, 'utf-8' ) - else: - return a_basestr - writer.add_document( id=id, title=to_unicode(tool.name), description=to_unicode(tool.description), help=to_unicode(tool.help) ) writer.commit() --- a/lib/galaxy/web/controllers/root.py Wed Jun 08 11:15:42 2011 -0400 +++ b/lib/galaxy/web/controllers/root.py Wed Jun 08 11:32:55 2011 -0400 @@ -8,6 +8,7 @@ from galaxy.util.sanitize_html import sanitize_html from galaxy.model.orm import * from galaxy.model.item_attrs import UsesAnnotations +from galaxy.web.framework.helpers import to_unicode log = logging.getLogger( __name__ ) @@ -329,7 +330,7 @@ trans.sa_session.flush() if trans.app.config.set_metadata_externally: trans.app.datatypes_registry.set_external_metadata_tool.tool_action.execute( trans.app.datatypes_registry.set_external_metadata_tool, trans, incoming = { 'input1':data }, overwrite = False ) #overwrite is False as per existing behavior - return trans.show_ok_message( "Changed the type of dataset '%s' to %s" % ( data.name, params.datatype ), refresh_frames=['history'] ) + return trans.show_ok_message( "Changed the type of dataset '%s' to %s" % ( to_unicode( data.name ), params.datatype ), refresh_frames=['history'] ) else: return trans.show_error_message( "You are unable to change datatypes in this manner. Changing %s to %s is not allowed." % ( data.extension, params.datatype ) ) elif params.save: --- a/templates/dataset/copy_view.mako Wed Jun 08 11:15:42 2011 -0400 +++ b/templates/dataset/copy_view.mako Wed Jun 08 11:32:55 2011 -0400 @@ -66,7 +66,7 @@ %><div class="form-row"><input type="checkbox" name="source_dataset_ids" id="dataset_${encoded_id}" value="${encoded_id}"${checked}/> - <label for="dataset_${encoded_id}" style="display: inline;font-weight:normal;"> ${data.hid}: ${data.name}</label> + <label for="dataset_${encoded_id}" style="display: inline;font-weight:normal;"> ${data.hid}: ${h.to_unicode(data.name)}</label></div> %endfor %else: 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