from __future__ import print_function

This commit is contained in:
j 2014-09-30 22:57:36 +02:00
parent cb78624a92
commit 2ba2903dbc

View file

@ -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()