Explicitly using python2 to prevent errors on py3-default systems
This commit is contained in:
parent
6c9bc43bbb
commit
e7ec942256
@ -1,4 +1,4 @@
|
|||||||
add_custom_target(format-diff
|
add_custom_target(format-diff
|
||||||
COMMAND python ${CMAKE_SOURCE_DIR}/dist/format.py)
|
COMMAND python2 ${CMAKE_SOURCE_DIR}/dist/format.py)
|
||||||
add_custom_target(format
|
add_custom_target(format
|
||||||
COMMAND python ${CMAKE_SOURCE_DIR}/dist/format.py -i)
|
COMMAND python2 ${CMAKE_SOURCE_DIR}/dist/format.py -i)
|
||||||
|
2
dist/codesign.py
vendored
2
dist/codesign.py
vendored
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python2
|
||||||
# Emulates the behaviour of codesign --deep which is missing on OS X < 10.9
|
# Emulates the behaviour of codesign --deep which is missing on OS X < 10.9
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
24
dist/copyright.py
vendored
24
dist/copyright.py
vendored
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python2
|
||||||
|
|
||||||
from subprocess import *
|
from subprocess import *
|
||||||
from sys import *
|
from sys import *
|
||||||
@ -6,7 +6,7 @@ from os import rename, remove
|
|||||||
from datetime import *
|
from datetime import *
|
||||||
|
|
||||||
def pretty_years(s):
|
def pretty_years(s):
|
||||||
|
|
||||||
l = list(s)
|
l = list(s)
|
||||||
l.sort()
|
l.sort()
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ def pretty_years(s):
|
|||||||
if x == prev + 1:
|
if x == prev + 1:
|
||||||
prev = x
|
prev = x
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if prev == start:
|
if prev == start:
|
||||||
r.append("%i" % prev)
|
r.append("%i" % prev)
|
||||||
else:
|
else:
|
||||||
@ -41,10 +41,10 @@ def pretty_years(s):
|
|||||||
return ", ".join(r)
|
return ", ".join(r)
|
||||||
|
|
||||||
def order_by_year(a, b):
|
def order_by_year(a, b):
|
||||||
|
|
||||||
la = list(a[2])
|
la = list(a[2])
|
||||||
la.sort()
|
la.sort()
|
||||||
|
|
||||||
lb = list(b[2])
|
lb = list(b[2])
|
||||||
lb.sort()
|
lb.sort()
|
||||||
|
|
||||||
@ -60,9 +60,9 @@ def gen_copyrights(f):
|
|||||||
commits = []
|
commits = []
|
||||||
data = {}
|
data = {}
|
||||||
copyrights = []
|
copyrights = []
|
||||||
|
|
||||||
for ln in Popen(["git", "blame", "--incremental", f], stdout=PIPE).stdout:
|
for ln in Popen(["git", "blame", "--incremental", f], stdout=PIPE).stdout:
|
||||||
|
|
||||||
if ln.startswith("filename "):
|
if ln.startswith("filename "):
|
||||||
if len(data) > 0:
|
if len(data) > 0:
|
||||||
commits.append(data)
|
commits.append(data)
|
||||||
@ -110,7 +110,7 @@ def gen_copyrights(f):
|
|||||||
if a[1] == b[1]:
|
if a[1] == b[1]:
|
||||||
a[2].update(b[2])
|
a[2].update(b[2])
|
||||||
|
|
||||||
if by_author.has_key(an) and by_author.has_key(bn):
|
if by_author.has_key(an) and by_author.has_key(bn):
|
||||||
del by_author[bn]
|
del by_author[bn]
|
||||||
|
|
||||||
copyright = list(by_author.itervalues())
|
copyright = list(by_author.itervalues())
|
||||||
@ -129,7 +129,7 @@ def change_file(filename):
|
|||||||
content=fi.readlines()
|
content=fi.readlines()
|
||||||
|
|
||||||
copyrights=gen_copyrights(filename)
|
copyrights=gen_copyrights(filename)
|
||||||
|
|
||||||
if -1 == content[0].find("/* This file is part of Clementine."):
|
if -1 == content[0].find("/* This file is part of Clementine."):
|
||||||
print("File {} have no Clementine copyright info".format(filename))
|
print("File {} have no Clementine copyright info".format(filename))
|
||||||
return 0
|
return 0
|
||||||
@ -141,16 +141,16 @@ def change_file(filename):
|
|||||||
if not extended:
|
if not extended:
|
||||||
out.extend(copyrights)
|
out.extend(copyrights)
|
||||||
extended = 1
|
extended = 1
|
||||||
|
|
||||||
if not ends:
|
if not ends:
|
||||||
continue
|
continue
|
||||||
else:
|
else:
|
||||||
out.append(i)
|
out.append(i)
|
||||||
|
|
||||||
with open(filename+'_tmp', "w") as fi:
|
with open(filename+'_tmp', "w") as fi:
|
||||||
fi.writelines(out)
|
fi.writelines(out)
|
||||||
rename(filename+'_tmp', filename)
|
rename(filename+'_tmp', filename)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
for files in argv[1:]:
|
for files in argv[1:]:
|
||||||
|
4
dist/cpplint.py
vendored
4
dist/cpplint.py
vendored
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python2
|
||||||
#
|
#
|
||||||
# Copyright (c) 2009 Google Inc. All rights reserved.
|
# Copyright (c) 2009 Google Inc. All rights reserved.
|
||||||
#
|
#
|
||||||
@ -4646,7 +4646,7 @@ def CheckLanguage(filename, clean_lines, linenum, file_extension,
|
|||||||
|
|
||||||
# Make Windows paths like Unix.
|
# Make Windows paths like Unix.
|
||||||
fullname = os.path.abspath(filename).replace('\\', '/')
|
fullname = os.path.abspath(filename).replace('\\', '/')
|
||||||
|
|
||||||
# Perform other checks now that we are sure that this is not an include line
|
# Perform other checks now that we are sure that this is not an include line
|
||||||
CheckCasts(filename, clean_lines, linenum, error)
|
CheckCasts(filename, clean_lines, linenum, error)
|
||||||
CheckGlobalStatic(filename, clean_lines, linenum, error)
|
CheckGlobalStatic(filename, clean_lines, linenum, error)
|
||||||
|
2
dist/format.py
vendored
2
dist/format.py
vendored
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python
|
#!/usr/bin/env python2
|
||||||
import argparse
|
import argparse
|
||||||
import difflib
|
import difflib
|
||||||
import os
|
import os
|
||||||
|
2
dist/macdeploy.py
vendored
2
dist/macdeploy.py
vendored
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/python
|
#!/usr/bin/python2
|
||||||
|
|
||||||
# This file is part of Clementine.
|
# This file is part of Clementine.
|
||||||
#
|
#
|
||||||
|
1
dist/update_desktop_languages.py
vendored
1
dist/update_desktop_languages.py
vendored
@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/python2
|
||||||
import codecs
|
import codecs
|
||||||
import glob
|
import glob
|
||||||
import logging
|
import logging
|
||||||
|
1
dist/versionnumbers.py
vendored
1
dist/versionnumbers.py
vendored
@ -1,3 +1,4 @@
|
|||||||
|
#!/usr/bin/python2
|
||||||
import rpm
|
import rpm
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user