showLabels handle non-Gmail users

This commit is contained in:
Jay Lee
2015-12-23 06:55:22 -05:00
parent ade2d0ae54
commit 1dd36424be

View File

@ -4534,16 +4534,17 @@ def showLabels(users):
sys.exit(2)
for user in users:
gmail = buildGAPIServiceObject(u'gmail', user)
labels = callGAPI(service=gmail.users().labels(), function=u'list', userId=user)
for label in labels[u'labels']:
if label[u'type'] == u'system' and not show_system:
continue
print convertUTF8(label[u'name'])
for a_key in label:
if a_key == u'name':
labels = callGAPI(service=gmail.users().labels(), function=u'list', userId=user, soft_errors=True)
if labels:
for label in labels[u'labels']:
if label[u'type'] == u'system' and not show_system:
continue
print u' %s: %s' % (a_key, label[a_key])
print u''
print convertUTF8(label[u'name'])
for a_key in label:
if a_key == u'name':
continue
print u' %s: %s' % (a_key, label[a_key])
print u''
def showGmailProfile(users):
todrive = False