def _open_logfile(logfile_base_name):
 timestamp = int(time.time())
 while True:
  logfile_name = ('%s.%d-%d.gz' % (logfile_base_name, timestamp, os.getpid()))
  if (not os.path.exists(logfile_name)):
   break
  timestamp += 1
 logfile = gzip.GzipFile(logfile_name, 'w')
 return logfile

def _open_logfile ( logfile_base_name ) : timestamp = int ( time . time ( ) ) while True : logfile_name = ( '%s.%d-%d.gz' % ( logfile_base_name , timestamp , os . getpid ( ) ) ) if ( not os . path . exists ( logfile_name ) ) : break timestamp += 1 logfile = gzip . GzipFile ( logfile_name , 'w' ) return logfile
opens an output file using the given name .