2 # utility functions to support the build farm
3 # Copyright (C) tridge@samba.org, 2001
4 # Copyright (C) Jelmer Vernooij <jelmer@samba.org> 2010
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 """load a list from a file, using : to separate"""
25 for l in f.readlines():
35 def FileLoad(filename):
36 """read a file into a string"""
37 f = open(filename, 'r')
45 """display a time as days, hours, minutes"""
46 days = int(sec / (60*60*24));
47 hour = int(sec / (60*60)) % 24;
48 min = int(sec / 60) % 60;
54 return "%dd %dh %dm" % (days, hour, min)
56 return "%dh %dm" % (hour, min)