# Utility functions
# Copyright (C) 2000, 2001, 2002, 2003, 2004 James Troup <james@nocrew.org>
-# $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 $
################################################################################
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:
################################################################################
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))
################################################################################