def block_until_http_ready(urlstring, wait_time=10, timeout=240):
 server_ready = False
 t_elapsed = 0
 while ((not server_ready) and (t_elapsed < timeout)):
  try:
   sys.stdout.write('.')
   sys.stdout.flush()
   req = urllib2.Request(urlstring)
   response = urllib2.urlopen(req)
   server_ready = True
  except urllib2.URLError:
   pass
  time.sleep(wait_time)
  t_elapsed += wait_time

def block_until_http_ready ( urlstring , wait_time = 10 , timeout = 240 ) : server_ready = False t_elapsed = 0 while ( ( not server_ready ) and ( t_elapsed < timeout ) ) : try : sys . stdout . write ( '.' ) sys . stdout . flush ( ) req = urllib2 . Request ( urlstring ) response = urllib2 . urlopen ( req ) server_ready = True except urllib2 . URLError : pass time . sleep ( wait_time ) t_elapsed += wait_time
blocks until server at urlstring can respond to http requests .