Fix failures with latest gpylint
Change-Id: Id80000b530b0582b907730db9311075a7f5307fa
This commit is contained in:
parent
98a9d1baf6
commit
1b262b5784
|
@ -30,6 +30,8 @@ Step 1 is only required if there is any gyp file change. Otherwise, you
|
||||||
may just run ninja.
|
may just run ninja.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -108,7 +110,7 @@ if __name__ == '__main__':
|
||||||
else:
|
else:
|
||||||
os.environ['GYP_GENERATOR_FLAGS'] = gyp_generator_flags
|
os.environ['GYP_GENERATOR_FLAGS'] = gyp_generator_flags
|
||||||
|
|
||||||
print 'Updating projects from gyp files...'
|
print('Updating projects from gyp files...')
|
||||||
sys.stdout.flush()
|
sys.stdout.flush()
|
||||||
|
|
||||||
# Off we go...
|
# Off we go...
|
||||||
|
|
|
@ -623,7 +623,13 @@ class PackagerFunctionalTest(PackagerAppTest):
|
||||||
self.assertEqual(self.packager.MpdGenerator(flags), 0)
|
self.assertEqual(self.packager.MpdGenerator(flags), 0)
|
||||||
|
|
||||||
def testVersion(self):
|
def testVersion(self):
|
||||||
self.assertRegexpMatches(
|
# To support python version 2, which does not have assertRegex.
|
||||||
|
if 'assertRegex' not in dir(self):
|
||||||
|
assert_regex = self.assertRegexpMatches
|
||||||
|
else:
|
||||||
|
assert_regex = self.assertRegex
|
||||||
|
|
||||||
|
assert_regex(
|
||||||
self.packager.Version(), '^packager(.exe)? version '
|
self.packager.Version(), '^packager(.exe)? version '
|
||||||
r'((?P<tag>[\w\.]+)-)?(?P<hash>[a-f\d]+)-(debug|release)[\r\n]+.*$')
|
r'((?P<tag>[\w\.]+)-)?(?P<hash>[a-f\d]+)-(debug|release)[\r\n]+.*$')
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,8 @@ Steps to install clang-format on your system if you don't have it already:
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
@ -49,8 +51,10 @@ if __name__ == '__main__':
|
||||||
if output not in [
|
if output not in [
|
||||||
'no modified files to format\n', 'clang-format did not modify any files\n'
|
'no modified files to format\n', 'clang-format did not modify any files\n'
|
||||||
]:
|
]:
|
||||||
print output, '\n'
|
print(output)
|
||||||
print 'Code style is not correct. Please run ', ' '.join(command), '\n'
|
print()
|
||||||
|
print('Code style is not correct. Please run {}.'.format(' '.join(command)))
|
||||||
|
print()
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
else:
|
else:
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
"""A utility to parse and generate PSSH boxes."""
|
"""A utility to parse and generate PSSH boxes."""
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
import base64
|
import base64
|
||||||
import itertools
|
import itertools
|
||||||
|
@ -419,13 +421,13 @@ def main(all_args):
|
||||||
|
|
||||||
if output_format == 'human' or not output_format:
|
if output_format == 'human' or not output_format:
|
||||||
for box in boxes:
|
for box in boxes:
|
||||||
print box.human_string()
|
print(box.human_string())
|
||||||
else:
|
else:
|
||||||
box_data = ''.join([x.binary_string() for x in boxes])
|
box_data = ''.join([x.binary_string() for x in boxes])
|
||||||
if output_format == 'hex':
|
if output_format == 'hex':
|
||||||
print base64.b16encode(box_data)
|
print(base64.b16encode(box_data))
|
||||||
else:
|
else:
|
||||||
print base64.b64encode(box_data)
|
print(base64.b64encode(box_data))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
# https://developers.google.com/open-source/licenses/bsd
|
# https://developers.google.com/open-source/licenses/bsd
|
||||||
"""This script is used to generate version string for packager."""
|
"""This script is used to generate version string for packager."""
|
||||||
|
|
||||||
|
from __future__ import print_function
|
||||||
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
# To support python version before 2.7, which does not have
|
# To support python version before 2.7, which does not have
|
||||||
|
@ -47,6 +49,6 @@ if __name__ == '__main__':
|
||||||
version_hash = 'unknown-version'
|
version_hash = 'unknown-version'
|
||||||
|
|
||||||
if version_tag:
|
if version_tag:
|
||||||
print '{0}-{1}'.format(version_tag, version_hash)
|
print('{0}-{1}'.format(version_tag, version_hash))
|
||||||
else:
|
else:
|
||||||
print version_hash
|
print(version_hash)
|
||||||
|
|
Loading…
Reference in New Issue