Thu May 3 16:18:30 UTC 2007 VMiklos * display the size of the files in tree view diff -rN -u old-darcsweb/darcsweb.cgi new-darcsweb/darcsweb.cgi --- old-darcsweb/darcsweb.cgi 2013-08-26 15:14:37.000000000 +0000 +++ new-darcsweb/darcsweb.cgi 2013-08-26 15:14:37.000000000 +0000 @@ -223,6 +223,14 @@ return ''.join(s) +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) def isbinary(fname): import re @@ -1781,6 +1789,8 @@ fullf = filter_file(dname + '/' + f) print '', fperms(realfile), print '' + print '', fsize(realfile), + print '' if f in dlist: print """