OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 json |
11 import optparse | 12 import optparse |
12 import os | 13 import os |
13 import random | 14 import random |
14 import re | 15 import re |
15 import string | 16 import string |
16 import sys | 17 import sys |
17 import tempfile | 18 import tempfile |
18 import time | 19 import time |
19 import urllib2 | 20 import urllib2 |
20 | 21 |
21 import breakpad # pylint: disable=W0611 | 22 import breakpad # pylint: disable=W0611 |
22 | 23 |
23 try: | |
24 import simplejson as json # pylint: disable=F0401 | |
25 except ImportError: | |
26 try: | |
27 import json # pylint: disable=F0401 | |
28 except ImportError: | |
29 # Import the one included in depot_tools. | |
30 sys.path.append(os.path.join(os.path.dirname(__file__), 'third_party')) | |
31 import simplejson as json # pylint: disable=F0401 | |
32 | 24 |
33 import fix_encoding | 25 import fix_encoding |
34 import gclient_utils | 26 import gclient_utils |
35 import presubmit_support | 27 import presubmit_support |
36 import rietveld | 28 import rietveld |
37 from scm import SVN | 29 from scm import SVN |
38 import subprocess2 | 30 import subprocess2 |
39 from third_party import upload | 31 from third_party import upload |
40 | 32 |
41 __version__ = '1.2.1' | 33 __version__ = '1.2.1' |
(...skipping 1403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1445 raise | 1437 raise |
1446 print >> sys.stderr, ( | 1438 print >> sys.stderr, ( |
1447 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 1439 'AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
1448 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) | 1440 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e)) |
1449 return 1 | 1441 return 1 |
1450 | 1442 |
1451 | 1443 |
1452 if __name__ == "__main__": | 1444 if __name__ == "__main__": |
1453 fix_encoding.fix_encoding() | 1445 fix_encoding.fix_encoding() |
1454 sys.exit(main(sys.argv[1:])) | 1446 sys.exit(main(sys.argv[1:])) |
OLD | NEW |