details: http://www.bx.psu.edu/hg/galaxy/rev/d98c52439f53 changeset: 3029:d98c52439f53 user: jeremy goecks <jeremy.goecks@emory.edu> date: Fri Nov 13 16:32:36 2009 -0500 description: Cleaned up messages for delete/undelete history/ies. diffstat: lib/galaxy/web/controllers/history.py | 4 ++-- test/base/twilltestcase.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diffs (41 lines): diff -r a0880f1b4297 -r d98c52439f53 lib/galaxy/web/controllers/history.py --- a/lib/galaxy/web/controllers/history.py Fri Nov 13 15:28:22 2009 -0500 +++ b/lib/galaxy/web/controllers/history.py Fri Nov 13 16:32:36 2009 -0500 @@ -262,7 +262,7 @@ n_deleted += 1 status = SUCCESS if n_deleted: - message_parts.append( "Deleted %d histories. " % n_deleted ) + message_parts.append( "Deleted %d %s. " % ( n_deleted, iff( n_deleted != 1, "histories", "history" ) ) ) if deleted_current: message_parts.append( "Your active history was deleted, a new empty history is now active. " ) status = INFO @@ -290,7 +290,7 @@ status = SUCCESS message_parts = [] if n_undeleted: - message_parts.append( "Undeleted %d histories." % n_undeleted ) + message_parts.append( "Undeleted %d %s. " % ( n_undeleted, iff( n_undeleted != 1, "histories", "history" ) ) ) if n_already_purged: message_parts.append( "%d histories have already been purged and cannot be undeleted." % n_already_purged ) status = WARNING diff -r a0880f1b4297 -r d98c52439f53 test/base/twilltestcase.py --- a/test/base/twilltestcase.py Fri Nov 13 15:28:22 2009 -0500 +++ b/test/base/twilltestcase.py Fri Nov 13 16:32:36 2009 -0500 @@ -10,6 +10,7 @@ pkg_resources.require( "elementtree" ) from elementtree import ElementTree from galaxy.web import security +from galaxy.web.framework.helpers import iff buffer = StringIO.StringIO() @@ -180,7 +181,7 @@ num_deleted = len( id.split( ',' ) ) self.home() self.visit_page( "history/list?operation=delete&id=%s" % ( id ) ) - check_str = 'Deleted %d histories' % num_deleted + check_str = 'Deleted %d %s' % ( num_deleted, iff( num_deleted != 1, "histories","history") ) self.check_page_for_string( check_str ) self.home() def delete_current_history( self, check_str='' ):