From 2ba2903dbc369db57c9da27bb2cf78c76dd775f1 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Tue, 30 Sep 2014 22:57:36 +0200 Subject: [PATCH] from __future__ import print_function --- tools/build/build.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/tools/build/build.py b/tools/build/build.py index d7d980b4..bd810b03 100755 --- a/tools/build/build.py +++ b/tools/build/build.py @@ -1,6 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- #vim: et:ts=4:sw=4:sts=4 +from __future__ import print_function import json import os @@ -17,9 +18,9 @@ def get_version(): revision = subprocess.Popen( ['git', 'rev-list', 'HEAD', '--count'], stdout=subprocess.PIPE ).communicate()[0].strip() - print revision + print(revision) revision = int(revision) - 94 - print revision + print(revision) else: revision = subprocess.Popen( ['bzr', 'revno'], stdout=subprocess.PIPE @@ -302,7 +303,7 @@ def build_oxjs(downloads=False, geo=False): def copy_file(source, target): - print 'copying', source, 'to', target + print('copying', source, 'to', target) write_file(target, read_file(source)) def filter_min(tarinfo): @@ -354,7 +355,7 @@ def parse_css(css, values): return re.sub('\$(\w+)(\[\d+\])?', sub, css) def read_file(file): - print 'reading', file + print('reading', file) f = open(file) data = f.read() f.close() @@ -364,7 +365,7 @@ def read_jsonc(file): return ox.jsonc.loads(read_file(file)) def write_file(file, data): - print 'writing', file + print('writing', file) write_path(file) f = open(file, 'w') f.write(data) @@ -372,7 +373,7 @@ def write_file(file, data): return len(data) def write_link(source, target): - print 'linking', source, 'to', target + print('linking', source, 'to', target) write_path(target) # remove files, symlinks *and broken symlinks* if os.path.exists(target) or os.path.lexists(target): @@ -388,7 +389,7 @@ def write_path(file): os.makedirs(path) def write_tarfile(file, path, arcname, filter): - print 'writing', file + print('writing', file) f = tarfile.open(file, 'w:gz') f.add(path, arcname=arcname, filter=filter) f.close()