Visually truncating really long filenames.
This commit is contained in:
parent
8dee52a9d8
commit
e283151a9b
|
@ -22,7 +22,11 @@ def stream_progress( uploading_file, filename, fraction_reported ):
|
||||||
<body>
|
<body>
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
FILENAME_TRUNCATION_WIDTH = 40
|
||||||
base_filename = filename.split( u"/" )[ -1 ].split( u"\\" )[ -1 ]
|
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 \
|
yield \
|
||||||
u"""
|
u"""
|
||||||
<div class="field_label">uploading %s: </div>
|
<div class="field_label">uploading %s: </div>
|
||||||
|
|
Reference in New Issue
Block a user