X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=TLD_Builder%2Frequest_handler.py;h=74c7f1c4d5de3b58082e90eede2ef80b85c0526c;hb=1b7332b1eeedc313bbef96e41ec44925d86cc96d;hp=033cf39d8760b4c605db7a478a04be9beaedbd4e;hpb=b999f53d4bf5d44586ecf028876e8bc20b5fd2ce;p=tld-builder.git diff --git a/TLD_Builder/request_handler.py b/TLD_Builder/request_handler.py index 033cf39..74c7f1c 100644 --- a/TLD_Builder/request_handler.py +++ b/TLD_Builder/request_handler.py @@ -4,10 +4,8 @@ import email import string import time import os -import StringIO import sys import fnmatch - import gpg import request import log @@ -26,7 +24,7 @@ def check_double_id(id): id_nl = id + "\n" ids = open(path.processed_ids_file) - for i in ids.xreadlines(): + for i in ids: if i == id_nl: # FIXME: security email here? log.alert("request %s already processed" % id) @@ -100,7 +98,7 @@ def handle_group(r, user): batch.builders_status_time[bld] = time.time() if bld not in config.binary_builders and bld != config.builder: fail_mail("I (src rpm builder '%s') do not handle binary builder '%s', only '%s'" % \ - (config.builder, bld, string.join(config.binary_builders))) + (config.builder, bld, ' '.join(config.binary_builders))) lockf.close() return if batch.is_command(): @@ -155,7 +153,7 @@ def handle_notification(r, user): q = B_Queue(path.req_queue_file) q.lock(0) q.read() - not_fin = filter(lambda (r): not r.is_done(), q.requests) + not_fin = list(filter(lambda r: not r.is_done(), q.requests)) r.apply_to(q) for r in not_fin: if r.is_done(): @@ -170,7 +168,7 @@ def handle_notification(r, user): util.clean_tmp(path.srpms_dir + '/' + r.id) return False return True - q.requests = filter(leave_it, q.requests) + q.requests = list(filter(leave_it, q.requests)) q.write() q.dump(path.queue_stats_file) q.dump_html(path.queue_html_stats_file)