def unpack_load_data_temp(self, label): temp_dir = tempfile.mkdtemp() tar = tarfile.open(label) tar.extractall(temp_dir) settings.SCRAPE_FEED_PATH = temp_dir + '/SCRAPE_FEED_PATH' settings.SCRAPE_IMAGES_PATH = os.path.join(temp_dir, 'SCRAPE_IMAGES_PATH') consumer = ScrapeFeedConsumer() parser = EventAdapter() for event in consumer.events(): parser.parse(event) #delete temporary directory shutil.rmtree(temp_dir)
def handle_noargs(self, **options): consumer = ScrapeFeedConsumer() parser = EventAdapter() for event in consumer.events(): parser.parse(event)