def get_link(): random = randomString(20) if not id in S3Utils.get_events_id(): rd = '/tmp/' + randomString(20) + '/' os.makedirs(rd) zf = zipfile.ZipFile(rd + 'archive-1.zip', mode='w') zf.close() S3Utils.addEmptyArch('archives/' + random + '/archive-1.zip', rd + 'archive-1.zip') return random else: return get_link()
def exist(id): return (id in S3Utils.get_events_id())