aboutsummaryrefslogtreecommitdiff
path: root/tools/fix_style.py
diff options
context:
space:
mode:
authorMarshall Greenblatt <magreenblatt@gmail.com>2020-01-14 15:29:42 +0100
committerMarshall Greenblatt <magreenblatt@gmail.com>2020-01-14 15:29:42 +0100
commit6d7ad9df13beefa2c7598198060631e9b9b6223b (patch)
tree8184f62536255c7de09907d7d86f5493e1be1a0d /tools/fix_style.py
parenta70a108f0173e867ca2fb230e21c937975254158 (diff)
downloadjcef-6d7ad9df13beefa2c7598198060631e9b9b6223b.tar.gz
Add Python 3 support (CEF issue #2856)
Diffstat (limited to 'tools/fix_style.py')
-rw-r--r--tools/fix_style.py24
1 files changed, 13 insertions, 11 deletions
diff --git a/tools/fix_style.py b/tools/fix_style.py
index b610c0d..e0debae 100644
--- a/tools/fix_style.py
+++ b/tools/fix_style.py
@@ -3,6 +3,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+from __future__ import absolute_import
+from __future__ import print_function
import os, re, sys
from clang_util import clang_format
from file_util import eval_file, get_files, read_file, write_file
@@ -34,7 +36,7 @@ def msg(filename, status):
filename = filename[pos:]
filename = "..." + filename
- print "%-60s %s" % (filename, status)
+ print("%-60s %s" % (filename, status))
updatect = 0
@@ -124,15 +126,15 @@ def fix_style(filenames, white_list=None, black_list=None):
if __name__ == "__main__":
if len(sys.argv) == 1:
- print "Usage: %s [file-path|git-hash|unstaged|staged] ..." % sys.argv[0]
- print "\n Format C, C++ and ObjC files using Chromium's clang-format style."
- print "\nOptions:"
- print " file-path\tProcess the specified file or directory."
- print " \t\tDirectories will be processed recursively."
- print " \t\tThe \"*\" wildcard character is supported."
- print " git-hash\tProcess all files changed in the specified Git commit."
- print " unstaged\tProcess all unstaged files in the Git repo."
- print " staged\t\tProcess all staged files in the Git repo."
+ print("Usage: %s [file-path|git-hash|unstaged|staged] ...\n" % sys.argv[0])
+ print(" Format C, C++ and ObjC files using Chromium's clang-format style.")
+ print("\nOptions:")
+ print(" file-path\tProcess the specified file or directory.")
+ print(" \t\tDirectories will be processed recursively.")
+ print(" \t\tThe \"*\" wildcard character is supported.")
+ print(" git-hash\tProcess all files changed in the specified Git commit.")
+ print(" unstaged\tProcess all unstaged files in the Git repo.")
+ print(" staged\t\tProcess all staged files in the Git repo.")
sys.exit(1)
# Read the configuration file.
@@ -140,4 +142,4 @@ if __name__ == "__main__":
# Process anything passed on the command-line.
fix_style(sys.argv[1:])
- print 'Done - Wrote %d files.' % updatect
+ print('Done - Wrote %d files.' % updatect)