X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=inline;f=dak%2Fsplit_done.py;h=98ad9b5fb3ef3050c81411df01851c42d2b4a084;hb=4a95afb08a40a984824f72777ec5c4f8ed8382cd;hp=2fc6c900e8ee92296be34f960a0cbb66522e29fa;hpb=06b17e68fd4a76e7a12f741f26654e55bff05c79;p=dak.git diff --git a/dak/split_done.py b/dak/split_done.py old mode 100644 new mode 100755 index 2fc6c900..98ad9b5f --- a/dak/split_done.py +++ b/dak/split_done.py @@ -1,6 +1,8 @@ #!/usr/bin/env python +""" Split queue/done into date based subdirectories """ # Copyright (C) 2004, 2005, 2006 James Troup +# Copyright (C) 2008 Joerg Jaspert # 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 @@ -19,14 +21,14 @@ ################################################################################ import glob, os, stat, time -import daklib.utils +from daklib import utils ################################################################################ def main(): - Cnf = daklib.utils.get_conf() + Cnf = utils.get_conf() count = 0 - move_date = int(time.time())-(30*84600) + move_date = int(time.time())) os.chdir(Cnf["Dir::Queue::Done"]) files = glob.glob("%s/*" % (Cnf["Dir::Queue::Done"])) for filename in files: @@ -41,7 +43,7 @@ def main(): os.makedirs(dirname) dest = dirname + '/' + os.path.basename(filename) if os.path.exists(dest): - daklib.utils.fubar("%s already exists." % (dest)) + utils.fubar("%s already exists." % (dest)) print "Move: %s -> %s" % (filename, dest) os.rename(filename, dest) count = count + 1