Only check path.size if file.

Now that pathclass returns size for dirs as well, but that's not
necessary here.
master
Ethan Dalool 2020-03-19 17:35:52 -07:00
parent f4dab12bf1
commit 5022257817
1 changed files with 3 additions and 4 deletions

View File

@ -362,11 +362,10 @@ def read_filebytes(path, range_min=None, range_max=None):
def table_row(path, display_name=None, shaded=False):
form = '<tr style="background-color:#{bg}"><td style="">{anchor}</td><td>{size}</td></tr>'
size = path.size
if size is None:
size = ''
if path.is_file:
size = bytestring.bytestring(path.size)
else:
size = bytestring.bytestring(size)
size = ''
bg = 'ddd' if shaded else 'fff'