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.
« Back to merge proposal
21 + first_photo = None globalRect. x and globalRect. y
22 + for photo in photos:
23 + if first_photo is None:
24 + first_photo = photo
25 + elif(
26 + photo.globalRect.x < first_photo.
27 + photo.globalRect.y < first_photo.
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.globalRec t.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 .