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

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: copyright 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 | « chrome/tools/extract_actions.py ('k') | chrome/tools/history-viz.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/tools/extract_histograms.py
diff --git a/chrome/tools/extract_histograms.py b/chrome/tools/extract_histograms.py
index 8c002f3b422f1d1ddb323aff56d1ceed08b1701d..82fc9e955a5e4461b41071160133e2d02d7aca38 100755
--- a/chrome/tools/extract_histograms.py
+++ b/chrome/tools/extract_histograms.py
@@ -1,5 +1,5 @@
-#!/usr/bin/python
-# Copyright (c) 2009 The Chromium Authors. All rights reserved.
+#!/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.
@@ -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))
« no previous file with comments | « chrome/tools/extract_actions.py ('k') | chrome/tools/history-viz.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698