| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 # git-cl -- a git-command for integrating reviews on Rietveld | 2 # git-cl -- a git-command for integrating reviews on Rietveld |
| 3 # Copyright (C) 2008 Evan Martin <martine@danga.com> | 3 # Copyright (C) 2008 Evan Martin <martine@danga.com> |
| 4 | 4 |
| 5 import errno | 5 import errno |
| 6 import logging | 6 import logging |
| 7 import optparse | 7 import optparse |
| 8 import os | 8 import os |
| 9 import re | 9 import re |
| 10 import subprocess | 10 import subprocess |
| 11 import sys | 11 import sys |
| 12 import tempfile | 12 import tempfile |
| 13 import textwrap | 13 import textwrap |
| 14 import upload | 14 import upload |
| 15 import urlparse |
| 15 import urllib2 | 16 import urllib2 |
| 16 | 17 |
| 17 try: | 18 try: |
| 18 import readline | 19 import readline |
| 19 except ImportError: | 20 except ImportError: |
| 20 pass | 21 pass |
| 21 | 22 |
| 22 try: | 23 try: |
| 23 # Add the parent directory in case it's a depot_tools checkout. | 24 # Add the parent directory in case it's a depot_tools checkout. |
| 24 depot_tools_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) | 25 depot_tools_path = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) |
| (...skipping 1145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1170 except ImportError: | 1171 except ImportError: |
| 1171 try: | 1172 try: |
| 1172 import json | 1173 import json |
| 1173 # Some versions of python2.5 have an incomplete json module. Check to make | 1174 # Some versions of python2.5 have an incomplete json module. Check to make |
| 1174 # sure loads exists. | 1175 # sure loads exists. |
| 1175 json.loads | 1176 json.loads |
| 1176 except (ImportError, AttributeError): | 1177 except (ImportError, AttributeError): |
| 1177 print >> sys.stderr, 'Please install simplejson' | 1178 print >> sys.stderr, 'Please install simplejson' |
| 1178 sys.exit(1) | 1179 sys.exit(1) |
| 1179 | 1180 |
| 1180 json_url = 'http://chromium-status.appspot.com/current?format=json' | 1181 url = settings.GetTreeStatusUrl() |
| 1182 json_url = urlparse.urljoin(url, '/current?format=json') |
| 1181 connection = urllib2.urlopen(json_url) | 1183 connection = urllib2.urlopen(json_url) |
| 1182 status = json.loads(connection.read()) | 1184 status = json.loads(connection.read()) |
| 1183 connection.close() | 1185 connection.close() |
| 1184 return status['message'] | 1186 return status['message'] |
| 1185 | 1187 |
| 1186 def CMDtree(parser, args): | 1188 def CMDtree(parser, args): |
| 1187 """show the status of the tree""" | 1189 """show the status of the tree""" |
| 1188 (options, args) = parser.parse_args(args) | 1190 (options, args) = parser.parse_args(args) |
| 1189 status = GetTreeStatus() | 1191 status = GetTreeStatus() |
| 1190 if 'unset' == status: | 1192 if 'unset' == status: |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1267 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' | 1269 ('AppEngine is misbehaving and returned HTTP %d, again. Keep faith ' |
| 1268 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) | 1270 'and retry or visit go/isgaeup.\n%s') % (e.code, str(e))) |
| 1269 | 1271 |
| 1270 # Not a known command. Default to help. | 1272 # Not a known command. Default to help. |
| 1271 GenUsage(parser, 'help') | 1273 GenUsage(parser, 'help') |
| 1272 return CMDhelp(parser, argv) | 1274 return CMDhelp(parser, argv) |
| 1273 | 1275 |
| 1274 | 1276 |
| 1275 if __name__ == '__main__': | 1277 if __name__ == '__main__': |
| 1276 sys.exit(main(sys.argv[1:])) | 1278 sys.exit(main(sys.argv[1:])) |
| OLD | NEW |