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

Unified Diff: tools/include_tracer.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/heapcheck/suppressions.py ('k') | tools/licenses.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/include_tracer.py
diff --git a/tools/include_tracer.py b/tools/include_tracer.py
index 6c8308f3ec51369b1121815df2fe985feb0b22a4..5d908d1d1f79aeb37168913f13ffd07b24130bce 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())
« no previous file with comments | « tools/heapcheck/suppressions.py ('k') | tools/licenses.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698