From 7ec57759fa8fe86b9920c3c691f0f9c28f156cdc Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Mon, 6 Feb 2012 08:07:51 -0500 Subject: [PATCH] Fixing sillyness with fetching all photos. Weirdness encountered earlier with `.findall` must have been my imagination. --- timewarp.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/timewarp.py b/timewarp.py index 4edb832..901e782 100644 --- a/timewarp.py +++ b/timewarp.py @@ -32,7 +32,7 @@ class TimeWarper(object): return 0 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( photo_id=photo.attrib['id'], date_posted=set_to_date @@ -45,7 +45,7 @@ class TimeWarper(object): i = 1 while True: page = self.flickr.photos_search(**query) - if len(page.getchildren()[0].getchildren()): + if len(page.findall('photos/photo')): yield i, page i += 1 else: