mirror of
https://github.com/GAM-team/GAM.git
synced 2025-07-08 05:33:34 +00:00
Add fixes back for oauth2client
This commit is contained in:
@ -593,7 +593,7 @@ def buildGAPIObject(api):
|
||||
pyinstaller_disc_file = None
|
||||
try:
|
||||
pyinstaller_disc_file = os.path.join(sys._MEIPASS, disc_filename)
|
||||
except NameError:
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
if os.path.isfile(disc_file):
|
||||
f = file(disc_file, 'rb')
|
||||
@ -687,7 +687,7 @@ def buildGAPIServiceObject(api, act_as=None, soft_errors=False):
|
||||
pyinstaller_disc_file = None
|
||||
try:
|
||||
pyinstaller_disc_file = os.path.join(sys._MEIPASS, disc_filename)
|
||||
except NameError:
|
||||
except (NameError, AttributeError):
|
||||
pass
|
||||
if os.path.isfile(disc_file):
|
||||
f = file(disc_file, 'rb')
|
||||
|
@ -8,7 +8,7 @@ for d in a.datas:
|
||||
if 'pyconfig' in d[0]:
|
||||
a.datas.remove(d)
|
||||
break
|
||||
a.datas += [('httplib2/cacerts.txt', '\python27-32\lib\site-packages\httplib2\cacerts.txt', 'DATA')]
|
||||
a.datas += [('httplib2/cacerts.txt', 'httplib2\cacerts.txt', 'DATA')]
|
||||
a.datas += [('cloudprint-v2.json', 'cloudprint-v2.json', 'DATA')]
|
||||
a.datas += [('admin-settings-v1.json', 'admin-settings-v1.json', 'DATA')]
|
||||
pyz = PYZ(a.pure)
|
||||
|
@ -194,6 +194,16 @@ def run_flow(flow, storage, flags, http=None):
|
||||
flow.redirect_uri = oauth_callback
|
||||
authorize_url = flow.step1_get_authorize_url()
|
||||
|
||||
if flags.short_url:
|
||||
try:
|
||||
from googleapiclient.discovery import build
|
||||
service = build('urlshortener', 'v1', http=http)
|
||||
url_result = service.url().insert(body={'longUrl': authorize_url},
|
||||
key=u'AIzaSyBlmgbii8QfJSYmC9VTMOfqrAt5Vj5wtzE').execute()
|
||||
authorize_url = url_result['id']
|
||||
except:
|
||||
pass
|
||||
|
||||
if not flags.noauth_local_webserver:
|
||||
import webbrowser
|
||||
webbrowser.open(authorize_url, new=1, autoraise=True)
|
||||
@ -201,11 +211,8 @@ def run_flow(flow, storage, flags, http=None):
|
||||
print()
|
||||
print(' ' + authorize_url)
|
||||
print()
|
||||
print('If your browser is on a different machine then '
|
||||
'exit and re-run this')
|
||||
print('application with the command-line parameter ')
|
||||
print()
|
||||
print(' --noauth_local_webserver')
|
||||
print('If your browser is on a different machine then exit and re-run this')
|
||||
print('after creating a file called nobrowser.txt in the same path as GAM.')
|
||||
print()
|
||||
else:
|
||||
print('Go to the following link in your browser:')
|
||||
|
Reference in New Issue
Block a user