Open psresnik opened 2 weeks ago
Never mind! The following worked:
def create_label(label):
gmail = Gmail()
labels = gmail.list_labels()
if label not in [label.name for label in labels]:
print(f"Adding new label {label} to account")
gmail.create_label(label)
else:
print(f"Verified that label {label} exists in account")
The add_label routine will fail if the label doesn't already exist for the account. Can a create_label_in_account functionality be added? E.g. something along the lines of the following? (I've thought about forking the repo and doing this myself, but I don't have a lot of experience doing that so I thought I'd start with a feature request, thanks...)