def _schedule(list_id, timestamp): global log, blast_ids blast = Blast(_config.BLAST_XML_FILE, timestamp, (list_id,)) print >> log, blast.tostring(pretty_print=True) response = blast.create() id = utils.getId(resp) blast_ids.write("%s," % id)
def run(list_ids, upload_ids): import_ids = [] for i in range(min(len(list_ids), len(upload_ids))): # create Import instance imp = Import(upload_ids[i]) imp.addCol('email_address') imp.setLists(list_ids[i]) # execute http transfer try: resp = imp.create() id = utils.getId(resp) import_ids.append(id) print id, except utils.HttpException as err: print >> sys.err, 'Exception at _streamsend_imports.py#run() - line 18-21' print >> sys.err, '\t', err print return import_ids
def run(): upload_ids = [] files = glob.iglob("%s/*.txt" % _config.DIR_OF_USER_LISTS) for file in files: httpresp = upload.create(file) try: id = utils.getId(httpresp) upload_ids.append(id) fileNumber = os.path.splitext(os.path.basename(file))[0] print ("{%s:%s} " % (fileNumber, id)), except Exception as (msg): print >> sys.err, 'Exception at _streamsend_uploads.py#run() - line 16-19' print >> sys.err, '\t', msg print return upload_ids