f = open(file)
r = {'_file': file[:-5], '_desc': file}
rx = re.compile(r"^([^:]+)\s*:(.*)$")
- for l in f.xreadlines():
+ for l in f:
if l == "END\n":
f.close()
return r
p = open(path.rsync_password_file, "r")
password = ""
- for l in p.xreadlines():
+ for l in p:
l = string.split(l)
if len(l) >= 2 and l[0] == host:
password = l[1]
req.add_header('X-Filename', os.path.basename(src))
f = urllib2.urlopen(req)
f.close()
- except Exception, e:
+ except Exception as e:
problems[src] = e
return e
return 0
if m:
return not post_file(src, target)
log.alert("unsupported protocol: %s" % target)
- except OSError, e:
+ except OSError as e:
problems[src] = e
log.error("send_file(%s, %s): %s" % (src, target, e))
return False
emails = {}
emails[config.admin_email] = 1
pr = ""
- for src, msg in problems.iteritems():
+ for src, msg in problems.items():
pr = pr + "[src: %s]\n\n%s\n" % (src, msg)
for d in remaining:
if d.has_key('Requester'):