Skip to content

Commit

Permalink
use createLabel for parent labels also
Browse files Browse the repository at this point in the history
  • Loading branch information
jay0lee committed Mar 5, 2020
1 parent f253d2b commit 9b22028
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions gyb.py
Original file line number Diff line number Diff line change
Expand Up @@ -1331,9 +1331,7 @@ def labelsToLabelIds(labels):
parent_label = label[:label.rfind('/')]
while True:
if not parent_label in allLabels:
label_result = callGAPI(gmail.users().labels(),
'create', userId='me', body={'name': parent_label})
allLabels[parent_label] = label_result['id']
createLabel(parent_label)
if parent_label.find('/') == -1:
break
parent_label = parent_label[:parent_label.rfind('/')]
Expand Down

0 comments on commit 9b22028

Please sign in to comment.