gam7 7.24.0__py3-none-any.whl → 7.25.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gam7 might be problematic. Click here for more details.
- gam/__init__.py +30 -19
- gam/__main__.py +6 -1
- gam/gamlib/glapi.py +29 -22
- gam/gamlib/glcfg.py +4 -0
- {gam7-7.24.0.dist-info → gam7-7.25.0.dist-info}/METADATA +1 -1
- {gam7-7.24.0.dist-info → gam7-7.25.0.dist-info}/RECORD +9 -9
- {gam7-7.24.0.dist-info → gam7-7.25.0.dist-info}/WHEEL +0 -0
- {gam7-7.24.0.dist-info → gam7-7.25.0.dist-info}/entry_points.txt +0 -0
- {gam7-7.24.0.dist-info → gam7-7.25.0.dist-info}/licenses/LICENSE +0 -0
gam/__init__.py
CHANGED
|
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
|
|
25
25
|
"""
|
|
26
26
|
|
|
27
27
|
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
|
28
|
-
__version__ = '7.
|
|
28
|
+
__version__ = '7.25.00'
|
|
29
29
|
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
|
30
30
|
|
|
31
31
|
#pylint: disable=wrong-import-position
|
|
@@ -2113,12 +2113,12 @@ class StartEndTime():
|
|
|
2113
2113
|
else:
|
|
2114
2114
|
firstMonth = getInteger(minVal=1, maxVal=6)
|
|
2115
2115
|
currDate = todaysDate()
|
|
2116
|
-
self.startDateTime = currDate.
|
|
2116
|
+
self.startDateTime = currDate.replace(day=1, hour=0, minute=0, second=0, microsecond=0).shift(months=-firstMonth)
|
|
2117
2117
|
self.startTime = ISOformatTimeStamp(self.startDateTime)
|
|
2118
2118
|
if myarg == 'thismonth':
|
|
2119
2119
|
self.endDateTime = todaysTime()
|
|
2120
2120
|
else:
|
|
2121
|
-
self.endDateTime = currDate.
|
|
2121
|
+
self.endDateTime = currDate.replace(day=1, hour=23, minute=59, second=59, microsecond=0).shift(days=-1)
|
|
2122
2122
|
self.endTime = ISOformatTimeStamp(self.endDateTime)
|
|
2123
2123
|
if self.startDateTime and self.endDateTime and self.endDateTime < self.startDateTime:
|
|
2124
2124
|
Cmd.Backup()
|
|
@@ -3049,7 +3049,10 @@ def getGDocData(gformat):
|
|
|
3049
3049
|
mimeType = GDOC_FORMAT_MIME_TYPES[gformat]
|
|
3050
3050
|
user = getEmailAddress()
|
|
3051
3051
|
fileIdEntity = getDriveFileEntity(queryShortcutsOK=False)
|
|
3052
|
-
|
|
3052
|
+
if not GC.Values[GC.COMMANDDATA_CLIENTACCESS]:
|
|
3053
|
+
_, drive = buildGAPIServiceObject(API.DRIVE3, user)
|
|
3054
|
+
else:
|
|
3055
|
+
drive = buildGAPIObject(API.DRIVE3)
|
|
3053
3056
|
if not drive:
|
|
3054
3057
|
sys.exit(GM.Globals[GM.SYSEXITRC])
|
|
3055
3058
|
_, _, jcount = _validateUserGetFileIDs(user, 0, 0, fileIdEntity, drive=drive)
|
|
@@ -3106,7 +3109,10 @@ def getGSheetData():
|
|
|
3106
3109
|
user = getEmailAddress()
|
|
3107
3110
|
fileIdEntity = getDriveFileEntity(queryShortcutsOK=False)
|
|
3108
3111
|
sheetEntity = getSheetEntity(False)
|
|
3109
|
-
|
|
3112
|
+
if not GC.Values[GC.COMMANDDATA_CLIENTACCESS]:
|
|
3113
|
+
user, drive = buildGAPIServiceObject(API.DRIVE3, user)
|
|
3114
|
+
else:
|
|
3115
|
+
drive = buildGAPIObject(API.DRIVE3)
|
|
3110
3116
|
if not drive:
|
|
3111
3117
|
sys.exit(GM.Globals[GM.SYSEXITRC])
|
|
3112
3118
|
_, _, jcount = _validateUserGetFileIDs(user, 0, 0, fileIdEntity, drive=drive)
|
|
@@ -3114,7 +3120,10 @@ def getGSheetData():
|
|
|
3114
3120
|
getGDocSheetDataFailedExit([Ent.USER, user], Msg.NO_ENTITIES_FOUND.format(Ent.Singular(Ent.DRIVE_FILE)))
|
|
3115
3121
|
if jcount > 1:
|
|
3116
3122
|
getGDocSheetDataFailedExit([Ent.USER, user], Msg.MULTIPLE_ENTITIES_FOUND.format(Ent.Plural(Ent.DRIVE_FILE), jcount, ','.join(fileIdEntity['list'])))
|
|
3117
|
-
|
|
3123
|
+
if not GC.Values[GC.COMMANDDATA_CLIENTACCESS]:
|
|
3124
|
+
_, sheet = buildGAPIServiceObject(API.SHEETS, user)
|
|
3125
|
+
else:
|
|
3126
|
+
sheet = buildGAPIObject(API.SHEETS)
|
|
3118
3127
|
if not sheet:
|
|
3119
3128
|
sys.exit(GM.Globals[GM.SYSEXITRC])
|
|
3120
3129
|
fileId = fileIdEntity['list'][0]
|
|
@@ -9596,7 +9605,7 @@ def CSVFileQueueHandler(mpQueue, mpQueueStdout, mpQueueStderr, csvPF, datetimeNo
|
|
|
9596
9605
|
clearRowFilters = False
|
|
9597
9606
|
# if sys.platform.startswith('win'):
|
|
9598
9607
|
# signal.signal(signal.SIGINT, signal.SIG_IGN)
|
|
9599
|
-
if multiprocessing.get_start_method()
|
|
9608
|
+
if multiprocessing.get_start_method() != 'fork':
|
|
9600
9609
|
signal.signal(signal.SIGINT, signal.SIG_IGN)
|
|
9601
9610
|
Cmd = glclargs.GamCLArgs()
|
|
9602
9611
|
else:
|
|
@@ -9638,7 +9647,7 @@ def CSVFileQueueHandler(mpQueue, mpQueueStdout, mpQueueStderr, csvPF, datetimeNo
|
|
|
9638
9647
|
Cmd.InitializeArguments(dataItem)
|
|
9639
9648
|
elif dataType == GM.REDIRECT_QUEUE_GLOBALS:
|
|
9640
9649
|
GM.Globals = dataItem
|
|
9641
|
-
if multiprocessing.get_start_method()
|
|
9650
|
+
if multiprocessing.get_start_method() != 'fork':
|
|
9642
9651
|
reopenSTDFile(GM.STDOUT)
|
|
9643
9652
|
reopenSTDFile(GM.STDERR)
|
|
9644
9653
|
elif dataType == GM.REDIRECT_QUEUE_VALUES:
|
|
@@ -9684,7 +9693,7 @@ def initializeCSVFileQueueHandler(mpManager, mpQueueStdout, mpQueueStderr):
|
|
|
9684
9693
|
def terminateCSVFileQueueHandler(mpQueue, mpQueueHandler):
|
|
9685
9694
|
GM.Globals[GM.PARSER] = None
|
|
9686
9695
|
GM.Globals[GM.CSVFILE][GM.REDIRECT_QUEUE] = None
|
|
9687
|
-
if multiprocessing.get_start_method()
|
|
9696
|
+
if multiprocessing.get_start_method() != 'fork':
|
|
9688
9697
|
mpQueue.put((GM.REDIRECT_QUEUE_ARGS, Cmd.AllArguments()))
|
|
9689
9698
|
savedValues = saveNonPickleableValues()
|
|
9690
9699
|
mpQueue.put((GM.REDIRECT_QUEUE_GLOBALS, GM.Globals))
|
|
@@ -9714,13 +9723,13 @@ def StdQueueHandler(mpQueue, stdtype, gmGlobals, gcValues):
|
|
|
9714
9723
|
|
|
9715
9724
|
# if sys.platform.startswith('win'):
|
|
9716
9725
|
# signal.signal(signal.SIGINT, signal.SIG_IGN)
|
|
9717
|
-
if multiprocessing.get_start_method()
|
|
9726
|
+
if multiprocessing.get_start_method() != 'fork':
|
|
9718
9727
|
signal.signal(signal.SIGINT, signal.SIG_IGN)
|
|
9719
9728
|
GM.Globals = gmGlobals.copy()
|
|
9720
9729
|
GC.Values = gcValues.copy()
|
|
9721
9730
|
pid0DataItem = [KEYBOARD_INTERRUPT_RC, None]
|
|
9722
9731
|
pidData = {}
|
|
9723
|
-
if multiprocessing.get_start_method()
|
|
9732
|
+
if multiprocessing.get_start_method() != 'fork':
|
|
9724
9733
|
if GM.Globals[stdtype][GM.REDIRECT_NAME] == 'null':
|
|
9725
9734
|
fd = open(os.devnull, GM.Globals[stdtype][GM.REDIRECT_MODE], encoding=UTF8)
|
|
9726
9735
|
elif GM.Globals[stdtype][GM.REDIRECT_NAME] == '-':
|
|
@@ -9808,7 +9817,7 @@ def ProcessGAMCommandMulti(pid, numItems, logCmd, mpQueueCSVFile, mpQueueStdout,
|
|
|
9808
9817
|
with mplock:
|
|
9809
9818
|
initializeLogging()
|
|
9810
9819
|
# if sys.platform.startswith('win'):
|
|
9811
|
-
if multiprocessing.get_start_method()
|
|
9820
|
+
if multiprocessing.get_start_method() != 'fork':
|
|
9812
9821
|
signal.signal(signal.SIGINT, signal.SIG_IGN)
|
|
9813
9822
|
GM.Globals[GM.API_CALLS_RETRY_DATA] = {}
|
|
9814
9823
|
GM.Globals[GM.CMDLOG_LOGGER] = None
|
|
@@ -9949,7 +9958,7 @@ def MultiprocessGAMCommands(items, showCmds):
|
|
|
9949
9958
|
mpManager = multiprocessing.Manager()
|
|
9950
9959
|
l = mpManager.Lock()
|
|
9951
9960
|
try:
|
|
9952
|
-
if multiprocessing.get_start_method()
|
|
9961
|
+
if multiprocessing.get_start_method() != 'fork':
|
|
9953
9962
|
pool = mpManager.Pool(processes=numPoolProcesses, initializer=initGamWorker, initargs=(l,), maxtasksperchild=200)
|
|
9954
9963
|
else:
|
|
9955
9964
|
pool = multiprocessing.Pool(processes=numPoolProcesses, initializer=initGamWorker, initargs=(l,), maxtasksperchild=200)
|
|
@@ -9958,7 +9967,7 @@ def MultiprocessGAMCommands(items, showCmds):
|
|
|
9958
9967
|
except AssertionError as e:
|
|
9959
9968
|
Cmd.SetLocation(0)
|
|
9960
9969
|
usageErrorExit(str(e))
|
|
9961
|
-
if multiprocessing.get_start_method()
|
|
9970
|
+
if multiprocessing.get_start_method() != 'fork':
|
|
9962
9971
|
savedValues = saveNonPickleableValues()
|
|
9963
9972
|
if GM.Globals[GM.STDOUT][GM.REDIRECT_MULTIPROCESS]:
|
|
9964
9973
|
mpQueueStdout, mpQueueHandlerStdout = initializeStdQueueHandler(mpManager, GM.STDOUT, GM.Globals, GC.Values)
|
|
@@ -9973,7 +9982,7 @@ def MultiprocessGAMCommands(items, showCmds):
|
|
|
9973
9982
|
mpQueueStderr = mpQueueStdout
|
|
9974
9983
|
else:
|
|
9975
9984
|
mpQueueStderr = None
|
|
9976
|
-
if multiprocessing.get_start_method()
|
|
9985
|
+
if multiprocessing.get_start_method() != 'fork':
|
|
9977
9986
|
restoreNonPickleableValues(savedValues)
|
|
9978
9987
|
if mpQueueStdout:
|
|
9979
9988
|
mpQueueStdout.put((0, GM.REDIRECT_QUEUE_DATA, GM.Globals[GM.STDOUT][GM.REDIRECT_MULTI_FD].getvalue()))
|
|
@@ -11137,7 +11146,7 @@ class Credentials(google.oauth2.credentials.Credentials):
|
|
|
11137
11146
|
|
|
11138
11147
|
def doOAuthRequest(currentScopes, login_hint, verifyScopes=False):
|
|
11139
11148
|
client_id, client_secret = getOAuthClientIDAndSecret()
|
|
11140
|
-
scopesList = API.getClientScopesList(GC.Values[GC.TODRIVE_CLIENTACCESS])
|
|
11149
|
+
scopesList = API.getClientScopesList(GC.Values[GC.COMMANDDATA_CLIENTACCESS], GC.Values[GC.TODRIVE_CLIENTACCESS])
|
|
11141
11150
|
if not currentScopes or verifyScopes:
|
|
11142
11151
|
selectedScopes = getScopesFromUser(scopesList, True, currentScopes)
|
|
11143
11152
|
if selectedScopes is None:
|
|
@@ -11183,7 +11192,7 @@ def doOAuthCreate():
|
|
|
11183
11192
|
else:
|
|
11184
11193
|
login_hint = None
|
|
11185
11194
|
scopes = []
|
|
11186
|
-
scopesList = API.getClientScopesList(GC.Values[GC.TODRIVE_CLIENTACCESS])
|
|
11195
|
+
scopesList = API.getClientScopesList(GC.Values[GC.COMMANDDATA_CLIENTACCESS], GC.Values[GC.TODRIVE_CLIENTACCESS])
|
|
11187
11196
|
while Cmd.ArgumentsRemaining():
|
|
11188
11197
|
myarg = getArgument()
|
|
11189
11198
|
if myarg == 'admin':
|
|
@@ -11199,7 +11208,9 @@ def doOAuthCreate():
|
|
|
11199
11208
|
scopes.append(uscope)
|
|
11200
11209
|
break
|
|
11201
11210
|
else:
|
|
11202
|
-
invalidChoiceExit(uscope,
|
|
11211
|
+
invalidChoiceExit(uscope,
|
|
11212
|
+
API.getClientScopesURLs(GC.Values[GC.COMMANDDATA_CLIENTACCESS], GC.Values[GC.TODRIVE_CLIENTACCESS]),
|
|
11213
|
+
True)
|
|
11203
11214
|
else:
|
|
11204
11215
|
unknownArgumentExit()
|
|
11205
11216
|
if len(scopes) == 0:
|
|
@@ -11310,7 +11321,7 @@ def doOAuthUpdate():
|
|
|
11310
11321
|
if 'scopes' in jsonDict:
|
|
11311
11322
|
currentScopes = jsonDict['scopes']
|
|
11312
11323
|
else:
|
|
11313
|
-
currentScopes = API.getClientScopesURLs(GC.Values[GC.TODRIVE_CLIENTACCESS])
|
|
11324
|
+
currentScopes = API.getClientScopesURLs(GC.Values[GC.COMMANDDATA_CLIENTACCESS], GC.Values[GC.TODRIVE_CLIENTACCESS])
|
|
11314
11325
|
else:
|
|
11315
11326
|
currentScopes = []
|
|
11316
11327
|
except (AttributeError, IndexError, KeyError, SyntaxError, TypeError, ValueError) as e:
|
gam/__main__.py
CHANGED
|
@@ -34,7 +34,12 @@ def main():
|
|
|
34
34
|
|
|
35
35
|
# Run from command line
|
|
36
36
|
if __name__ == '__main__':
|
|
37
|
-
if
|
|
37
|
+
if getattr(sys, 'frozen', False): # we're frozen:
|
|
38
38
|
multiprocessing.freeze_support()
|
|
39
|
+
if platform.system() == 'Linux':
|
|
40
|
+
# set explictly since it's not default in Python < 3.14, forkserver should
|
|
41
|
+
# be safer than fork and less likely to see bulk command hangs.
|
|
42
|
+
multiprocessing.set_start_method('forkserver')
|
|
43
|
+
else:
|
|
39
44
|
multiprocessing.set_start_method('spawn')
|
|
40
45
|
main()
|
gam/gamlib/glapi.py
CHANGED
|
@@ -60,7 +60,6 @@ DIRECTORY = 'directory'
|
|
|
60
60
|
DOCS = 'docs'
|
|
61
61
|
DRIVE2 = 'drive2'
|
|
62
62
|
DRIVE3 = 'drive3'
|
|
63
|
-
DRIVECD = 'drivecd'
|
|
64
63
|
DRIVETD = 'drivetd'
|
|
65
64
|
DRIVEACTIVITY = 'driveactivity'
|
|
66
65
|
DRIVELABELS = 'drivelabels'
|
|
@@ -92,7 +91,6 @@ SERVICEACCOUNTLOOKUP = 'serviceaccountlookup'
|
|
|
92
91
|
SERVICEMANAGEMENT = 'servicemanagement'
|
|
93
92
|
SERVICEUSAGE = 'serviceusage'
|
|
94
93
|
SHEETS = 'sheets'
|
|
95
|
-
SHEETSCD = 'sheetscd'
|
|
96
94
|
SHEETSTD = 'sheetstd'
|
|
97
95
|
SITEVERIFICATION = 'siteVerification'
|
|
98
96
|
STORAGE = 'storage'
|
|
@@ -107,6 +105,8 @@ YOUTUBE = 'youtube'
|
|
|
107
105
|
BUSINESSACCOUNTMANAGEMENT_SCOPE = 'https://www.googleapis.com/auth/business.manage'
|
|
108
106
|
CHROMEVERSIONHISTORY_URL = 'https://versionhistory.googleapis.com/v1/chrome/platforms'
|
|
109
107
|
DRIVE_SCOPE = 'https://www.googleapis.com/auth/drive'
|
|
108
|
+
DRIVE_FILE_SCOPE = 'https://www.googleapis.com/auth/drive.file'
|
|
109
|
+
DRIVE_READONLY_SCOPE = 'https://www.googleapis.com/auth/drive.readonly'
|
|
110
110
|
GMAIL_SEND_SCOPE = 'https://www.googleapis.com/auth/gmail.send'
|
|
111
111
|
GOOGLE_AUTH_PROVIDER_X509_CERT_URL = 'https://www.googleapis.com/oauth2/v1/certs'
|
|
112
112
|
GOOGLE_OAUTH2_ENDPOINT = 'https://accounts.google.com/o/oauth2/v2/auth'
|
|
@@ -158,6 +158,7 @@ OAUTH2_TOKEN_ERRORS = [
|
|
|
158
158
|
'access_denied: Account restricted',
|
|
159
159
|
'internal_failure: Backend Error',
|
|
160
160
|
'internal_failure: None',
|
|
161
|
+
'invalid_account: Forbidden',
|
|
161
162
|
'invalid_grant',
|
|
162
163
|
'invalid_grant: Bad Request',
|
|
163
164
|
'invalid_grant: Invalid email or User ID',
|
|
@@ -255,7 +256,6 @@ _INFO = {
|
|
|
255
256
|
DOCS: {'name': 'Docs API', 'version': 'v1', 'v2discovery': True},
|
|
256
257
|
DRIVE2: {'name': 'Drive API v2', 'version': 'v2', 'v2discovery': False, 'mappedAPI': 'drive'},
|
|
257
258
|
DRIVE3: {'name': 'Drive API v3', 'version': 'v3', 'v2discovery': False, 'mappedAPI': 'drive'},
|
|
258
|
-
DRIVECD: {'name': 'Drive API v3 - read command data', 'version': 'v3', 'v2discovery': False, 'mappedAPI': 'drive'},
|
|
259
259
|
DRIVETD: {'name': 'Drive API v3 - write todrive data', 'version': 'v3', 'v2discovery': False, 'mappedAPI': 'drive'},
|
|
260
260
|
DRIVEACTIVITY: {'name': 'Drive Activity API v2', 'version': 'v2', 'v2discovery': True},
|
|
261
261
|
DRIVELABELS_ADMIN: {'name': 'Drive Labels API - Admin', 'version': 'v2', 'v2discovery': True, 'mappedAPI': DRIVELABELS},
|
|
@@ -286,7 +286,6 @@ _INFO = {
|
|
|
286
286
|
SERVICEMANAGEMENT: {'name': 'Service Management API', 'version': 'v1', 'v2discovery': True},
|
|
287
287
|
SERVICEUSAGE: {'name': 'Service Usage API', 'version': 'v1', 'v2discovery': True},
|
|
288
288
|
SHEETS: {'name': 'Sheets API', 'version': 'v4', 'v2discovery': True},
|
|
289
|
-
SHEETSCD: {'name': 'Sheets API - read command data', 'version': 'v4', 'v2discovery': True, 'mappedAPI': SHEETS},
|
|
290
289
|
SHEETSTD: {'name': 'Sheets API - write todrive data', 'version': 'v4', 'v2discovery': True, 'mappedAPI': SHEETS},
|
|
291
290
|
SITEVERIFICATION: {'name': 'Site Verification API', 'version': 'v1', 'v2discovery': True},
|
|
292
291
|
STORAGE: {'name': 'Cloud Storage API', 'version': 'v1', 'v2discovery': True},
|
|
@@ -534,6 +533,17 @@ _CLIENT_SCOPES = [
|
|
|
534
533
|
'scope': 'https://www.googleapis.com/auth/ediscovery'},
|
|
535
534
|
]
|
|
536
535
|
|
|
536
|
+
_COMMANDDATA_CLIENT_SCOPES = [
|
|
537
|
+
{'name': 'Drive API - commanddata_clientaccess',
|
|
538
|
+
'api': DRIVE3,
|
|
539
|
+
'subscopes': [],
|
|
540
|
+
'scope': DRIVE_READONLY_SCOPE},
|
|
541
|
+
{'name': 'Sheets API - commanddata_clientaccess',
|
|
542
|
+
'api': SHEETS,
|
|
543
|
+
'subscopes': [],
|
|
544
|
+
'scope': 'https://www.googleapis.com/auth/spreadsheets.readonly'},
|
|
545
|
+
]
|
|
546
|
+
|
|
537
547
|
_TODRIVE_CLIENT_SCOPES = [
|
|
538
548
|
{'name': 'Drive API - todrive_clientaccess',
|
|
539
549
|
'api': DRIVE3,
|
|
@@ -542,7 +552,7 @@ _TODRIVE_CLIENT_SCOPES = [
|
|
|
542
552
|
{'name': 'Drive File API - todrive_clientaccess',
|
|
543
553
|
'api': DRIVE3,
|
|
544
554
|
'subscopes': [],
|
|
545
|
-
'scope':
|
|
555
|
+
'scope': DRIVE_FILE_SCOPE},
|
|
546
556
|
{'name': 'Gmail API - todrive_clientaccess',
|
|
547
557
|
'api': GMAIL,
|
|
548
558
|
'subscopes': [],
|
|
@@ -647,7 +657,8 @@ _SVCACCT_SCOPES = [
|
|
|
647
657
|
{'name': 'Drive Activity API v2 - must pair with Drive API',
|
|
648
658
|
'api': DRIVEACTIVITY,
|
|
649
659
|
'subscopes': [],
|
|
650
|
-
'scope':
|
|
660
|
+
'scope': [DRIVE_READONLY_SCOPE,
|
|
661
|
+
'https://www.googleapis.com/auth/drive.activity']},
|
|
651
662
|
{'name': 'Drive Labels API - Admin',
|
|
652
663
|
'api': DRIVELABELS_ADMIN,
|
|
653
664
|
'subscopes': READONLY,
|
|
@@ -660,10 +671,12 @@ _SVCACCT_SCOPES = [
|
|
|
660
671
|
'api': DOCS,
|
|
661
672
|
'subscopes': READONLY,
|
|
662
673
|
'scope': 'https://www.googleapis.com/auth/documents'},
|
|
663
|
-
{'name': 'Forms API',
|
|
674
|
+
{'name': 'Forms API - must pair with Drive API',
|
|
664
675
|
'api': FORMS,
|
|
665
676
|
'subscopes': [],
|
|
666
|
-
'scope':
|
|
677
|
+
'scope': [DRIVE_READONLY_SCOPE,
|
|
678
|
+
'https://www.googleapis.com/auth/forms.body',
|
|
679
|
+
'https://www.googleapis.com/auth/forms.responses.readonly']},
|
|
667
680
|
{'name': 'Gmail API - Full Access (Labels, Messages)',
|
|
668
681
|
'api': GMAIL,
|
|
669
682
|
'subscopes': [],
|
|
@@ -754,12 +767,7 @@ _SVCACCT_SCOPES = [
|
|
|
754
767
|
]
|
|
755
768
|
|
|
756
769
|
_SVCACCT_SPECIAL_SCOPES = [
|
|
757
|
-
{'name': 'Drive API -
|
|
758
|
-
'api': DRIVECD,
|
|
759
|
-
'subscopes': [],
|
|
760
|
-
'offByDefault': True,
|
|
761
|
-
'scope': DRIVE_SCOPE+'.readonly'},
|
|
762
|
-
{'name': 'Drive API - write todrive data',
|
|
770
|
+
{'name': 'Drive API - write todrive data - has access to all Drive',
|
|
763
771
|
'api': DRIVETD,
|
|
764
772
|
'subscopes': [],
|
|
765
773
|
'offByDefault': True,
|
|
@@ -774,12 +782,7 @@ _SVCACCT_SPECIAL_SCOPES = [
|
|
|
774
782
|
'subscopes': [],
|
|
775
783
|
'offByDefault': True,
|
|
776
784
|
'scope': GMAIL_SEND_SCOPE},
|
|
777
|
-
{'name': 'Sheets API -
|
|
778
|
-
'api': SHEETSCD,
|
|
779
|
-
'offByDefault': True,
|
|
780
|
-
'subscopes': [],
|
|
781
|
-
'scope': 'https://www.googleapis.com/auth/spreadsheets.readonly'},
|
|
782
|
-
{'name': 'Sheets API - write todrive data',
|
|
785
|
+
{'name': 'Sheets API - write todrive data - has access to all Sheets',
|
|
783
786
|
'api': SHEETSTD,
|
|
784
787
|
'offByDefault': True,
|
|
785
788
|
'subscopes': [],
|
|
@@ -805,14 +808,18 @@ def getVersion(api):
|
|
|
805
808
|
def getClientScopesSet(api):
|
|
806
809
|
return {scope['scope'] for scope in _CLIENT_SCOPES if scope['api'] == api}
|
|
807
810
|
|
|
808
|
-
def getClientScopesList(todriveClientAccess):
|
|
811
|
+
def getClientScopesList(commanddataClientAccess, todriveClientAccess):
|
|
809
812
|
caScopes = _CLIENT_SCOPES[:]
|
|
813
|
+
if commanddataClientAccess:
|
|
814
|
+
caScopes.extend(_COMMANDDATA_CLIENT_SCOPES)
|
|
810
815
|
if todriveClientAccess:
|
|
811
816
|
caScopes.extend(_TODRIVE_CLIENT_SCOPES)
|
|
812
817
|
return sorted(caScopes, key=lambda k: k['name'])
|
|
813
818
|
|
|
814
|
-
def getClientScopesURLs(todriveClientAccess):
|
|
819
|
+
def getClientScopesURLs(commanddataClientAccess, todriveClientAccess):
|
|
815
820
|
caScopes = _CLIENT_SCOPES[:]
|
|
821
|
+
if commanddataClientAccess:
|
|
822
|
+
caScopes.extend(_COMMANDDATA_CLIENT_SCOPES)
|
|
816
823
|
if todriveClientAccess:
|
|
817
824
|
caScopes.extend(_TODRIVE_CLIENT_SCOPES)
|
|
818
825
|
return sorted({scope['scope'] for scope in _CLIENT_SCOPES})
|
gam/gamlib/glcfg.py
CHANGED
|
@@ -85,6 +85,8 @@ CMDLOG_MAX__BACKUPS = 'cmdlog_max__backups'
|
|
|
85
85
|
CMDLOG_MAX_BACKUPS = 'cmdlog_max_backups'
|
|
86
86
|
# Command logging max kilo bytes per log file
|
|
87
87
|
CMDLOG_MAX_KILO_BYTES = 'cmdlog_max_kilo_bytes'
|
|
88
|
+
# Use client access for command data from Google Docs/Sheets
|
|
89
|
+
COMMANDDATA_CLIENTACCESS = 'commanddata_clientaccess'
|
|
88
90
|
# GAM config directory containing client_secrets.json, oauth2.txt, oauth2service.json, extra_args.txt
|
|
89
91
|
CONFIG_DIR = 'config_dir'
|
|
90
92
|
# When retrieving lists of Google Contacts from API, how many should be retrieved in each chunk
|
|
@@ -344,6 +346,7 @@ Defaults = {
|
|
|
344
346
|
CMDLOG: '',
|
|
345
347
|
CMDLOG_MAX_BACKUPS: 5,
|
|
346
348
|
CMDLOG_MAX_KILO_BYTES: 1000,
|
|
349
|
+
COMMANDDATA_CLIENTACCESS: FALSE,
|
|
347
350
|
CONFIG_DIR: '',
|
|
348
351
|
CONTACT_MAX_RESULTS: '100',
|
|
349
352
|
CSV_INPUT_COLUMN_DELIMITER: ',',
|
|
@@ -512,6 +515,7 @@ VAR_INFO = {
|
|
|
512
515
|
CMDLOG: {VAR_TYPE: TYPE_FILE, VAR_ACCESS: os.W_OK},
|
|
513
516
|
CMDLOG_MAX_BACKUPS: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (1, 10)},
|
|
514
517
|
CMDLOG_MAX_KILO_BYTES: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (100, 10000)},
|
|
518
|
+
COMMANDDATA_CLIENTACCESS: {VAR_TYPE: TYPE_BOOLEAN},
|
|
515
519
|
CONFIG_DIR: {VAR_TYPE: TYPE_DIRECTORY, VAR_ENVVAR: 'GAMUSERCONFIGDIR'},
|
|
516
520
|
CONTACT_MAX_RESULTS: {VAR_TYPE: TYPE_INTEGER, VAR_LIMITS: (1, 10000)},
|
|
517
521
|
CSV_INPUT_COLUMN_DELIMITER: {VAR_TYPE: TYPE_CHARACTER},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
gam/__init__.py,sha256=
|
|
2
|
-
gam/__main__.py,sha256=
|
|
1
|
+
gam/__init__.py,sha256=KgQ0lP58wUrxs-hEKHB8E_pt7D0Wxq1R9X_vEczWPRU,3624274
|
|
2
|
+
gam/__main__.py,sha256=VwEYS7a9vYQPbT6iLduMOoVUJ6p4R-HZgerZQmM1NpE,1307
|
|
3
3
|
gam/cacerts.pem,sha256=DUsVo2XlFYwfkhe3gnxa-Km4Z4noz74hSApXwTT-nQE,44344
|
|
4
4
|
gam/cbcm-v1.1beta1.json,sha256=xO5XloCQQULmPbFBx5bckdqmbLFQ7sJ2TImhE1ysDIY,19439
|
|
5
5
|
gam/contactdelegation-v1.json,sha256=kCWykxSH7jLHglb-nWE_RFauxRXa_1eisWXXAqHu6Ws,7663
|
|
@@ -22,8 +22,8 @@ gam/atom/token_store.py,sha256=7E6Ecvxa86WCvl1pJAhv78jg9OxQv8pMtIUcPhZCq04,3803
|
|
|
22
22
|
gam/atom/url.py,sha256=pxO1TlORxyKQTQ1bkBE1unFzjnv9c8LjJkm-UEORShY,4276
|
|
23
23
|
gam/gamlib/__init__.py,sha256=z5mF-y0j8pm-YNFBaiuxB4M_GAUPG-cXWwrhYwrVReM,679
|
|
24
24
|
gam/gamlib/glaction.py,sha256=1Il_HrChVnPkzZwiZs5au4mFQVtq4K1Z42uIuR6qdnI,9419
|
|
25
|
-
gam/gamlib/glapi.py,sha256=
|
|
26
|
-
gam/gamlib/glcfg.py,sha256=
|
|
25
|
+
gam/gamlib/glapi.py,sha256=g49VStWE64nCdrpNIMl60U06m98d3AGO8-vUDxgcBog,37048
|
|
26
|
+
gam/gamlib/glcfg.py,sha256=jbcH7iIgknSYuSIzB0KEz7oQWjKpAUDDSS35gFY9eI8,28529
|
|
27
27
|
gam/gamlib/glclargs.py,sha256=LlTtwJJHqU48l7SQT4bcZCWlw3Y46g42Bn1ACGW8gIk,53307
|
|
28
28
|
gam/gamlib/glentity.py,sha256=KWFomkoNE6lLE83zVqVIlJ2rkzfLkhEasW1M0TWGieA,35373
|
|
29
29
|
gam/gamlib/glgapi.py,sha256=pdBbwNtnCwFWxJGaP-_3hdTjSNoOCJF2yo76WdQOi1k,40426
|
|
@@ -47,8 +47,8 @@ gam/gdata/apps/audit/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrK
|
|
|
47
47
|
gam/gdata/apps/audit/service.py,sha256=Z1eueThcNeVUMWP1DRWc_DGHrJCiJI8W_xj6L-cqu-Q,9658
|
|
48
48
|
gam/gdata/apps/contacts/__init__.py,sha256=Um6zgIkiahZns7yAEuC3pxHSMD8iciZ_EoynSLoYPfU,30463
|
|
49
49
|
gam/gdata/apps/contacts/service.py,sha256=5lNb-Ii1Gyek6ePFji3kyoYtCBc8CuJTwagx2BL2o14,15684
|
|
50
|
-
gam7-7.
|
|
51
|
-
gam7-7.
|
|
52
|
-
gam7-7.
|
|
53
|
-
gam7-7.
|
|
54
|
-
gam7-7.
|
|
50
|
+
gam7-7.25.0.dist-info/METADATA,sha256=5lZQJEOoo854RjAvSCT2Mp_RiCfJ484PXNa9oulJi_0,3092
|
|
51
|
+
gam7-7.25.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
52
|
+
gam7-7.25.0.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
|
|
53
|
+
gam7-7.25.0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
54
|
+
gam7-7.25.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|