Only check path.size if file.

Now that pathclass returns size for dirs as well, but that's not
necessary here.
This commit is contained in:
Ethan Dalool 2020-03-19 17:35:52 -07:00
parent f4dab12bf1
commit 5022257817

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): def table_row(path, display_name=None, shaded=False):
form = '<tr style="background-color:#{bg}"><td style="">{anchor}</td><td>{size}</td></tr>' form = '<tr style="background-color:#{bg}"><td style="">{anchor}</td><td>{size}</td></tr>'
size = path.size if path.is_file:
if size is None: size = bytestring.bytestring(path.size)
size = ''
else: else:
size = bytestring.bytestring(size) size = ''
bg = 'ddd' if shaded else 'fff' bg = 'ddd' if shaded else 'fff'