DEV Community

Discussion on: Manage your Google Photo account with Python! (p.1)

Collapse
 
davidedelpapa profile image
Davide Del Papa

You are welcome. I made the lib to script access to my wedding pics myself, so I guess your use case should be not too difficult to tackle as well.
Good luck 🤞

Collapse
 
clanmills profile image
Robin Mills

Davide: I love your code. It's beautiful and clear.

I fixed a tiny bug in album.py. When I iterate the albums (I have 250 albums) the loop dies at the end saying "object isn't interable:"

    'title': 'BoysInSanJose2002'}
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/3.8/site-packages/gphotospy/album.py", line 533, in list
    for album in curr_list:
TypeError: 'NoneType' object is not iterable
Enter fullscreen mode Exit fullscreen mode

Here's my fix:

0a1
> from collections.abc import Iterable
533,534c534,536
<             for album in curr_list:
<                 yield album
---
>             if isinstance(curr_list, Iterable):
>                 for album in curr_list:
>                     yield album
Enter fullscreen mode Exit fullscreen mode

Question. Is the code in GitHub. Can I provide a PR if I find other issues?