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):
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
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])
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)
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":
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:
<spec>%s</spec>
<branch>%s</branch>
<info>%s</info>\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)))
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"
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]