mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-06 05:41:36 +00:00
Merge branch 'master' of https://github.com/jay0lee/GAM
This commit is contained in:
@@ -82,7 +82,7 @@ class ControlFlowTest(unittest.TestCase):
|
|||||||
# Suppress messages while we make a lot of attempts.
|
# Suppress messages while we make a lot of attempts.
|
||||||
error_print_threshold=total_attempts + 1)
|
error_print_threshold=total_attempts + 1)
|
||||||
# Wait time may be between 60 and 61 secs, due to rand addition.
|
# Wait time may be between 60 and 61 secs, due to rand addition.
|
||||||
self.assertLess(mock_sleep.call_args[0][0], 61)
|
self.assertLessEqual(mock_sleep.call_args[0][0], 61)
|
||||||
|
|
||||||
# Prevent the system from actually sleeping and thus slowing down the test.
|
# Prevent the system from actually sleeping and thus slowing down the test.
|
||||||
@patch.object(controlflow.time, 'sleep')
|
@patch.object(controlflow.time, 'sleep')
|
||||||
|
|||||||
14
src/gam.py
14
src/gam.py
@@ -56,12 +56,7 @@ from multiprocessing import Pool as mp_pool
|
|||||||
from multiprocessing import freeze_support as mp_freeze_support
|
from multiprocessing import freeze_support as mp_freeze_support
|
||||||
from multiprocessing import set_start_method as mp_set_start_method
|
from multiprocessing import set_start_method as mp_set_start_method
|
||||||
from urllib.parse import urlencode, urlparse
|
from urllib.parse import urlencode, urlparse
|
||||||
# workaround https://bitbucket.org/ecollins/passlib/issues/107/timeclock-has-gone
|
|
||||||
# can be removed with passlib > 1.7.1
|
|
||||||
if sys.platform == 'win32' and sys.version_info[1] >= 8:
|
|
||||||
time.clock = time.time
|
|
||||||
from passlib.hash import sha512_crypt
|
from passlib.hash import sha512_crypt
|
||||||
time.__dict__.pop('clock', None)
|
|
||||||
import dateutil.parser
|
import dateutil.parser
|
||||||
|
|
||||||
import googleapiclient
|
import googleapiclient
|
||||||
@@ -7460,8 +7455,11 @@ def getUserAttributes(i, cd, updateCmd):
|
|||||||
i += 2
|
i += 2
|
||||||
elif myarg in ['recoveryphone']:
|
elif myarg in ['recoveryphone']:
|
||||||
body['recoveryPhone'] = sys.argv[i+1]
|
body['recoveryPhone'] = sys.argv[i+1]
|
||||||
if body['recoveryPhone'] and body['recoveryPhone'][0] != '+':
|
if body['recoveryPhone']:
|
||||||
|
if body['recoveryPhone'][0] != '+':
|
||||||
body['recoveryPhone'] = '+' + body['recoveryPhone']
|
body['recoveryPhone'] = '+' + body['recoveryPhone']
|
||||||
|
else:
|
||||||
|
body['recoveryPhone'] = None
|
||||||
i += 2
|
i += 2
|
||||||
elif myarg == 'clearschema':
|
elif myarg == 'clearschema':
|
||||||
if not updateCmd:
|
if not updateCmd:
|
||||||
@@ -7531,6 +7529,8 @@ class ShortURLFlow(google_auth_oauthlib.flow.InstalledAppFlow):
|
|||||||
if resp.status != 200:
|
if resp.status != 200:
|
||||||
return long_url, state
|
return long_url, state
|
||||||
try:
|
try:
|
||||||
|
if type(content) is bytes:
|
||||||
|
content = content.decode()
|
||||||
return json.loads(content).get('short_url', long_url), state
|
return json.loads(content).get('short_url', long_url), state
|
||||||
except:
|
except:
|
||||||
return long_url, state
|
return long_url, state
|
||||||
@@ -7686,7 +7686,7 @@ def _createClientSecretsOauth2service(httpObj, projectId):
|
|||||||
name=service_account['name'], body={'privateKeyType': 'TYPE_GOOGLE_CREDENTIALS_FILE', 'keyAlgorithm': 'KEY_ALG_RSA_2048'})
|
name=service_account['name'], body={'privateKeyType': 'TYPE_GOOGLE_CREDENTIALS_FILE', 'keyAlgorithm': 'KEY_ALG_RSA_2048'})
|
||||||
oauth2service_data = base64.b64decode(key['privateKeyData']).decode(UTF8)
|
oauth2service_data = base64.b64decode(key['privateKeyData']).decode(UTF8)
|
||||||
writeFile(GC_Values[GC_OAUTH2SERVICE_JSON], oauth2service_data, continueOnError=False)
|
writeFile(GC_Values[GC_OAUTH2SERVICE_JSON], oauth2service_data, continueOnError=False)
|
||||||
console_credentials_url = 'https://console.developers.google.com/apis/credentials/consent?createClient&project=%s' % projectId
|
console_credentials_url = 'https://console.developers.google.com/apis/credentials/consent/edit?createClient&newAppInternalUser=true&project=%s' % projectId
|
||||||
while True:
|
while True:
|
||||||
print('''Please go to:
|
print('''Please go to:
|
||||||
|
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ google-auth
|
|||||||
google-auth-httplib2
|
google-auth-httplib2
|
||||||
google-auth-oauthlib>=0.4.1
|
google-auth-oauthlib>=0.4.1
|
||||||
httplib2>=0.13.0
|
httplib2>=0.13.0
|
||||||
passlib
|
passlib>=1.7.2
|
||||||
|
|||||||
Reference in New Issue
Block a user