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

Unified Diff: tools/crx_id/crx_id.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/crx_id/PRESUBMIT.py ('k') | tools/dromaeo_benchmark_runner/dromaeo_benchmark_runner.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/crx_id/crx_id.py
diff --git a/tools/crx_id/crx_id.py b/tools/crx_id/crx_id.py
index 63500680042bcb6476dc8c3645844a6dbcac3b01..299e1d64616a84562e7835b2ce7af33a15a2f206 100755
--- a/tools/crx_id/crx_id.py
+++ b/tools/crx_id/crx_id.py
@@ -1,4 +1,4 @@
-#!/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.
@@ -13,12 +13,14 @@ for docs on the format.
import sys
import hashlib
-def usage(argv):
- print "%s: crx_file" % argv[0]
EXPECTED_CRX_MAGIC_NUM = 'Cr24'
EXPECTED_CRX_VERSION = 2
+
+def usage(argv):
+ print "%s: crx_file" % argv[0]
+
def HexToInt(hex_chars):
""" Convert bytes like \xab -> 171 """
val = 0
@@ -81,6 +83,7 @@ def GetCRXAppID(filename):
# AppID is the MPDecimal of only the first 128 bits of the hash.
return HexToMPDecimal(pub_key_hash[:128/8])
+
def main(argv):
if len(argv) != 2:
usage(argv)
@@ -88,5 +91,6 @@ def main(argv):
print 'Raw Bytes: %s' % GetCRXHash(sys.argv[1])
print 'AppID: %s' % GetCRXAppID(sys.argv[1])
+
if __name__ == '__main__':
sys.exit(main(sys.argv))
« no previous file with comments | « tools/crx_id/PRESUBMIT.py ('k') | tools/dromaeo_benchmark_runner/dromaeo_benchmark_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698