X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=utils.py;h=06560355c1448e597c64a4e81f03c9cab491a5e6;hb=e7556dca76d2e8249fb7c8ddb1ce99a3c0211b32;hp=1ad6a4e7762dcc6888b5679a732dae8eca2f566c;hpb=f2f237c936b5d5727c2b70be85cdacd2903c05b2;p=dak.git diff --git a/utils.py b/utils.py index 1ad6a4e7..06560355 100644 --- a/utils.py +++ b/utils.py @@ -2,7 +2,7 @@ # Utility functions # Copyright (C) 2000, 2001, 2002, 2003, 2004 James Troup -# $Id: utils.py,v 1.66 2004-04-03 02:49:46 troup Exp $ +# $Id: utils.py,v 1.68 2004-06-23 23:11:47 troup Exp $ ################################################################################ @@ -327,10 +327,12 @@ switched to 'email (name)' format.""" if not maintainer: return ('', '', '', ''); - if maintainer.find("<") == -1 or (maintainer[0] == "<" and \ - maintainer[-1:] == ">"): + if maintainer.find("<") == -1: email = maintainer; name = ""; + elif (maintainer[0] == "<" and maintainer[-1:] == ">"): + email = maintainer[1:-1]; + name = ""; else: m = re_parse_maintainer.match(maintainer); if not m: @@ -499,13 +501,13 @@ def whoami (): ################################################################################ def size_type (c): - t = " b"; - if c > 10000: - c = c / 1000; - t = " Kb"; - if c > 10000: - c = c / 1000; - t = " Mb"; + t = " B"; + if c > 10240: + c = c / 1024; + t = " KB"; + if c > 10240: + c = c / 1024; + t = " MB"; return ("%d%s" % (c, t)) ################################################################################