prettySize() is not used - we are already using the |filesize template

tag, which does the same thing in a much nicer way.
This commit is contained in:
Magnus Hagander
2010-06-17 15:05:11 +02:00
parent bd167b0afa
commit 90f84636bf

View File

@ -4,16 +4,6 @@ from django.conf import settings
from pgweb.util.helpers import template_to_string
def prettySize(size):
if size < 1024:
return "%s bytes" % size
suffixes = [("bytes",2**10), ("KB",2**20), ("MB",2**30), ("GB",2**40), ("TB",2**50)]
for suf, lim in suffixes:
if size > lim:
continue
else:
return "%s %s" % (round(size/float(lim/2**10),2).__str__(),suf)
def sendmail(msg):
pipe = Popen("sendmail -t", shell=True, stdin=PIPE).stdin
pipe.write(msg.as_string())