commit/galaxy-central: 2 new changesets
2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/changeset/af13620fe935/ changeset: af13620fe935 user: dan date: 2012-08-29 19:50:31 summary: Have form_builder class's get_html methods return unicode. affected #: 1 file diff -r 068a043f6bb17b4faa3e171ca244029fdd66bbfe -r af13620fe9353bf8cfc243e0a2981a949b284523 lib/galaxy/web/form_builder.py --- a/lib/galaxy/web/form_builder.py +++ b/lib/galaxy/web/form_builder.py @@ -4,7 +4,7 @@ import logging, sys, os, time from cgi import escape -from galaxy.util import restore_text, relpath, nice_size +from galaxy.util import restore_text, relpath, nice_size, unicodify from galaxy.web import url_for from binascii import hexlify @@ -34,8 +34,8 @@ self.size = int( size or 10 ) self.value = value or "" def get_html( self, prefix="", disabled=False ): - return '<input type="text" name="%s%s" size="%d" value="%s"%s>' \ - % ( prefix, self.name, self.size, escape( str( self.value ), quote=True ), self.get_disabled_str( disabled ) ) + return unicodify( '<input type="text" name="%s%s" size="%d" value="%s"%s>' \ + % ( prefix, self.name, self.size, escape( str( self.value ), quote=True ), self.get_disabled_str( disabled ) ) ) def set_size(self, size): self.size = int( size ) @@ -53,8 +53,8 @@ self.size = int( size or 10 ) self.value = value or "" def get_html( self, prefix="", disabled=False ): - return '<input type="password" name="%s%s" size="%d" value="%s"%s>' \ - % ( prefix, self.name, self.size, escape( str( self.value ), quote=True ), self.get_disabled_str( disabled ) ) + return unicodify( '<input type="password" name="%s%s" size="%d" value="%s"%s>' \ + % ( prefix, self.name, self.size, escape( str( self.value ), quote=True ), self.get_disabled_str( disabled ) ) ) def set_size(self, size): self.size = int( size ) @@ -74,8 +74,8 @@ self.cols = int(self.size[-1]) self.value = value or "" def get_html( self, prefix="", disabled=False ): - return '<textarea name="%s%s" rows="%d" cols="%d"%s>%s</textarea>' \ - % ( prefix, self.name, self.rows, self.cols, self.get_disabled_str( disabled ), escape( str( self.value ), quote=True ) ) + return unicodify( '<textarea name="%s%s" rows="%d" cols="%d"%s>%s</textarea>' \ + % ( prefix, self.name, self.rows, self.cols, self.get_disabled_str( disabled ), escape( str( self.value ), quote=True ) ) ) def set_size(self, rows, cols): self.rows = rows self.cols = cols @@ -111,8 +111,8 @@ # parsing the request, the value 'true' in the hidden field actually means it is NOT checked. # See the is_checked() method below. The prefix is necessary in each case to ensure functional # correctness when the param is inside a conditional. - return '<input type="checkbox" id="%s" name="%s" value="true"%s%s%s><input type="hidden" name="%s%s" value="true"%s>' \ - % ( id_name, id_name, checked_text, self.get_disabled_str( disabled ), self.refresh_on_change_text, prefix, self.name, self.get_disabled_str( disabled ) ) + return unicodify( '<input type="checkbox" id="%s" name="%s" value="true"%s%s%s><input type="hidden" name="%s%s" value="true"%s>' \ + % ( id_name, id_name, checked_text, self.get_disabled_str( disabled ), self.refresh_on_change_text, prefix, self.name, self.get_disabled_str( disabled ) ) ) @staticmethod def is_checked( value ): if value == True: @@ -148,7 +148,7 @@ ajax_text = "" if self.ajax: ajax_text = ' galaxy-ajax-upload="true"' - return '<input type="file" name="%s%s"%s%s>' % ( prefix, self.name, ajax_text, value_text ) + return unicodify( '<input type="file" name="%s%s"%s%s>' % ( prefix, self.name, ajax_text, value_text ) ) class FTPFileField(BaseField): """ @@ -223,7 +223,7 @@ self.name = name self.value = value or "" def get_html( self, prefix="" ): - return '<input type="hidden" name="%s%s" value="%s">' % ( prefix, self.name, escape( str( self.value ), quote=True ) ) + return unicodify( '<input type="hidden" name="%s%s" value="%s">' % ( prefix, self.name, escape( str( self.value ), quote=True ) ) ) class SelectField(BaseField): """ @@ -308,7 +308,7 @@ rval.append( '<div%s><input type="checkbox" name="%s%s" value="%s" id="%s"%s%s><label class="inline" for="%s">%s</label></div>' % \ ( style, prefix, self.name, escaped_value, uniq_id, selected_text, self.get_disabled_str( disabled ), uniq_id, escape( str( text ), quote=True ) ) ) ctr += 1 - return "\n".join( rval ) + return unicodify( "\n".join( rval ) ) def get_html_radio( self, prefix="", disabled=False ): rval = [] ctr = 0 @@ -333,7 +333,7 @@ uniq_id, text ) ) ctr += 1 - return "\n".join( rval ) + return unicodify( "\n".join( rval ) ) def get_html_default( self, prefix="", disabled=False ): if self.multiple: multiple = " multiple" @@ -357,7 +357,7 @@ rval.insert( 0, '<select name="%s%s"%s%s%s%s%s>' % \ ( prefix, self.name, multiple, size, self.refresh_on_change_text, last_selected_value, self.get_disabled_str( disabled ) ) ) rval.append( '</select>' ) - return "\n".join( rval ) + return unicodify( "\n".join( rval ) ) def get_selected( self, return_label=False, return_value=False, multi=False ): ''' Return the currently selected option's label, value or both as a tuple. For @@ -513,7 +513,7 @@ find_expanded_options( expanded_options, self.options ) recurse_options( rval, self.options, drilldown_id, expanded_options ) rval.append( '</div>' ) - return '\n'.join( rval ) + return unicodify( '\n'.join( rval ) ) class AddressField(BaseField): @staticmethod @@ -688,8 +688,8 @@ else: ldda_ids = "||".join( [ self.trans.security.encode_id( ldda.id ) for ldda in self.lddas ] ) text = "<br />".join( [ "%s. %s" % (i+1, ldda.name) for i, ldda in enumerate(self.lddas)] ) - return '<a href="javascript:void(0);" class="add-librarydataset">%s</a> \ - <input type="hidden" name="%s%s" value="%s">' % ( text, prefix, self.name, escape( str(ldda_ids), quote=True ) ) + return unicodify( '<a href="javascript:void(0);" class="add-librarydataset">%s</a> \ + <input type="hidden" name="%s%s" value="%s">' % ( text, prefix, self.name, escape( str(ldda_ids), quote=True ) ) ) def get_display_text(self): if self.ldda: https://bitbucket.org/galaxy/galaxy-central/changeset/61a2c343081f/ changeset: 61a2c343081f user: dan date: 2012-08-29 19:50:32 summary: Unicode fixes for running and extracting workflows. affected #: 2 files diff -r af13620fe9353bf8cfc243e0a2981a949b284523 -r 61a2c343081f2dc194caaacb3c379392353caa7a templates/workflow/build_from_current_history.mako --- a/templates/workflow/build_from_current_history.mako +++ b/templates/workflow/build_from_current_history.mako @@ -78,7 +78,7 @@ <form method="post" action="${h.url_for()}"><div class='form-row'><label>${_('Workflow name')}</label> - <input name="workflow_name" type="text" value="Workflow constructed from history '${history.name}'" size="60"/> + <input name="workflow_name" type="text" value="Workflow constructed from history '${ util.unicodify( history.name )}'" size="60"/></div><p><input type="submit" value="${_('Create Workflow')}" /> diff -r af13620fe9353bf8cfc243e0a2981a949b284523 -r 61a2c343081f2dc194caaacb3c379392353caa7a templates/workflow/run_complete.mako --- a/templates/workflow/run_complete.mako +++ b/templates/workflow/run_complete.mako @@ -1,7 +1,7 @@ <%inherit file="/base.mako"/><div class="donemessagelarge"> - Successfully ran workflow "${workflow.name}". The following datasets have been added to the queue: + Successfully ran workflow "${util.unicodify( workflow.name )}". The following datasets have been added to the queue: %for invocation in invocations: <div class="workflow-invocation-complete"> %if invocation['new_history']: @@ -14,7 +14,7 @@ %for step_outputs in invocation['outputs'].itervalues(): %for data in step_outputs.itervalues(): %if not invocation['new_history'] or data.history == invocation['new_history']: - <p><strong>${data.hid}</strong>: ${data.name}</p> + <p><strong>${data.hid}</strong>: ${util.unicodify( data.name )}</p> %endif %endfor %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)
-
Bitbucket