X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=TLD_Builder%2Frequest.py;h=2e1e7c3d094e951bfe44401bd331e9bbfb68ebb1;hb=98531ab4a0e4e065d3b11b051b3e4bd7653c6ac0;hp=039cf76627cc7821edac766ec19a419a4d8e937a;hpb=92949e17161a53bfb4a60099e22b58ad63abce4c;p=tld-builder.git diff --git a/TLD_Builder/request.py b/TLD_Builder/request.py index 039cf76..2e1e7c3 100644 --- a/TLD_Builder/request.py +++ b/TLD_Builder/request.py @@ -59,7 +59,7 @@ def iso8601(ts, timezone='UTC'): return dt.isoformat() def is_blank(e): - return e.nodeType == Element.TEXT_NODE and string.strip(e.nodeValue) == "" + return e.nodeType == Element.TEXT_NODE and e.nodeValue.strip() == "" class Group: def __init__(self, e): @@ -72,7 +72,7 @@ class Group: self.requester = "" self.max_jobs = 0 self.requester_email = "" - self.flags = string.split(attr(e, "flags", "")) + self.flags = attr(e, "flags", "").split() for c in e.childNodes: if is_blank(c): continue @@ -97,7 +97,7 @@ class Group: deps = [] m[b.b_id] = b for dep in b.depends_on: - if m.has_key(dep): + if dep in m: # avoid self-deps if id(m[dep]) != id(b): deps.append(m[dep]) @@ -206,7 +206,7 @@ class Batch: self.skip = [] self.gb_id = "" self.b_id = attr(e, "id") - self.depends_on = string.split(attr(e, "depends-on")) + self.depends_on = attr(e, "depends-on").split() self.upgraded = True self.parse_xml(e) @@ -233,7 +233,7 @@ class Batch: elif c.nodeName == "command": self.spec = "COMMAND" self.command = text(c).strip() - self.command_flags = string.split(attr(c, "flags", "")) + self.command_flags = attr(c, "flags", "").split() elif c.nodeName == "info": self.info = text(c) elif c.nodeName == "kernel": @@ -378,8 +378,8 @@ class Batch: bld = lin_ar.split('-') tree_name = '-'.join(bld[:-1]) tree_arch = '-'.join(bld[-1:]) - link_pre = "" \ - % (urllib.quote(tree_name), urllib.quote(tree_arch), urllib.quote(bl_name), urllib.quote(rid)) + link_pre = "" \ + % (urllib.quote(tree_name), urllib.quote(tree_arch), urllib.quote(bl_name), urllib.quote(rid)) link_post = "" def ftime(s): @@ -441,7 +441,7 @@ class Batch: ignores = [] # add php version based ignores - if self.defines.has_key('php_suffix'): + if 'php_suffix' in self.defines: # current version if -D php_suffix is present php_version = php_name_to_ver(self.defines['php_suffix']) else: @@ -501,7 +501,7 @@ class Batch: %s %s %s\n""" % (self.b_id, - string.join(list(map(lambda (b): b.b_id, self.depends_on))), + string.join(list(map(lambda b: b.b_id, self.depends_on))), escape(self.src_rpm), escape(' '.join(self.command_flags)), escape(self.command), escape(self.spec), escape(self.branch), escape(self.info))) @@ -516,7 +516,7 @@ class Batch: if self.defines: f.write(" %s\n" % self.defines_xml()) for b in self.builders: - if self.builders_status_buildtime.has_key(b): + if b in self.builders_status_buildtime: t = self.builders_status_buildtime[b] else: t = "0" @@ -578,7 +578,7 @@ class Notification: for r in q.requests: if r.kind == "group": for b in r.batches: - if self.batches.has_key(b.b_id): + if b.b_id in self.batches: b.builders_status[self.builder] = self.batches[b.b_id] b.builders_status_time[self.builder] = time.time() b.builders_status_buildtime[self.builder] = "0" #self.batches_buildtime[b.b_id]