Fix size_string; this would have thrown an exception on being called due to an unimported 'util'.

This commit is contained in:
Dannon Baker
2014-12-03 09:24:44 -05:00
parent d1cde6b943
commit dfc4e52fd3
+2 -2
View File
@@ -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 ''