Cosmetic cleanup

This commit is contained in:
Ross Scroggs
2016-03-17 16:22:15 -07:00
parent 6b0fce21a5
commit a3c509ce61

View File

@ -4479,7 +4479,7 @@ def labelsToLabelIds(gmail, labels):
allLabels[a_label['name']] = a_label['id'] allLabels[a_label['name']] = a_label['id']
if label not in allLabels: if label not in allLabels:
# if still not there, create it # if still not there, create it
label_results = callGAPI(service=gmail.users().labels(), function='create', label_results = callGAPI(gmail.users().labels(), 'create',
body={'labelListVisibility': 'labelShow', body={'labelListVisibility': 'labelShow',
'messageListVisibility': 'show', 'name': label}, 'messageListVisibility': 'show', 'name': label},
userId='me', fields='id') userId='me', fields='id')
@ -4493,8 +4493,8 @@ def labelsToLabelIds(gmail, labels):
parent_label = label[:label.rfind('/')] parent_label = label[:label.rfind('/')]
while True: while True:
if not parent_label in allLabels: if not parent_label in allLabels:
label_result = callGAPI(service=gmail.users().labels(), label_result = callGAPI(service=gmail.users().labels(), 'create',
function='create', userId='me', body={'name': parent_label}) userId='me', body={'name': parent_label})
allLabels[parent_label] = label_result['id'] allLabels[parent_label] = label_result['id']
if parent_label.find('/') == -1: if parent_label.find('/') == -1:
break break