Changeset 271151 in webkit
- Timestamp:
- Jan 5, 2021, 9:59:56 AM (4 years ago)
- Location:
- trunk/Tools
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified trunk/Tools/ChangeLog ¶
r271147 r271151 1 2021-01-05 Alexey Proskuryakov <ap@apple.com> 2 3 Update root level scripts in Tools/Scripts to Python 3 4 https://bugs.webkit.org/show_bug.cgi?id=220200 5 6 Reviewed by Darin Adler and Jonathan Bedard. 7 8 Mostly 2to3 inspired. 9 10 * Scripts/check-for-global-bss-symbols-in-webkitgtk-libs: 11 * Scripts/check-for-invalid-symbols-in-version-script: 12 * Scripts/check-for-platform-layering-violations: 13 * Scripts/clean-webkit: 14 * Scripts/compare-results: 15 * Scripts/compare-webkit-configurations: 16 * Scripts/download-github-release.py: 17 * Scripts/dump-webkit-tests-run: 18 * Scripts/export-w3c-performance-wg-tests: 19 * Scripts/extract-dependencies-from-makefile: 20 * Scripts/extract-localizable-strings: 21 * Scripts/find-duplicate-files: 22 * Scripts/ic-stats.py: 23 * Scripts/import-w3c-performance-wg-tests: 24 * Scripts/make-dist: 25 * Scripts/malloc-tree: 26 * Scripts/mark-jsc-stress-test: 27 * Scripts/open-layout-test: 28 * Scripts/read-checksum-from-png: 29 * Scripts/rebase-patch-after-webkit-move: 30 * Scripts/run-gtk-tests: 31 * Scripts/run-webdriver-tests: 32 * Scripts/run-wpe-tests: 33 * Scripts/sampstat: 34 * Scripts/sync-feature-defines: 35 * Scripts/sync-master-with-upstream: 36 * Scripts/update-wasm-gcc-torture.py: 37 * Scripts/validate-committer-lists: 38 1 39 2021-01-05 Youenn Fablet <youenn@apple.com> 2 40 -
TabularUnified trunk/Tools/Scripts/check-for-global-bss-symbols-in-webkitgtk-libs ¶
r270583 r271151 20 20 21 21 if len(sys.argv) < 3: 22 print "Usage: %s lib1 lib2" % sys.argv[0]22 print("Usage: %s lib1 lib2" % sys.argv[0]) 23 23 sys.exit(1) 24 24 … … 32 32 33 33 if symbols: 34 print 'The following symbols are global in %s and not in %s' % (sys.argv[1], sys.argv[2])35 print '\n'.join(sorted(symbols))34 print('The following symbols are global in %s and not in %s' % (sys.argv[1], sys.argv[2])) 35 print('\n'.join(sorted(symbols))) 36 36 sys.exit(1) 37 37 -
TabularUnified trunk/Tools/Scripts/check-for-invalid-symbols-in-version-script ¶
r227057 r271151 21 21 22 22 if len(sys.argv) < 3: 23 print "Usage: %s script lib" % sys.argv[0]23 print("Usage: %s script lib" % sys.argv[0]) 24 24 sys.exit(1) 25 25 … … 35 35 36 36 if symbols: 37 print 'The following symbols are in version script %s and not in library %s' % (sys.argv[1], sys.argv[2])38 print '\n'.join(sorted(symbols))37 print('The following symbols are in version script %s and not in library %s' % (sys.argv[1], sys.argv[2])) 38 print('\n'.join(sorted(symbols))) 39 39 sys.exit(1) 40 40 -
TabularUnified trunk/Tools/Scripts/check-for-platform-layering-violations ¶
r178167 r271151 54 54 55 55 if header not in platform_headers and header not in PLATFORM_GENERATED_HEADERS: 56 print "ERROR: %s:%d %s" % (source_file[len(checkout_root) + 1:], line_count, line.strip('\n'))56 print("ERROR: %s:%d %s" % (source_file[len(checkout_root) + 1:], line_count, line.strip('\n'))) 57 57 failures_found += 1 58 58 … … 74 74 75 75 if layering_violations_count: 76 print "Total: %d layering violations found in %s" % (layering_violations_count, platform_dir[len(checkout_root) + 1:])76 print("Total: %d layering violations found in %s" % (layering_violations_count, platform_dir[len(checkout_root) + 1:])) 77 77 sys.exit(1) 78 78 -
TabularUnified trunk/Tools/Scripts/clean-webkit ¶
r266456 r271151 67 67 files = listWebKitBuildFiles(fs) 68 68 keepDirs = usesFlatpak() and ["Toolchains", "UserFlatpak"] or ["DependenciesGTK", "DependenciesWPE"] 69 files = filter(lambda path: path[len("WebKitBuild/"):] not in keepDirs, files)69 files = [path for path in files if path[len("WebKitBuild/"):] not in keepDirs] 70 70 removeFiles(fs, files) 71 71 else: -
TabularUnified trunk/Tools/Scripts/compare-results ¶
r263629 r271151 37 37 from scipy import stats 38 38 except: 39 print "ERROR: scipy package is not installed. Run `pip install scipy`"39 print("ERROR: scipy package is not installed. Run `pip install scipy`") 40 40 sys.exit(1) 41 41 … … 43 43 import numpy 44 44 except: 45 print "ERROR: numpy package is not installed. Run `pip install numpy`"45 print("ERROR: numpy package is not installed. Run `pip install numpy`") 46 46 sys.exit(1) 47 47 … … 229 229 strings.append(verticalSeparator) 230 230 231 print "\n"231 print("\n") 232 232 for s in strings: 233 233 print(s) 234 print "\n"234 print("\n") 235 235 236 236 def writeCSV(a, b, fileName): … … 328 328 else: 329 329 payload = payload["MotionMark-1.1.1"] 330 testNames = payload["tests"].keys()330 testNames = list(payload["tests"].keys()) 331 331 numTests = len(payload["tests"][testNames[0]]["metrics"]["Score"]["current"]) 332 332 results = [] … … 366 366 return False 367 367 368 print "Should not be reached."368 print("Should not be reached.") 369 369 assert False 370 370 … … 374 374 aMean = numpy.mean(a) 375 375 bMean = numpy.mean(b) 376 print "a mean = {:.5f}".format(aMean)377 print "b mean = {:.5f}".format(bMean)378 379 print "pValue = {:.10f}".format(pValue)376 print("a mean = {:.5f}".format(aMean)) 377 print("b mean = {:.5f}".format(bMean)) 378 379 print("pValue = {:.10f}".format(pValue)) 380 380 381 381 if biggerIsBetter(benchmarkType): 382 print "(Bigger means are better.)"382 print("(Bigger means are better.)") 383 383 if aMean > bMean: 384 print "{:.3f} times worse".format((aMean / bMean))384 print("{:.3f} times worse".format((aMean / bMean))) 385 385 else: 386 print "{:.3f} times better".format((bMean / aMean))386 print("{:.3f} times better".format((bMean / aMean))) 387 387 else: 388 print "(Smaller means are better.)"388 print("(Smaller means are better.)") 389 389 if aMean > bMean: 390 print "{:.3f} times better".format((aMean / bMean))390 print("{:.3f} times better".format((aMean / bMean))) 391 391 else: 392 print "{:.3f} times worse".format((bMean / aMean))392 print("{:.3f} times worse".format((bMean / aMean))) 393 393 394 394 if pValue <= 0.05: 395 print "Results ARE significant"395 print("Results ARE significant") 396 396 else: 397 print "Results ARE NOT significant"397 print("Results ARE NOT significant") 398 398 399 399 def getOptions(): … … 439 439 440 440 if typeA != typeB: 441 print "-a and -b are not the same benchmark. a={} b={}".format(typeA, typeB)441 print("-a and -b are not the same benchmark. a={} b={}".format(typeA, typeB)) 442 442 sys.exit(1) 443 443 444 444 if not (typeA and typeB): 445 print "Unknown benchmark type. a={} b={}".format(typeA, typeB)445 print("Unknown benchmark type. a={} b={}".format(typeA, typeB)) 446 446 sys.exit(1) 447 447 … … 480 480 writeCSV(plt5Breakdown(a), plt5Breakdown(b), args.csv) 481 481 else: 482 print "Unknown benchmark type"482 print("Unknown benchmark type") 483 483 sys.exit(1) 484 484 -
TabularUnified trunk/Tools/Scripts/compare-webkit-configurations ¶
r258075 r271151 40 40 force_webkit2 = args.webkit2 41 41 if args.comparison == "remote-layer-tree": 42 print "Forcing use of WebKit2, as the remote layer tree depends on WebKit2."42 print("Forcing use of WebKit2, as the remote layer tree depends on WebKit2.") 43 43 force_webkit2 = True 44 44 45 45 if args.comparison == "webkit2" and force_webkit2: 46 print "It doesn't make sense to test WebKit1 vs. WebKit2 *and* force WebKit2 on."46 print("It doesn't make sense to test WebKit1 vs. WebKit2 *and* force WebKit2 on.") 47 47 sys.exit(1) 48 48 … … 66 66 return "-2" 67 67 68 print "Unknown comparison:", comparison_name68 print("Unknown comparison:", comparison_name) 69 69 sys.exit(1) 70 70 -
TabularUnified trunk/Tools/Scripts/download-github-release.py ¶
r255243 r271151 119 119 version_info_path = binary_path + '.version' 120 120 121 print( ('Updating {}...'.format(args.filename)))121 print('Updating {}...'.format(args.filename)) 122 122 123 123 existing_version_info = load_version_info(version_info_path) 124 124 if existing_version_info: 125 print( ('Found existing release: {}'.format(existing_version_info['tag_name'])))125 print('Found existing release: {}'.format(existing_version_info['tag_name'])) 126 126 else: 127 127 print('No existing release found.') 128 128 129 129 release_title = 'release "{}"'.format(args.release_tag) if args.release_tag else 'latest release' 130 print( ('Seeking {} from {}...'.format(release_title, args.repo)))130 print('Seeking {} from {}...'.format(release_title, args.repo)) 131 131 release_url, target_version_info = find_release(args.endpoint, args.repo, args.filename, args.token, args.release_tag) 132 132 … … 148 148 os.makedirs(args.output_dir) 149 149 150 print( ('Downloading to {}...'.format(os.path.abspath(args.output_dir))))150 print('Downloading to {}...'.format(os.path.abspath(args.output_dir))) 151 151 download_release(release_url, binary_path, args.token) 152 152 save_version_info(version_info_path, target_version_info) -
TabularUnified trunk/Tools/Scripts/dump-webkit-tests-run ¶
r226395 r271151 1 1 #!/usr/bin/env python 2 3 # A webkitpy import needs to go first for autoinstaller to work with subsequent imports. 4 import webkitpy 5 2 6 import json 3 7 import optparse 4 8 import os 9 import six 5 10 import sys 6 11 … … 16 21 trie = json.load(fp) 17 22 else: 18 print >> sys.stderr, "file not found: %s" % args[0]23 six.print_("file not found: %s" % args[0], file=sys.stderr) 19 24 sys.exit(1) 20 25 else: … … 23 28 results = convert_trie_to_flat_paths(trie) 24 29 tests_run = [] 25 for (test, result) in results.iteritems():30 for (test, result) in six.iteritems(results): 26 31 # Each result is a dict containing 27 32 # { 'results': [worker #, test # in worker, driver pid, … … 30 35 tests_run.append((test, result['results'][1])) 31 36 32 print "\n".join(t[0] for t in sorted(tests_run, key=lambda t: t[1]))37 print("\n".join(t[0] for t in sorted(tests_run, key=lambda t: t[1]))) 33 38 34 39 … … 37 42 # so that this code can stand alone. 38 43 result = {} 39 for name, data in trie.iteritems():44 for name, data in six.iteritems(trie): 40 45 if prefix: 41 46 name = prefix + "/" + name -
TabularUnified trunk/Tools/Scripts/export-w3c-performance-wg-tests ¶
r143989 r271151 44 44 45 45 if len(sys.argv) != 3: 46 print 'USAGE: %s path_to_webkit_checkout_root path_to_webperf_checkout_root' % sys.argv[0]46 print('USAGE: %s path_to_webkit_checkout_root path_to_webperf_checkout_root' % sys.argv[0]) 47 47 sys.exit(1) 48 48 … … 78 78 line = line.replace(to_find, replace_with) 79 79 out_file.write(line) 80 print 'Exported %s' % os.path.join(root, filename)80 print('Exported %s' % os.path.join(root, filename)) -
TabularUnified trunk/Tools/Scripts/extract-dependencies-from-makefile ¶
r240503 r271151 34 34 # to the specified files. 35 35 36 37 from __future__ import print_function38 36 39 37 import argparse -
TabularUnified trunk/Tools/Scripts/extract-localizable-strings ¶
r235190 r271151 1 1 #!/bin/sh 2 2 3 exec "$(dirname $0)/../../Source/WebCore/Scripts/extract-localizable-strings.pl" "$@"3 exec("$(dirname $0)/../../Source/WebCore/Scripts/extract-localizable-strings.pl" "$@") -
TabularUnified trunk/Tools/Scripts/find-duplicate-files ¶
r265187 r271151 54 54 55 55 for fileList in sorted(duplicates): 56 print fileList56 print(fileList) -
TabularUnified trunk/Tools/Scripts/ic-stats.py ¶
r244204 r271151 75 75 76 76 def dumpStats(self): 77 print "Total Slow getById = {0:>13,d}".format(self.totalSlowGetById)78 print "Total Slow putById = {0:>13,d}".format(self.totalSlowPutById)77 print("Total Slow getById = {0:>13,d}".format(self.totalSlowGetById)) 78 print("Total Slow putById = {0:>13,d}".format(self.totalSlowPutById)) 79 79 80 print "Operation Base Property Location Count % tot"81 print "----------------------------------- -------------------- ------------------------------------ ------------ --------- slow"80 print("Operation Base Property Location Count % tot") 81 print("----------------------------------- -------------------- ------------------------------------ ------------ --------- slow") 82 82 83 83 keys = sorted(self.combinedRecords.keys(), key=lambda t: self.combinedRecords[t], reverse=True) … … 98 98 property = property[0:32] + "..." 99 99 100 print "{0:35} {1:20} {2:36} {3:12} {4:>9d}{5}".format(operation[0:34], base, property, key[3], count, slowPercent)100 print("{0:35} {1:20} {2:36} {3:12} {4:>9d}{5}".format(operation[0:34], base, property, key[3], count, slowPercent)) 101 101 102 102 103 103 def usage(): 104 print "Usage: {0} [ic-stats-file]".format(sys.argv[0])105 print " Where <ic-stats-file> is the results of using the useICStats option."104 print("Usage: {0} [ic-stats-file]".format(sys.argv[0])) 105 print(" Where <ic-stats-file> is the results of using the useICStats option.") 106 106 exit(1) 107 107 … … 113 113 file = open(sys.argv[1], "r") 114 114 except IOError as e: 115 print "Couldn't open {0}, {1}".format(sys.argv[1], e.strerror)115 print("Couldn't open {0}, {1}".format(sys.argv[1], e.strerror)) 116 116 usage() 117 117 except: 118 print "Unexpected error:", sys.exc_info()[0]118 print("Unexpected error:", sys.exc_info()[0]) 119 119 usage() 120 120 else: -
TabularUnified trunk/Tools/Scripts/import-w3c-performance-wg-tests ¶
r143989 r271151 43 43 44 44 if len(sys.argv) != 3: 45 print 'USAGE: %s path_to_webperf_checkout_root path_to_webkit_checkout_root' % sys.argv[0]45 print('USAGE: %s path_to_webperf_checkout_root path_to_webkit_checkout_root' % sys.argv[0]) 46 46 sys.exit(1) 47 47 … … 50 50 51 51 if os.path.exists(destination_directory): 52 print 'Refusing to overwrite existing directory: %s' % destination_directory52 print('Refusing to overwrite existing directory: %s' % destination_directory) 53 53 sys.exit(1) 54 54 os.makedirs(destination_directory) -
TabularUnified trunk/Tools/Scripts/make-dist ¶
r270583 r271151 16 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 17 18 from __future__ import print_function19 18 from contextlib import closing 20 19 … … 121 120 return Ruleset.global_rules().passes(entry) and self.rules.passes(entry) 122 121 123 to_keep = filter(passes_all_rules, dirs)122 to_keep = list(filter(passes_all_rules, dirs)) 124 123 del dirs[:] 125 124 dirs.extend(to_keep) … … 238 237 try: 239 238 os.mkdir(directory) 240 except OSError ,e:239 except OSError as e: 241 240 if e.errno != errno.EEXIST or not os.path.isdir(directory): 242 241 raise Exception("Could not create %s dir at %s: %s" % (directory_type, directory, str(e))) -
TabularUnified trunk/Tools/Scripts/malloc-tree ¶
r165676 r271151 199 199 sortedRootNodes = sorted(rootNodes.values(), key=sortKeyByBytes, reverse=True) 200 200 201 print 'Call graph:'201 print('Call graph:') 202 202 try: 203 203 for node in sortedRootNodes: 204 204 node.printNode() 205 print 205 print() 206 206 except: 207 207 pass -
TabularUnified trunk/Tools/Scripts/mark-jsc-stress-test ¶
r251161 r271151 75 75 skip_conditions = [] 76 76 skip_line = "{} {} {}" 77 supported_variables = filter(lambda variable: variable in self._conditions, JSCTestModifier.variables)77 supported_variables = [variable for variable in JSCTestModifier.variables if variable in self._conditions] 78 78 condition_template = "{}" if len(supported_variables) == 1 else "({})" 79 79 for variable in supported_variables: -
TabularUnified trunk/Tools/Scripts/open-layout-test ¶
r217276 r271151 66 66 test_url = driver.test_to_uri(test_name) 67 67 if not needs_server: 68 print "Opening %s" % test_url68 print("Opening %s" % test_url) 69 69 subprocess.Popen(['open', test_url]) 70 70 return -
TabularUnified trunk/Tools/Scripts/read-checksum-from-png ¶
r118884 r271151 28 28 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 29 30 from __future__ import with_statement31 30 import sys 32 31 … … 37 36 for filename in sys.argv[1:]: 38 37 with open(filename, 'r') as filehandle: 39 print "%s: %s" % (read_checksum_from_png.read_checksum(filehandle), filename)38 print("%s: %s" % (read_checksum_from_png.read_checksum(filehandle), filename)) -
TabularUnified trunk/Tools/Scripts/rebase-patch-after-webkit-move ¶
r219477 r271151 22 22 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 23 24 # A webkitpy import needs to go first for autoinstaller to work with subsequent imports. 25 import webkitpy 26 24 27 import os 28 import six 25 29 import sys 26 30 … … 49 53 return RebaseStatus.DO_NOT_NEED 50 54 51 for current_name, rebased_name in REBASE_DICTIONARY.iteritems():55 for current_name, rebased_name in six.iteritems(REBASE_DICTIONARY): 52 56 # Check if we've already rebased. We need to check if the rebased_name is already in the REBASE_DICTIONARY, 53 57 # in this case, we don't know if we've already been rebased. … … 61 65 62 66 # Check if we might need a rebase 63 for current_name, rebased_name in REBASE_DICTIONARY.iteritems():67 for current_name, rebased_name in six.iteritems(REBASE_DICTIONARY): 64 68 if append_source(current_name) in line: 65 69 return RebaseStatus.MAYBE_NEED … … 70 74 def rebase_line(line): 71 75 if not is_editable_line(line): 72 for current_name, rebased_name in REBASE_DICTIONARY.iteritems():76 for current_name, rebased_name in six.iteritems(REBASE_DICTIONARY): 73 77 if current_name in line: 74 78 sys.stderr.write('Found an instance of {} in the patch. Did you mean to replace it with {}?\n'.format(current_name, rebased_name)) 75 79 return line 76 for current_name, rebased_name in REBASE_DICTIONARY.iteritems():80 for current_name, rebased_name in six.iteritems(REBASE_DICTIONARY): 77 81 if append_source(current_name) in line: 78 82 return line.replace(append_source(current_name), append_source(rebased_name)) … … 119 123 return [] 120 124 elif sys.argv[1] == '-h' or sys.argv[1] == 'help': 121 print 'rebase-patch-after-webkit-move usage:'122 print '\trebase-patch-after-webkit-move -h, help'123 print '\t\tPrint this message'124 print '\trebase-patch-after-webkit-move <path to patch>'125 print '\t\tReplace the patch at the provided path with a rebased patch'126 print '\trebase-patch-after-webkit-move'127 print '\t\tTreat stdin as the patch to be rebased'125 print('rebase-patch-after-webkit-move usage:') 126 print('\trebase-patch-after-webkit-move -h, help') 127 print('\t\tPrint this message') 128 print('\trebase-patch-after-webkit-move <path to patch>') 129 print('\t\tReplace the patch at the provided path with a rebased patch') 130 print('\trebase-patch-after-webkit-move') 131 print('\t\tTreat stdin as the patch to be rebased') 128 132 exit(0) 129 133 -
TabularUnified trunk/Tools/Scripts/run-gtk-tests ¶
r263743 r271151 18 18 # Boston, MA 02110-1301, USA. 19 19 20 from __future__ import print_function21 20 import logging 22 21 import subprocess -
TabularUnified trunk/Tools/Scripts/run-webdriver-tests ¶
r263261 r271151 61 61 try: 62 62 port = Host().port_factory.get(options.platform, options) 63 except NotImplementedError ,e:63 except NotImplementedError as e: 64 64 _log.error(str(e)) 65 65 sys.exit(-1) … … 77 77 78 78 if not jhbuildutils.enter_jhbuild_environment_if_available(port.name()): 79 print '***'80 print '*** Warning: jhbuild environment not present and not running in flatpak.'81 print '*** Run update-webkitgtk-libs or update-webkit-flatpak before build-webkit to ensure proper testing..'82 print '***'79 print('***') 80 print('*** Warning: jhbuild environment not present and not running in flatpak.') 81 print('*** Run update-webkitgtk-libs or update-webkit-flatpak before build-webkit to ensure proper testing..') 82 print('***') 83 83 84 84 runner = WebDriverTestRunner(port) -
TabularUnified trunk/Tools/Scripts/run-wpe-tests ¶
r263950 r271151 18 18 # Boston, MA 02110-1301, USA. 19 19 20 from __future__ import print_function21 20 import logging 22 21 import os -
TabularUnified trunk/Tools/Scripts/sampstat ¶
r165676 r271151 29 29 import fileinput 30 30 from optparse import OptionParser 31 from functools import reduce 31 32 32 33 usage = "usage: %prog [options] [FILES]\n Compute the mean and 95% confidence interval of a sample set.\n Standard input or files must contain two or more decimal numbers, one per line." … … 89 90 for item in results: 90 91 line = " %.2f %s" % (item, options.unit) 91 print line92 print(line) 92 93 length = len(line) if len(line) > length else length 93 94 94 print "-" * length95 print("-" * length) 95 96 96 97 prefix = "Mean: " if options.verbose else "" 97 print "%s%.2f %s +/- %.2f %s (%.1f%%)" % (prefix, mean, options.unit, confidenceInterval, options.unit, confidencePercent)98 print("%s%.2f %s +/- %.2f %s (%.1f%%)" % (prefix, mean, options.unit, confidenceInterval, options.unit, confidencePercent)) 98 99 -
TabularUnified trunk/Tools/Scripts/sync-feature-defines ¶
r213395 r271151 26 26 "Copies the most recently updated FeatureDefines.xcconfig file to all the others." 27 27 28 # A webkitpy import needs to go first for autoinstaller to work with subsequent imports. 29 from webkitpy.style.checkers.featuredefines import FEATURE_DEFINE_FILES 30 28 31 import os 29 32 import shutil 30 from webkitpy.style.checkers.featuredefines import FEATURE_DEFINE_FILES 33 import six 34 31 35 32 36 newest_file = max(FEATURE_DEFINE_FILES, key=os.path.getctime) … … 34 38 remaining_files.remove(newest_file) 35 39 36 print "Copy %s to each of: %s " % (newest_file, ", ".join(remaining_files))37 response = raw_input("Continue [Y/n]: ")40 print("Copy %s to each of: %s " % (newest_file, ", ".join(remaining_files))) 41 response = six.moves.input("Continue [Y/n]: ") 38 42 39 43 if not response: -
TabularUnified trunk/Tools/Scripts/sync-master-with-upstream ¶
r111823 r271151 39 39 if subprocess.call(args) != 0: 40 40 if error_message: 41 print error_message41 print(error_message) 42 42 exit(1) 43 43 44 44 run(["git", "fetch", "upstream"], "Have you run configure-github-as-upstream to configure an upstream repository?") 45 45 run(["git", "push", "origin", "upstream/master:master"]) 46 print "\nConsider running 'git merge origin' to update your local branches."46 print("\nConsider running 'git merge origin' to update your local branches.") -
TabularUnified trunk/Tools/Scripts/update-wasm-gcc-torture.py ¶
r225698 r271151 32 32 import sys 33 33 import tarfile 34 import urllib2 34 35 if sys.version_info > (3, 0): 36 from urllib.request import urlopen 37 else: 38 from urllib2 import urlopen 35 39 36 40 LKGR_URL = 'https://storage.googleapis.com/wasm-llvm/builds/%s/lkgr.json' … … 66 70 if not args.lkgr: 67 71 print('Downloading: %s' % lkgr_url) 68 args.lkgr = json.loads(url lib2.urlopen(lkgr_url).read())['build']72 args.lkgr = json.loads(urlopen(lkgr_url).read())['build'] 69 73 print('lkgr: %s' % args.lkgr) 70 74 … … 75 79 if not os.path.exists(torture_file): 76 80 print('Downloading: %s' % torture_url) 77 torture_download = url lib2.urlopen(torture_url)81 torture_download = urlopen(torture_url) 78 82 with open(torture_file, 'wb') as f: 79 83 f.write(torture_download.read()) -
TabularUnified trunk/Tools/Scripts/validate-committer-lists ¶
r246414 r271151 34 34 import logging 35 35 import os 36 import re 36 37 import subprocess 37 import re38 import urllib2 38 import sys 39 39 40 from datetime import date, datetime, timedelta 40 41 from optparse import OptionParser 42 43 if sys.version_info > (3, 0): 44 from urllib.request import urlopen 45 else: 46 from urllib2 import urlopen 41 47 42 48 from webkitpy.common.config.committers import CommitterList … … 54 60 if not list_to_print: 55 61 return 56 print # Newline before the list57 print title62 print() # Newline before the list 63 print(title) 58 64 for item in list_to_print: 59 print item65 print(item) 60 66 61 67 … … 65 71 66 72 def _fetch_emails_from_page(self, url): 67 page = url lib2.urlopen(url)73 page = urlopen(url) 68 74 soup = BeautifulSoup(page) 69 75 … … 94 100 email_to_committer_map[email] = committer 95 101 96 return filter(lambda email: not email_to_committer_map.get(email), emails)102 return [email for email in emails if not email_to_committer_map.get(email)] 97 103 98 104 def check_for_emails_missing_from_list(self, committer_list): … … 212 218 213 219 def _fill_in_emails_for_old_logins(self): 214 authors_missing_email = filter(lambda author: author.find('@') == -1, self._last_commit_time_by_author_cache)215 authors_with_email = filter(lambda author: author.find('@') != -1, self._last_commit_time_by_author_cache)216 prefixes_of_authors_with_email = map(lambda author: author.split('@')[0], authors_with_email)220 authors_missing_email = [author for author in self._last_commit_time_by_author_cache if author.find('@') == -1] 221 authors_with_email = [author for author in self._last_commit_time_by_author_cache if author.find('@') != -1] 222 prefixes_of_authors_with_email = [author.split('@')[0] for author in authors_with_email] 217 223 218 224 for author in authors_missing_email: … … 246 252 @staticmethod 247 253 def _print_three_column_row(widths, values): 248 print "%s%s%s" % (values[0].ljust(widths[0]), values[1].ljust(widths[1]), values[2])254 print("%s%s%s" % (values[0].ljust(widths[0]), values[1].ljust(widths[1]), values[2])) 249 255 250 256 def possibly_expired_committers(self, committer_list): 251 authors_and_last_commits = self._last_commit_by_author().items()257 authors_and_last_commits = list(self._last_commit_by_author().items()) 252 258 authors_and_last_commits.sort(lambda a,b: cmp(a[1], b[1]), reverse=True) 253 259 committer_cutof = date.today() - timedelta(days=365) … … 285 291 retired_authors_and_last_commits = self.possibly_expired_committers(committer_list) 286 292 column_widths = [13, 25] 287 print 288 print "Committers who have not committed within one year:"293 print() 294 print("Committers who have not committed within one year:") 289 295 self._print_three_column_row(column_widths, ("Last Commit", "Committer Email", "Committer Record")) 290 296 for (author, last_commit) in retired_authors_and_last_commits: … … 297 303 298 304 column_widths = [13, 25] 299 print 300 print "Reviewers who have not reviewed within one year:"305 print() 306 print("Reviewers who have not reviewed within one year:") 301 307 for contributor in inactive_reviewers: 302 print "\"{}\" {}".format(contributor.full_name.encode("utf-8"), contributor.bugzilla_email())308 print("\"{}\" {}".format(contributor.full_name.encode("utf-8"), contributor.bugzilla_email())) 303 309 304 310 def print_committers_missing_from_committer_list(self, committer_list): … … 329 335 330 336 def print_committers_with_invalid_bugzilla_emails(self, committer_list): 331 print # Print a newline before we start hitting bugzilla (it logs about logging in).332 print "Checking committer emails against bugzilla (this will take a long time)"333 committers_with_invalid_bugzilla_email = filter(self._has_invalid_bugzilla_email, committer_list.committers())337 print() # Print a newline before we start hitting bugzilla (it logs about logging in). 338 print("Checking committer emails against bugzilla (this will take a long time)") 339 committers_with_invalid_bugzilla_email = list(filter(self._has_invalid_bugzilla_email, committer_list.committers())) 334 340 print_list_if_non_empty("Committers with invalid bugzilla email:", committers_with_invalid_bugzilla_email) 335 341 … … 342 348 return "<{0}@268f45cc-cd09-0410-ab3c-d52691b4dbfc>".format(email) 343 349 344 email_to_legacy_username = dict( map(reversed, CommitterListFromGit.login_to_email_address.items()))350 email_to_legacy_username = dict(list(map(reversed, list(CommitterListFromGit.login_to_email_address.items())))) 345 351 def map_emails_to_legacy_username(emails): 346 352 legacy_username = None … … 360 366 361 367 for other_email in other_emails: 362 print full_name, format_email(canonical_email), format_email(other_email)363 print full_name, format_email(canonical_email), format_email_with_uuid(other_email)368 print(full_name, format_email(canonical_email), format_email(other_email)) 369 print(full_name, format_email(canonical_email), format_email_with_uuid(other_email)) 364 370 365 371 … … 375 381 committer_list = CommitterList() 376 382 if options.dump: 377 print committer_list.as_json()383 print(committer_list.as_json()) 378 384 return 0 379 385 … … 383 389 384 390 if options.canonicalize: 385 print "Updating contributors.json in-place..."391 print("Updating contributors.json in-place...") 386 392 committer_list.reformat_in_place() 387 print "Done"393 print("Done") 388 394 return 0 389 395 … … 391 397 392 398 if not Git.in_working_directory("."): 393 print 399 print("""\n\nWARNING: validate-committer-lists requires a git checkout. 394 400 The following checks are disabled: 395 401 - List of inactive committers 396 402 - List of inactive reviewers 397 403 - List of historical committers missing from contributors.json 398 """ 404 """) 399 405 return 1 400 406
Note:
See TracChangeset
for help on using the changeset viewer.