[Merge] lp:~chris.gagnon/gallery-app/autopilot-fix-first-photo-in-album-view into lp:gallery-app

Leo Arias leo.arias at canonical.com
Mon May 26 06:26:11 UTC 2014


Review: Needs Fixing code review

21	+ first_photo = None
22	+ for photo in photos:
23	+ if first_photo is None:
24	+ first_photo = photo
25	+ elif(
26	+ photo.globalRect.x < first_photo.globalRect.x and
27	+ photo.globalRect.y < first_photo.globalRect.y
28	+ ):
29	+ first_photo = photo
30	+ return first_photo

I think that you can use this instead:

photos = sorted(photos, key=lambda photo: (photo.globalRect.y, photo.globalRect.x))
return photos[0]

19	+ photos = self.app.select_many(
20	+ "FramePortrait", visible=True, isLoaded=True)

45	+ self.app.select_many(
46	+ "FramePortrait",
47	+ visible=True,
48	+ isLoaded=True)

You can make that a method called _get_loaded_frame_portraits.
-- 
https://code.launchpad.net/~chris.gagnon/gallery-app/autopilot-fix-first-photo-in-album-view/+merge/220807
Your team Ubuntu Phablet Team is requested to review the proposed merge of lp:~chris.gagnon/gallery-app/autopilot-fix-first-photo-in-album-view into lp:gallery-app.



More information about the Ubuntu-reviews mailing list