Fixing sillyness with fetching all photos. Weirdness encountered earlier with .findall
must have been my imagination.
This commit is contained in:
parent
7addaa6552
commit
7ec57759fa
@ -32,7 +32,7 @@ class TimeWarper(object):
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
def _set_upload_date_for_photos(self, pagenum, page, set_to_date):
|
def _set_upload_date_for_photos(self, pagenum, page, set_to_date):
|
||||||
for i, photo in enumerate(page.getchildren()[0].getchildren()):
|
for i, photo in enumerate(page.findall('photos/photo'):
|
||||||
setdate_response = self.flickr.photos_setDates(
|
setdate_response = self.flickr.photos_setDates(
|
||||||
photo_id=photo.attrib['id'],
|
photo_id=photo.attrib['id'],
|
||||||
date_posted=set_to_date
|
date_posted=set_to_date
|
||||||
@ -45,7 +45,7 @@ class TimeWarper(object):
|
|||||||
i = 1
|
i = 1
|
||||||
while True:
|
while True:
|
||||||
page = self.flickr.photos_search(**query)
|
page = self.flickr.photos_search(**query)
|
||||||
if len(page.getchildren()[0].getchildren()):
|
if len(page.findall('photos/photo')):
|
||||||
yield i, page
|
yield i, page
|
||||||
i += 1
|
i += 1
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user