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

Side by Side Diff: lib/naclports/__main__.py

Issue 839083003: Add initial support for color output in the build system (Closed) Base URL: https://chromium.googlesource.com/external/naclports.git@master
Patch Set: Created 5 years, 11 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 unified diff | Download patch
OLDNEW
1 # Copyright (c) 2013 The Native Client Authors. All rights reserved. 1 # Copyright (c) 2013 The Native Client Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Tool for manipulating naclports packages in python. 5 """Tool for manipulating naclports packages in python.
6 6
7 This tool can be used to for working with naclports packages. 7 This tool can be used to for working with naclports packages.
8 It can also be incorporated into other tools that need to 8 It can also be incorporated into other tools that need to
9 work with packages (e.g. 'update_mirror.py' uses it to iterate 9 work with packages (e.g. 'update_mirror.py' uses it to iterate
10 through all packages and mirror them on Google Cloud Storage). 10 through all packages and mirror them on Google Cloud Storage).
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 p = naclports.package.CreateInstalledPackage(package_name, config) 268 p = naclports.package.CreateInstalledPackage(package_name, config)
269 else: 269 else:
270 p = source_package.CreatePackage(package_name, config) 270 p = source_package.CreatePackage(package_name, config)
271 DoCmd(p) 271 DoCmd(p)
272 272
273 273
274 def main(args): 274 def main(args):
275 try: 275 try:
276 run_main(args) 276 run_main(args)
277 except KeyboardInterrupt: 277 except KeyboardInterrupt:
278 sys.stderr.write('naclports: interrupted\n') 278 sys.stderr.write('naclports: %s\n' % util.Color('interrupted', 'red'))
279 return 1 279 return 1
280 except error.Error as e: 280 except error.Error as e:
281 sys.stderr.write('naclports: %s\n' % e) 281 sys.stderr.write('naclports: %s\n' % util.Color(str(e), 'red'))
282 return 1 282 return 1
283 283
284 return 0 284 return 0
285 285
286 if __name__ == '__main__': 286 if __name__ == '__main__':
287 sys.exit(main(sys.argv[1:])) 287 sys.exit(main(sys.argv[1:]))
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698