245 now = time.time() |
245 now = time.time() |
246 print "- Completed %s - %d Kb in %d seconds" % (filename, (filesize/1024)+0.5, now-last_time) |
246 print "- Completed %s - %d Kb in %d seconds" % (filename, (filesize/1024)+0.5, now-last_time) |
247 |
247 |
248 #handle errors |
248 #handle errors |
249 except urllib2.HTTPError, e: |
249 except urllib2.HTTPError, e: |
250 print "HTTP Error:",e.code , downloadurl |
250 print "HTTP Error:",e.code , url |
251 return False |
251 return False |
252 except urllib2.URLError, e: |
252 except urllib2.URLError, e: |
253 print "URL Error:",e.reason , downloadurl |
253 print "URL Error:",e.reason , url |
254 return False |
254 return False |
255 return True |
255 return True |
256 |
256 |
257 def downloadkit(version): |
257 def downloadkit(version): |
258 global headers |
258 global headers |
308 # wait for the unzipping threads to complete |
308 # wait for the unzipping threads to complete |
309 complete_outstanding_unzips() |
309 complete_outstanding_unzips() |
310 |
310 |
311 return 1 |
311 return 1 |
312 |
312 |
313 parser = OptionParser(version="%prog 0.6", usage="Usage: %prog [options] version") |
313 parser = OptionParser(version="%prog 0.6.1", usage="Usage: %prog [options] version") |
314 parser.add_option("-n", "--dryrun", action="store_true", dest="dryrun", |
314 parser.add_option("-n", "--dryrun", action="store_true", dest="dryrun", |
315 help="print the files to be downloaded, the 7z commands, and the recommended deletions") |
315 help="print the files to be downloaded, the 7z commands, and the recommended deletions") |
316 parser.add_option("--nosrc", action="store_true", dest="nosrc", |
316 parser.add_option("--nosrc", action="store_true", dest="nosrc", |
317 help="Don't download any of the source code available directly from Mercurial") |
317 help="Don't download any of the source code available directly from Mercurial") |
318 parser.add_option("--nounzip", action="store_true", dest="nounzip", |
318 parser.add_option("--nounzip", action="store_true", dest="nounzip", |