def process_hour(hour_date):
 SLEEPTIME = 180
 log_dir = os.path.join(RAW_LOG_DIR, hour_date)
 files_missing = [os.path.join(log_dir, ('%s.log.bz2' % h)) for h in g.TRAFFIC_LOG_HOSTS]
 files_missing = [f for f in files_missing if (not s3_key_exists(s3_connection, f))]
 while files_missing:
  print ('Missing log(s) %s, sleeping' % files_missing)
  sleep(SLEEPTIME)
  files_missing = [f for f in files_missing if (not s3_key_exists(s3_connection, f))]
 process_pixel_log(os.path.join(log_dir, '*'))

def process_hour ( hour_date ) : SLEEPTIME = 180 log_dir = os . path . join ( RAW_LOG_DIR , hour_date ) files_missing = [ os . path . join ( log_dir , ( '%s.log.bz2' % h ) ) for h in g . TRAFFIC_LOG_HOSTS ] files_missing = [ f for f in files_missing if ( not s3_key_exists ( s3_connection , f ) ) ] while files_missing : print ( 'Missing log(s) %s, sleeping' % files_missing ) sleep ( SLEEPTIME ) files_missing = [ f for f in files_missing if ( not s3_key_exists ( s3_connection , f ) ) ] process_pixel_log ( os . path . join ( log_dir , '*' ) )
process hour_dates traffic .