mirror of
https://github.com/GAM-team/GAM.git
synced 2025-07-08 21:53:36 +00:00
Bring gam oauth delete back, give creation message
This commit is contained in:
14
src/gam.py
14
src/gam.py
@ -8712,6 +8712,17 @@ def OAuthInfo():
|
|||||||
for scope in GM_Globals[GM_GAMSCOPES][api]:
|
for scope in GM_Globals[GM_GAMSCOPES][api]:
|
||||||
print u' {0}'.format(scope)
|
print u' {0}'.format(scope)
|
||||||
|
|
||||||
|
def doDeleteOAuth():
|
||||||
|
sys.stdout.write(u'Scopes file: {0}, will be Deleted in 3...'.format(GC_Values[GC_GAMSCOPES_JSON]))
|
||||||
|
time.sleep(1)
|
||||||
|
sys.stdout.write(u'2...')
|
||||||
|
time.sleep(1)
|
||||||
|
sys.stdout.write(u'1...')
|
||||||
|
time.sleep(1)
|
||||||
|
sys.stdout.write(u'boom!\n')
|
||||||
|
os.remove(GC_Values[GC_GAMSCOPES_JSON])
|
||||||
|
sys.stdout.write(u'Scopes file: {0}, Deleted\n'.format(GC_Values[GC_GAMSCOPES_JSON]))
|
||||||
|
|
||||||
UBER_SCOPES = {
|
UBER_SCOPES = {
|
||||||
u'gmail-v1': [u'https://mail.google.com/'],
|
u'gmail-v1': [u'https://mail.google.com/'],
|
||||||
u'drive-v2': [u'https://www.googleapis.com/auth/drive'],
|
u'drive-v2': [u'https://www.googleapis.com/auth/drive'],
|
||||||
@ -8798,6 +8809,7 @@ def doRequestOAuth():
|
|||||||
print u'YOU MUST SELECT AT LEAST ONE SCOPE'
|
print u'YOU MUST SELECT AT LEAST ONE SCOPE'
|
||||||
continue
|
continue
|
||||||
writeFile(GC_Values[GC_GAMSCOPES_JSON], json.dumps(json_scopes))
|
writeFile(GC_Values[GC_GAMSCOPES_JSON], json.dumps(json_scopes))
|
||||||
|
print u'Scopes file: {0}, Created'.format(GC_Values[GC_GAMSCOPES_JSON])
|
||||||
GM_Globals[GM_GAMSCOPES_CREATED] = True
|
GM_Globals[GM_GAMSCOPES_CREATED] = True
|
||||||
break
|
break
|
||||||
elif selection >= 0 and selection < len(all_apis.keys()):
|
elif selection >= 0 and selection < len(all_apis.keys()):
|
||||||
@ -9228,6 +9240,8 @@ try:
|
|||||||
doRequestOAuth()
|
doRequestOAuth()
|
||||||
elif sys.argv[2].lower() == u'info':
|
elif sys.argv[2].lower() == u'info':
|
||||||
OAuthInfo()
|
OAuthInfo()
|
||||||
|
elif sys.argv[2].lower() in [u'delete', u'revoke']:
|
||||||
|
doDeleteOAuth()
|
||||||
else:
|
else:
|
||||||
print u'ERROR: %s is not a valid argument for "gam oauth"' % sys.argv[2]
|
print u'ERROR: %s is not a valid argument for "gam oauth"' % sys.argv[2]
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
Reference in New Issue
Block a user