def _async_photo_processing(self):
		#start downloading photo stream
		ps = PhotoStream()
		ps.get_pop_photo_stream()
		#start parsing photo stream in another thread
		t = threading.Thread(target=ps.parse_photo_stream)
		t.start()		
		t.join()
Beispiel #2
0
 def _async_photo_processing(self):
     #start downloading photo stream
     for cat in PHOTO_CATEGORIES:
         ps = PhotoStream()
         photo_list = ps.request_pop_photo_stream(cat, 0)
         located_photos = ps.get_located_photos(photo_list, cat)
         if len(located_photos) > 0:
             ps.save_photo_stream_to_db(located_photos, cat)
Beispiel #3
0
from pop_photo_grab import PhotoStream
import json
from db_helper import mydb

ps = PhotoStream()
col = mydb.photos
photo_list = list(col.find().limit(10))
print len(photo_list)
ps.parse_photo_stream(photo_list,8)
Beispiel #4
0
from pop_photo_grab import PhotoStream
import json
from db_helper import mydb

ps = PhotoStream()
col = mydb.photos
photo_list = list(col.find().limit(10))
print len(photo_list)
ps.parse_photo_stream(photo_list, 8)