| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2010 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """\ | 6 """\ |
| 7 Wrapper script around Rietveld's upload.py that simplifies working with groups | 7 Wrapper script around Rietveld's upload.py that simplifies working with groups |
| 8 of files. | 8 of files. |
| 9 """ | 9 """ |
| 10 | 10 |
| 11 import getpass | 11 import getpass |
| 12 import optparse | 12 import optparse |
| 13 import os | 13 import os |
| 14 import random | 14 import random |
| 15 import re | 15 import re |
| 16 import string | 16 import string |
| 17 import subprocess | 17 import subprocess |
| 18 import sys | 18 import sys |
| 19 import tempfile | 19 import tempfile |
| 20 import time | 20 import time |
| 21 from third_party import upload | 21 from third_party import upload |
| 22 import urllib2 | 22 import urllib2 |
| 23 | 23 |
| 24 try: | 24 try: |
| 25 import simplejson as json # pylint: disable=F0401 | 25 import simplejson as json # pylint: disable=F0401 |
| 26 except ImportError: | 26 except ImportError: |
| 27 try: | 27 try: |
| 28 import json | 28 import json # pylint: disable=F0401 |
| 29 # Some versions of python2.5 have an incomplete json module. Check to make | 29 except ImportError: |
| 30 # sure loads exists. | |
| 31 # pylint: disable=W0104 | |
| 32 json.loads | |
| 33 except (ImportError, AttributeError): | |
| 34 # Import the one included in depot_tools. | 30 # Import the one included in depot_tools. |
| 35 sys.path.append(os.path.join(os.path.dirname(__file__), 'third_party')) | 31 sys.path.append(os.path.join(os.path.dirname(__file__), 'third_party')) |
| 36 import simplejson as json # pylint: disable=F0401 | 32 import simplejson as json # pylint: disable=F0401 |
| 37 | 33 |
| 38 import breakpad # pylint: disable=W0611 | 34 import breakpad # pylint: disable=W0611 |
| 39 | 35 |
| 40 # gcl now depends on gclient. | 36 # gcl now depends on gclient. |
| 41 from scm import SVN | 37 from scm import SVN |
| 42 | 38 |
| 43 import fix_encoding | 39 import fix_encoding |
| (...skipping 1409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1453 raise | 1449 raise |
| 1454 print >> sys.stderr, ( | 1450 print >> sys.stderr, ( |
| 1455 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 1451 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
| 1456 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) | 1452 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) |
| 1457 return 1 | 1453 return 1 |
| 1458 | 1454 |
| 1459 | 1455 |
| 1460 if __name__ == "__main__": | 1456 if __name__ == "__main__": |
| 1461 fix_encoding.fix_encoding() | 1457 fix_encoding.fix_encoding() |
| 1462 sys.exit(main(sys.argv[1:])) | 1458 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |