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

Unified Diff: chrome/tools/extract_histograms.py

Issue 8680018: Fix python scripts in src/chrome/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . 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
Index: chrome/tools/extract_histograms.py
diff --git a/chrome/tools/extract_histograms.py b/chrome/tools/extract_histograms.py
index 8c002f3b422f1d1ddb323aff56d1ceed08b1701d..fcc1ce0740bf7e4cc0a274c8159289b08689312d 100755
--- a/chrome/tools/extract_histograms.py
+++ b/chrome/tools/extract_histograms.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
# Copyright (c) 2009 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.
@@ -35,6 +35,7 @@ def GrepForHistograms(path, histograms):
if match:
histograms.add(match.group(1))
+
def WalkDirectory(root_path, histograms):
for path, dirs, files in os.walk(root_path):
if '.svn' in dirs:
@@ -44,6 +45,7 @@ def WalkDirectory(root_path, histograms):
if ext == '.cc':
GrepForHistograms(os.path.join(path, file), histograms)
+
def main(argv):
histograms = set()
@@ -53,6 +55,8 @@ def main(argv):
# Print out the histograms as a sorted list.
for histogram in sorted(histograms):
print histogram
+ return 0
+
if '__main__' == __name__:
- main(sys.argv)
+ sys.exit(main(sys.argv))

Powered by Google App Engine
This is Rietveld 408576698