def log(m):
if not globals.quiet:
- print '\x1b[33m* %s\x1b[0m' % m
+ print('\x1b[33m* %s\x1b[0m' % m)
def scp_escape(n):
s = n.split(':')
s = l.split()
if len(s) == 3 and s[0] == "VERSION":
- print "Writing %s" % version
- print >>o,"VERSION = '%s'" % version
+ print("Writing %s" % version)
+ print("VERSION = '%s'" % version, file=o)
else:
- print >>o,l,
+ print(l, file=o, end="")
f.close()
o.close()
def variables_string(self, escaped_quotes=False):
e = ''
- for k, v in self.variables.iteritems():
+ for k, v in self.variables.items():
if escaped_quotes:
v = v.replace('"', '\\"')
e += '%s=%s ' % (k, v)
if 'option_defaults' in dep.cscript:
options = dep.cscript['option_defaults']()
if len(d) > 2:
- for k, v in d[2].iteritems():
+ for k, v in d[2].items():
options[k] = v
dep.build(options)
one_of = "Command is one of:\n"
summary = ""
- for k, v in commands.iteritems():
+ for k, v in commands.items():
one_of += "\t%s\t%s\n" % (k, v)
summary += k + " "
v = Version(s[2])
if v.micro == 0:
if last is not None and len(changes) > 0:
- print >>html,"<h2>Changes between version %s and %s</h2>" % (s[2], last)
- print >>html,"<ul>"
+ print("<h2>Changes between version %s and %s</h2>" % (s[2], last), file=html)
+ print("<ul>", file=html)
for c in changes:
- print >>html,"<li>%s" % c
- print >>html,"</ul>"
+ print("<li>%s" % c, file=html)
+ print("</ul>", file=html)
last = s[2]
changes = []
versions -= 1
if args.major is None or v.major == args.major:
latest = v
- print latest
+ print(latest)
target.cleanup()
elif globals.command == 'test':
target = SourceTarget()
tree = globals.trees.get(args.project, args.checkout, target)
with TreeDirectory(tree):
- print command_and_read('git rev-parse HEAD').readline().strip()[:7]
+ print(command_and_read('git rev-parse HEAD').readline().strip()[:7])
target.cleanup()
elif globals.command == 'checkout':
try:
main()
except Error as e:
- print >>sys.stderr,'cdist: %s' % str(e)
+ print('cdist: %s' % str(e), file=sys.stderr)
sys.exit(1)