@retry(exception=(EnvironmentError, AssertionError), logfun=None, timeout=GLOBAL_TIMEOUT, interval=0.001)
def wait_for_file(fname, delete_file=True, empty=False):
 with open(fname, 'rb') as f:
  data = f.read()
 if (not empty):
  assert data
 if delete_file:
  os.remove(fname)
 return data

@ retry ( exception = ( EnvironmentError , AssertionError ) , logfun = None , timeout = GLOBAL_TIMEOUT , interval = 0.001 ) def wait_for_file ( fname , delete_file = True , empty = False ) : with open ( fname , 'rb' ) as f : data = f . read ( ) if ( not empty ) : assert data if delete_file : os . remove ( fname ) return data
wait for a file to be written on disk with some content .