# Utility functions
# Copyright (C) 2000 James Troup <james@nocrew.org>
-# $Id: utils.py,v 1.7 2000-12-05 04:27:48 troup Exp $
+# $Id: utils.py,v 1.9 2000-12-18 07:11:25 troup Exp $
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
def poolify (source, component):
if component != "":
component = component + '/';
+ # FIXME: this is nasty
+ component = string.lower(component);
+ component = string.replace(component, 'non-us/', 'non-US/');
if source[:3] == "lib":
return component + source[:4] + '/' + source + '/'
else:
######################################################################################
+def size_type (c):
+ t = " b";
+ if c > 10000:
+ c = c / 1000;
+ t = " Kb";
+ if c > 10000:
+ c = c / 1000;
+ t = " Mb";
+ return ("%d%s" % (c, t))