mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Fix size_string; this would have thrown an exception on being called due to an unimported 'util'.
This commit is contained in:
@@ -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 ''
|
||||
|
||||
|
||||
Reference in New Issue
Block a user