def handle(self, *args, **options):
        
        for CYCLE in ACTIVE_CYCLES:
        
        
            conn = S3Connection(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY)
            b = conn.get_bucket(AWS_STORAGE_BUCKET_NAME)
        
            for sked in ['e','b', 'a']:
                filename = "sked%s_%s.csv" % (sked, CYCLE)
            
                local_skedfile = "%s/%s" % (CSV_EXPORT_DIR, filename)
                print "Dumping sked %s to %s" % (sked, local_skedfile)
                dump_all_sked(sked, local_skedfile, CYCLE)
            
                # need to gzip these
                gzip_cmd = "gzip -f %s" % (local_skedfile)
                filename_zipped = filename + ".gz"
                local_skedfile_zipped = local_skedfile + ".gz"
                # old style os.system just works - subprocess sucks. 
                proc = os.system(gzip_cmd)
            
                s3_path = "%s/%s" % (AWS_BULK_EXPORT_PATH,filename_zipped)
                print "pushing %s to S3: bucket=%s path=%s" % (local_skedfile_zipped, AWS_STORAGE_BUCKET_NAME,s3_path)
                start = time.time()
                k = Key(b)
                k.key = s3_path
                k.set_contents_from_filename(local_skedfile_zipped, policy='public-read')
                elapsed_time = time.time() - start
                print "elapsed time for pushing to s3 is %s" % (elapsed_time)
            
        
        # if we didn't die, set the update time
        set_update(BULK_EXPORT_KEY)
dataset/ETHPy150Open sunlightlabs/read_FEC/fecreader/summary_data/management/commands/export_bulk_files_to_s3.py/Command.handle/original