Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 def handle_noargs(self, **options):
     consumer = ScrapeFeedConsumer()
     parser = EventAdapter()
     for event in consumer.events():
         parser.parse(event)
Exemplo n.º 4
0
 def handle_noargs(self, **options):
     consumer = ScrapeFeedConsumer()
     parser = EventAdapter()
     for event in consumer.events():
         parser.parse(event)