From dfc4e52fd3fbff3add8dfd919425dcd1e3734cac Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 3 Dec 2014 09:24:44 -0500 Subject: [PATCH] Fix size_string; this would have thrown an exception on being called due to an unimported 'util'. --- lib/tool_shed/util/basic_util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tool_shed/util/basic_util.py b/lib/tool_shed/util/basic_util.py index 11d2895cedd..60c7d2ca570 100644 --- a/lib/tool_shed/util/basic_util.py +++ b/lib/tool_shed/util/basic_util.py @@ -4,7 +4,7 @@ import shutil import sys from string import Template -from galaxy.util import unicodify +from galaxy.util import unicodify, nice_size from galaxy import eggs @@ -115,7 +115,7 @@ def remove_dir( dir ): def size_string( raw_text, size=MAX_DISPLAY_SIZE ): """Return a subset of a string (up to MAX_DISPLAY_SIZE) translated to a safe string for display in a browser.""" if raw_text and len( raw_text ) >= size: - large_str = '\nFile contents truncated because file size is larger than maximum viewing size of %s\n' % util.nice_size( size ) + large_str = '\nFile contents truncated because file size is larger than maximum viewing size of %s\n' % nice_size( size ) raw_text = '%s%s' % ( raw_text[ 0:size ], large_str ) return raw_text or ''