2 new commits in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/fa8c49787330/ Changeset: fa8c49787330 User: dan Date: 2013-08-23 15:07:28 Summary: Fix for ToolParameterValueWrapper.get_display_text() due to inconsistent behavior between Python2.7 and lower for empty strings. expected quoted empty string: $ python2.7 Python 2.7.5 (default, Aug 1 2013, 00:59:24) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import pipes print pipes.quote('') '' repr( pipes.quote('') ) '"\'\'"'
python < 2.7: $ python2.6 Python 2.6.1 (r261:67515, Aug 2 2010, 20:10:18) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import pipes print pipes.quote('')
repr( pipes.quote('') ) "''"
Affected #: 1 file
diff -r c0073a8c820c43b419dfdcc8d88ba157e214f610 -r fa8c4978733072137f708190e65d46c6cb616b0b lib/galaxy/tools/__init__.py --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -3284,7 +3284,14 @@ def __nonzero__( self ): return bool( self.value ) def get_display_text( self, quote=True ): - return pipes.quote( self.input.value_to_display_text( self.value, self.input.tool.app ) ) + """ + Returns a string containing the value that would be displayed to the user in the tool interface. + When quote is True (default), the string is escaped for e.g. command-line usage. + """ + rval = self.input.value_to_display_text( self.value, self.input.tool.app ) or '' + if quote: + return pipes.quote( rval ) or "''" #pipes.quote in Python < 2.7 returns an empty string instead of the expected quoted empty string + return rval class RawObjectWrapper( ToolParameterValueWrapper ): """ https://bitbucket.org/galaxy/galaxy-central/commits/de04c251c6ca/ Changeset: de04c251c6ca Branch: stable User: dan Date: 2013-08-23 15:07:28 Summary: Fix for ToolParameterValueWrapper.get_display_text() due to inconsistent behavior between Python2.7 and lower for empty strings. expected quoted empty string: $ python2.7 Python 2.7.5 (default, Aug 1 2013, 00:59:24) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import pipes print pipes.quote('') '' repr( pipes.quote('') ) '"\'\'"'
python < 2.7: $ python2.6 Python 2.6.1 (r261:67515, Aug 2 2010, 20:10:18) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type "help", "copyright", "credits" or "license" for more information.
import pipes print pipes.quote('')
repr( pipes.quote('') ) "''"
Affected #: 1 file
diff -r 29ab5a6d75a778cd4989adf881c47916607b9acb -r de04c251c6cae5760fd13c83030a6aab78ae0c4e lib/galaxy/tools/__init__.py --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -3258,7 +3258,14 @@ def __nonzero__( self ): return bool( self.value ) def get_display_text( self, quote=True ): - return pipes.quote( self.input.value_to_display_text( self.value, self.input.tool.app ) ) + """ + Returns a string containing the value that would be displayed to the user in the tool interface. + When quote is True (default), the string is escaped for e.g. command-line usage. + """ + rval = self.input.value_to_display_text( self.value, self.input.tool.app ) or '' + if quote: + return pipes.quote( rval ) or "''" #pipes.quote in Python < 2.7 returns an empty string instead of the expected quoted empty string + return rval class RawObjectWrapper( ToolParameterValueWrapper ): """ 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.