Add a bit more debugging and pin python version to 3.7 since there are issues with 3.9
This commit is contained in:
parent
4af4f84147
commit
44a245bc9d
2
Makefile
2
Makefile
@ -4,7 +4,7 @@ default: add-photos
|
|||||||
virtualenv: virtualenv_run
|
virtualenv: virtualenv_run
|
||||||
|
|
||||||
virtualenv_run:
|
virtualenv_run:
|
||||||
virtualenv --python python3 virtualenv_run
|
virtualenv --python python3.7 virtualenv_run
|
||||||
./virtualenv_run/bin/pip install -r ./requirements.txt
|
./virtualenv_run/bin/pip install -r ./requirements.txt
|
||||||
|
|
||||||
build/email_to_photo.json: virtualenv_run
|
build/email_to_photo.json: virtualenv_run
|
||||||
|
@ -129,7 +129,7 @@ def main():
|
|||||||
request=service.people().connections().list(
|
request=service.people().connections().list(
|
||||||
resourceName='people/me',
|
resourceName='people/me',
|
||||||
pageSize=100,
|
pageSize=100,
|
||||||
personFields='emailAddresses,photos',
|
personFields='emailAddresses,photos,names',
|
||||||
),
|
),
|
||||||
key='connections',
|
key='connections',
|
||||||
)
|
)
|
||||||
@ -141,7 +141,15 @@ def main():
|
|||||||
for person in connections:
|
for person in connections:
|
||||||
count += 1
|
count += 1
|
||||||
|
|
||||||
logging.debug('Processing %s', person.get('resourceName'))
|
displayName = "Unknown"
|
||||||
|
if "names" in person:
|
||||||
|
displayName = person['names'][0]['displayName']
|
||||||
|
|
||||||
|
logging.info(
|
||||||
|
'Processing %s: %s',
|
||||||
|
person.get('resourceName'),
|
||||||
|
displayName,
|
||||||
|
)
|
||||||
primary_photo = get_primary_photo(person)
|
primary_photo = get_primary_photo(person)
|
||||||
if not primary_photo:
|
if not primary_photo:
|
||||||
logging.debug('No photo for person')
|
logging.debug('No photo for person')
|
||||||
@ -153,11 +161,12 @@ def main():
|
|||||||
emails = person.get('emailAddresses', [])
|
emails = person.get('emailAddresses', [])
|
||||||
if emails:
|
if emails:
|
||||||
all_photos.add(primary_photo)
|
all_photos.add(primary_photo)
|
||||||
|
else:
|
||||||
|
logging.debug("No email for person")
|
||||||
|
|
||||||
for email in emails:
|
for email in emails:
|
||||||
email_to_photo[email['value']] = primary_photo
|
email_to_photo[email['value']] = primary_photo
|
||||||
|
logging.debug('Added photos for email %s', email['value'])
|
||||||
logging.debug('Added photos for person')
|
|
||||||
|
|
||||||
if count % 50 == 0:
|
if count % 50 == 0:
|
||||||
logging.info('Found {} photos for {} emails'.format(
|
logging.info('Found {} photos for {} emails'.format(
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
google-api-python-client
|
google-api-python-client
|
||||||
khard
|
khard
|
||||||
vdirsyncer
|
vdirsyncer
|
||||||
|
oauth2client
|
||||||
|
@ -2,4 +2,4 @@
|
|||||||
# vdirsyncer-wrapper
|
# vdirsyncer-wrapper
|
||||||
# Wrapper around vdirsyncer that executes it from within virtualenv using local config
|
# Wrapper around vdirsyncer that executes it from within virtualenv using local config
|
||||||
|
|
||||||
./virtualenv_run/bin/vdirsyncer -c ./vdirsyncer.conf $*
|
./virtualenv_run/bin/vdirsyncer -vdebug -c ./vdirsyncer.conf $*
|
||||||
|
Loading…
Reference in New Issue
Block a user