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

Side by Side Diff: drover.py

Issue 11801007: Make getBranchForMilestone() explictly request the CSV data. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools@master
Patch Set: Created 7 years, 11 months 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 import optparse 6 import optparse
7 import os 7 import os
8 import re 8 import re
9 import string 9 import string
10 import sys 10 import sys
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 361
362 Anything that's A will require special treatment (either a merge or an 362 Anything that's A will require special treatment (either a merge or an
363 export + add) 363 export + add)
364 """ 364 """
365 return ['%s/%s' % (f[2], f[3]) for f in files_info] 365 return ['%s/%s' % (f[2], f[3]) for f in files_info]
366 366
367 367
368 def getBranchForMilestone(milestone): 368 def getBranchForMilestone(milestone):
369 """Queries omahaproxy.appspot.com for the branch number given |milestone|. 369 """Queries omahaproxy.appspot.com for the branch number given |milestone|.
370 """ 370 """
371 OMAHA_PROXY_URL = "http://omahaproxy.appspot.com" 371 OMAHA_PROXY_URL = "http://omahaproxy.appspot.com/all?csv=1"
372 request = urllib2.Request(OMAHA_PROXY_URL) 372 request = urllib2.Request(OMAHA_PROXY_URL)
373 try: 373 try:
374 response = urllib2.urlopen(request) 374 response = urllib2.urlopen(request)
375 except urllib2.HTTPError, e: 375 except urllib2.HTTPError, e:
376 print "Failed to query %s: %d" % (OMAHA_PROXY_URL, e.code) 376 print "Failed to query %s: %d" % (OMAHA_PROXY_URL, e.code)
377 return None 377 return None
378 378
379 # Dictionary of [branch: major]. When searching for the appropriate branch 379 # Dictionary of [branch: major]. When searching for the appropriate branch
380 # matching |milestone|, all major versions that match are added to the 380 # matching |milestone|, all major versions that match are added to the
381 # dictionary. If all of the branches are the same, this branch value is 381 # dictionary. If all of the branches are the same, this branch value is
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 673
674 if options.branch and options.milestone: 674 if options.branch and options.milestone:
675 option_parser.error("--branch cannot be used with --milestone") 675 option_parser.error("--branch cannot be used with --milestone")
676 return 1 676 return 1
677 677
678 return drover(options, args) 678 return drover(options, args)
679 679
680 680
681 if __name__ == "__main__": 681 if __name__ == "__main__":
682 sys.exit(main()) 682 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698