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