Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Unified Diff: tools/pretty_sln.py

Issue 1454433002: Python 3 compatibility Base URL: https://chromium.googlesource.com/external/gyp.git@master
Patch Set: Rebase with master (4ec6c4e3a94bd04a6da2858163d40b2429b8aad1) Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/pretty_sln.py
diff --git a/tools/pretty_sln.py b/tools/pretty_sln.py
index ca8cf4ad3fb836bd39f40e368dda79735c585a6a..12a6dadd173578c629f2af092bfb2b96f3201826 100755
--- a/tools/pretty_sln.py
+++ b/tools/pretty_sln.py
@@ -12,6 +12,8 @@
Then it outputs a possible build order.
"""
+from __future__ import print_function
+
__author__ = 'nsylvain (Nicolas Sylvain)'
import os
@@ -26,7 +28,7 @@ def BuildProject(project, built, projects, deps):
for dep in deps[project]:
if dep not in built:
BuildProject(dep, built, projects, deps)
- print project
+ print(project)
built.append(project)
def ParseSolution(solution_file):
@@ -100,44 +102,44 @@ def ParseSolution(solution_file):
return (projects, dependencies)
def PrintDependencies(projects, deps):
- print "---------------------------------------"
- print "Dependencies for all projects"
- print "---------------------------------------"
- print "-- --"
+ print("---------------------------------------")
+ print("Dependencies for all projects")
+ print("---------------------------------------")
+ print("-- --")
for (project, dep_list) in sorted(deps.items()):
- print "Project : %s" % project
- print "Path : %s" % projects[project][0]
+ print("Project : %s" % project)
+ print("Path : %s" % projects[project][0])
if dep_list:
for dep in dep_list:
- print " - %s" % dep
- print ""
+ print(" - %s" % dep)
+ print("")
- print "-- --"
+ print("-- --")
def PrintBuildOrder(projects, deps):
- print "---------------------------------------"
- print "Build order "
- print "---------------------------------------"
- print "-- --"
+ print("---------------------------------------")
+ print("Build order ")
+ print("---------------------------------------")
+ print("-- --")
built = []
for (project, _) in sorted(deps.items()):
if project not in built:
BuildProject(project, built, projects, deps)
- print "-- --"
+ print("-- --")
def PrintVCProj(projects):
for project in projects:
- print "-------------------------------------"
- print "-------------------------------------"
- print project
- print project
- print project
- print "-------------------------------------"
- print "-------------------------------------"
+ print("-------------------------------------")
+ print("-------------------------------------")
+ print(project)
+ print(project)
+ print(project)
+ print("-------------------------------------")
+ print("-------------------------------------")
project_path = os.path.abspath(os.path.join(os.path.dirname(sys.argv[1]),
projects[project][2]))
@@ -153,7 +155,7 @@ def PrintVCProj(projects):
def main():
# check if we have exactly 1 parameter.
if len(sys.argv) < 2:
- print 'Usage: %s "c:\\path\\to\\project.sln"' % sys.argv[0]
+ print('Usage: %s "c:\\path\\to\\project.sln"' % sys.argv[0])
return 1
(projects, deps) = ParseSolution(sys.argv[1])

Powered by Google App Engine
This is Rietveld 408576698