witten
/
luminotes
Archived
1
0
Fork 0

Visually truncating really long filenames.

This commit is contained in:
Dan Helfman 2008-02-25 03:23:50 +00:00
parent 8dee52a9d8
commit e283151a9b
1 changed files with 4 additions and 0 deletions

View File

@ -22,7 +22,11 @@ def stream_progress( uploading_file, filename, fraction_reported ):
<body>
"""
FILENAME_TRUNCATION_WIDTH = 40
base_filename = filename.split( u"/" )[ -1 ].split( u"\\" )[ -1 ]
if len( base_filename ) > FILENAME_TRUNCATION_WIDTH:
base_filename = base_filename[ : FILENAME_TRUNCATION_WIDTH ] + u"..."
yield \
u"""
<div class="field_label">uploading %s: </div>