display the size of the files in tree view
Thu May 3 16:18:30 UTC 2007 VMiklos <vmiklos@frugalware.org>
* display the size of the files in tree view
{
hunk ./darcsweb.cgi 226
+def fsize(fname):
+ s = os.stat(fname)[stat.ST_SIZE]
+ if s < 1024:
+ return "%s" % s
+ elif s < 1048576:
+ return "%sK" % (s / 1024)
+ elif s < 1073741824:
+ return "%sM" % (s / 1048576)
hunk ./darcsweb.cgi 1792
+ print '<td style="font-family:monospace">', fsize(realfile),
+ print '</td>'
}