| 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))
|
|
|