summaryrefslogtreecommitdiffstats
path: root/tools/include_tracer.py
diff options
context:
space:
mode:
authormaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-29 17:25:34 +0000
committermaruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-29 17:25:34 +0000
commitcb155a802bdc49cfafea1c41e0f0a92168f1da09 (patch)
treebf0fae4855c7f4458d8e959455b9d12d6cd54d9d /tools/include_tracer.py
parent9bec23957253b83955c4096903ad6293d1c6e1bb (diff)
downloadchromium_src-cb155a802bdc49cfafea1c41e0f0a92168f1da09.zip
chromium_src-cb155a802bdc49cfafea1c41e0f0a92168f1da09.tar.gz
chromium_src-cb155a802bdc49cfafea1c41e0f0a92168f1da09.tar.bz2
Fix python scripts in src/tools/
Make sure that: - shebang is only present for executable files - shebang is #!/usr/bin/env python - __main__ is only present for executable files - file's executable bit is coherent Also fix EOF LF to be only one. TBR=timurrrr@chromium.org BUG=105108 TEST= Review URL: http://codereview.chromium.org/8678023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111960 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/include_tracer.py')
-rwxr-xr-xtools/include_tracer.py27
1 files changed, 17 insertions, 10 deletions
diff --git a/tools/include_tracer.py b/tools/include_tracer.py
index 6c8308f..5d908d1 100755
--- a/tools/include_tracer.py
+++ b/tools/include_tracer.py
@@ -1,14 +1,16 @@
-#!/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.
# based on an almost identical script by: jyrki@google.com (Jyrki Alakuijala)
-#
-# This script prints out include dependencies in chrome. Since it ignores
-# defines, it gives just a rough estimation of file size.
-#
-# Usage:
-# python tools/include_tracer.py chrome/browser/ui/browser.h
+
+"""Prints out include dependencies in chrome.
+
+Since it ignores defines, it gives just a rough estimation of file size.
+
+Usage:
+ tools/include_tracer.py chrome/browser/ui/browser.h
+"""
import os
import sys
@@ -194,6 +196,11 @@ def Walk(seen, filename, parent, indent):
return total_bytes + len("".join(lines))
-bytes = Walk(set(), sys.argv[1], '', 0)
-print
-print float(bytes) / (1 << 20), "megabytes of chrome source"
+def main():
+ bytes = Walk(set(), sys.argv[1], '', 0)
+ print
+ print float(bytes) / (1 << 20), "megabytes of chrome source"
+
+
+if __name__ == '__main__':
+ sys.exit(main())