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

Unified Diff: tools/licenses.py

Issue 8678023: Fix python scripts in src/tools/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes Created 9 years, 1 month 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
« no previous file with comments | « tools/include_tracer.py ('k') | tools/linux/dump-static-initializers.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/licenses.py
diff --git a/tools/licenses.py b/tools/licenses.py
index 211133f20149f430732c8954917f0b56024438ea..ea0b8d4944e417a2fc1b24e4a8224918a733bde2 100755
--- a/tools/licenses.py
+++ b/tools/licenses.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -236,6 +236,7 @@ def FindThirdPartyDirs():
return third_party_dirs
+
def ScanThirdPartyDirs():
"""Scan a list of directories and report on any problems we find."""
third_party_dirs = FindThirdPartyDirs()
@@ -253,6 +254,7 @@ def ScanThirdPartyDirs():
return len(errors) == 0
+
def GenerateCredits():
"""Generate about:credits, dumping the result to stdout."""
@@ -290,17 +292,22 @@ def GenerateCredits():
print EvaluateTemplate(file_template, {'entries': '\n'.join(entries)},
escape=False)
-if __name__ == '__main__':
+
+def main():
command = 'help'
if len(sys.argv) > 1:
command = sys.argv[1]
if command == 'scan':
if not ScanThirdPartyDirs():
- sys.exit(1)
+ return 1
elif command == 'credits':
if not GenerateCredits():
- sys.exit(1)
+ return 1
else:
print __doc__
- sys.exit(1)
+ return 1
+
+
+if __name__ == '__main__':
+ sys.exit(main())
« no previous file with comments | « tools/include_tracer.py ('k') | tools/linux/dump-static-initializers.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698