gam7 7.24.1__py3-none-any.whl → 7.25.1__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 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.24.01'
28
+ __version__ = '7.25.01'
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.shift(months=-firstMonth, day=1, hour=0, minute=0, second=0, microsecond=0)
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.shift(day=1, hour=23, minute=59, second=59, microsecond=0).shift(days=-1)
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
- _, drive = buildGAPIServiceObject(chooseSaAPI(API.DRIVECD, API.DRIVE3), user)
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
- user, drive = buildGAPIServiceObject(chooseSaAPI(API.DRIVECD, API.DRIVE3), user)
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
- _, sheet = buildGAPIServiceObject(chooseSaAPI(API.SHEETSCD, API.SHEETS), user)
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]
@@ -3707,12 +3716,12 @@ def SetGlobalVariables():
3707
3716
  return stringlist
3708
3717
 
3709
3718
  def _getCfgTimezone(sectionName, itemName):
3710
- value = _stripStringQuotes(GM.Globals[GM.PARSER].get(sectionName, itemName).lower())
3711
- if value in {'utc', 'z'}:
3719
+ value = _stripStringQuotes(GM.Globals[GM.PARSER].get(sectionName, itemName))
3720
+ if value.lower() in {'utc', 'z'}:
3712
3721
  GM.Globals[GM.CONVERT_TO_LOCAL_TIME] = False
3713
3722
  return arrow.now('utc').tzinfo
3714
3723
  GM.Globals[GM.CONVERT_TO_LOCAL_TIME] = True
3715
- if value == 'local':
3724
+ if value.lower() == 'local':
3716
3725
  return arrow.now(value).tzinfo
3717
3726
  try:
3718
3727
  return arrow.now(value).tzinfo
@@ -4801,7 +4810,6 @@ def defaultSvcAcctScopes():
4801
4810
  saScopes[scope['api']].append(scope['scope'])
4802
4811
  else:
4803
4812
  saScopes[scope['api']].extend(scope['scope'])
4804
- saScopes[API.DRIVEACTIVITY].append(API.DRIVE_SCOPE)
4805
4813
  saScopes[API.DRIVE2] = saScopes[API.DRIVE3]
4806
4814
  return saScopes
4807
4815
 
@@ -9596,7 +9604,7 @@ def CSVFileQueueHandler(mpQueue, mpQueueStdout, mpQueueStderr, csvPF, datetimeNo
9596
9604
  clearRowFilters = False
9597
9605
  # if sys.platform.startswith('win'):
9598
9606
  # signal.signal(signal.SIGINT, signal.SIG_IGN)
9599
- if multiprocessing.get_start_method() == 'spawn':
9607
+ if multiprocessing.get_start_method() != 'fork':
9600
9608
  signal.signal(signal.SIGINT, signal.SIG_IGN)
9601
9609
  Cmd = glclargs.GamCLArgs()
9602
9610
  else:
@@ -9638,7 +9646,7 @@ def CSVFileQueueHandler(mpQueue, mpQueueStdout, mpQueueStderr, csvPF, datetimeNo
9638
9646
  Cmd.InitializeArguments(dataItem)
9639
9647
  elif dataType == GM.REDIRECT_QUEUE_GLOBALS:
9640
9648
  GM.Globals = dataItem
9641
- if multiprocessing.get_start_method() == 'spawn':
9649
+ if multiprocessing.get_start_method() != 'fork':
9642
9650
  reopenSTDFile(GM.STDOUT)
9643
9651
  reopenSTDFile(GM.STDERR)
9644
9652
  elif dataType == GM.REDIRECT_QUEUE_VALUES:
@@ -9684,7 +9692,7 @@ def initializeCSVFileQueueHandler(mpManager, mpQueueStdout, mpQueueStderr):
9684
9692
  def terminateCSVFileQueueHandler(mpQueue, mpQueueHandler):
9685
9693
  GM.Globals[GM.PARSER] = None
9686
9694
  GM.Globals[GM.CSVFILE][GM.REDIRECT_QUEUE] = None
9687
- if multiprocessing.get_start_method() == 'spawn':
9695
+ if multiprocessing.get_start_method() != 'fork':
9688
9696
  mpQueue.put((GM.REDIRECT_QUEUE_ARGS, Cmd.AllArguments()))
9689
9697
  savedValues = saveNonPickleableValues()
9690
9698
  mpQueue.put((GM.REDIRECT_QUEUE_GLOBALS, GM.Globals))
@@ -9714,13 +9722,13 @@ def StdQueueHandler(mpQueue, stdtype, gmGlobals, gcValues):
9714
9722
 
9715
9723
  # if sys.platform.startswith('win'):
9716
9724
  # signal.signal(signal.SIGINT, signal.SIG_IGN)
9717
- if multiprocessing.get_start_method() == 'spawn':
9725
+ if multiprocessing.get_start_method() != 'fork':
9718
9726
  signal.signal(signal.SIGINT, signal.SIG_IGN)
9719
9727
  GM.Globals = gmGlobals.copy()
9720
9728
  GC.Values = gcValues.copy()
9721
9729
  pid0DataItem = [KEYBOARD_INTERRUPT_RC, None]
9722
9730
  pidData = {}
9723
- if multiprocessing.get_start_method() == 'spawn':
9731
+ if multiprocessing.get_start_method() != 'fork':
9724
9732
  if GM.Globals[stdtype][GM.REDIRECT_NAME] == 'null':
9725
9733
  fd = open(os.devnull, GM.Globals[stdtype][GM.REDIRECT_MODE], encoding=UTF8)
9726
9734
  elif GM.Globals[stdtype][GM.REDIRECT_NAME] == '-':
@@ -9808,7 +9816,7 @@ def ProcessGAMCommandMulti(pid, numItems, logCmd, mpQueueCSVFile, mpQueueStdout,
9808
9816
  with mplock:
9809
9817
  initializeLogging()
9810
9818
  # if sys.platform.startswith('win'):
9811
- if multiprocessing.get_start_method() == 'spawn':
9819
+ if multiprocessing.get_start_method() != 'fork':
9812
9820
  signal.signal(signal.SIGINT, signal.SIG_IGN)
9813
9821
  GM.Globals[GM.API_CALLS_RETRY_DATA] = {}
9814
9822
  GM.Globals[GM.CMDLOG_LOGGER] = None
@@ -9949,7 +9957,7 @@ def MultiprocessGAMCommands(items, showCmds):
9949
9957
  mpManager = multiprocessing.Manager()
9950
9958
  l = mpManager.Lock()
9951
9959
  try:
9952
- if multiprocessing.get_start_method() == 'spawn':
9960
+ if multiprocessing.get_start_method() != 'fork':
9953
9961
  pool = mpManager.Pool(processes=numPoolProcesses, initializer=initGamWorker, initargs=(l,), maxtasksperchild=200)
9954
9962
  else:
9955
9963
  pool = multiprocessing.Pool(processes=numPoolProcesses, initializer=initGamWorker, initargs=(l,), maxtasksperchild=200)
@@ -9958,7 +9966,7 @@ def MultiprocessGAMCommands(items, showCmds):
9958
9966
  except AssertionError as e:
9959
9967
  Cmd.SetLocation(0)
9960
9968
  usageErrorExit(str(e))
9961
- if multiprocessing.get_start_method() == 'spawn':
9969
+ if multiprocessing.get_start_method() != 'fork':
9962
9970
  savedValues = saveNonPickleableValues()
9963
9971
  if GM.Globals[GM.STDOUT][GM.REDIRECT_MULTIPROCESS]:
9964
9972
  mpQueueStdout, mpQueueHandlerStdout = initializeStdQueueHandler(mpManager, GM.STDOUT, GM.Globals, GC.Values)
@@ -9973,7 +9981,7 @@ def MultiprocessGAMCommands(items, showCmds):
9973
9981
  mpQueueStderr = mpQueueStdout
9974
9982
  else:
9975
9983
  mpQueueStderr = None
9976
- if multiprocessing.get_start_method() == 'spawn':
9984
+ if multiprocessing.get_start_method() != 'fork':
9977
9985
  restoreNonPickleableValues(savedValues)
9978
9986
  if mpQueueStdout:
9979
9987
  mpQueueStdout.put((0, GM.REDIRECT_QUEUE_DATA, GM.Globals[GM.STDOUT][GM.REDIRECT_MULTI_FD].getvalue()))
@@ -11137,7 +11145,7 @@ class Credentials(google.oauth2.credentials.Credentials):
11137
11145
 
11138
11146
  def doOAuthRequest(currentScopes, login_hint, verifyScopes=False):
11139
11147
  client_id, client_secret = getOAuthClientIDAndSecret()
11140
- scopesList = API.getClientScopesList(GC.Values[GC.TODRIVE_CLIENTACCESS])
11148
+ scopesList = API.getClientScopesList(GC.Values[GC.COMMANDDATA_CLIENTACCESS], GC.Values[GC.TODRIVE_CLIENTACCESS])
11141
11149
  if not currentScopes or verifyScopes:
11142
11150
  selectedScopes = getScopesFromUser(scopesList, True, currentScopes)
11143
11151
  if selectedScopes is None:
@@ -11183,7 +11191,7 @@ def doOAuthCreate():
11183
11191
  else:
11184
11192
  login_hint = None
11185
11193
  scopes = []
11186
- scopesList = API.getClientScopesList(GC.Values[GC.TODRIVE_CLIENTACCESS])
11194
+ scopesList = API.getClientScopesList(GC.Values[GC.COMMANDDATA_CLIENTACCESS], GC.Values[GC.TODRIVE_CLIENTACCESS])
11187
11195
  while Cmd.ArgumentsRemaining():
11188
11196
  myarg = getArgument()
11189
11197
  if myarg == 'admin':
@@ -11199,7 +11207,9 @@ def doOAuthCreate():
11199
11207
  scopes.append(uscope)
11200
11208
  break
11201
11209
  else:
11202
- invalidChoiceExit(uscope, API.getClientScopesURLs(GC.Values[GC.TODRIVE_CLIENTACCESS]), True)
11210
+ invalidChoiceExit(uscope,
11211
+ API.getClientScopesURLs(GC.Values[GC.COMMANDDATA_CLIENTACCESS], GC.Values[GC.TODRIVE_CLIENTACCESS]),
11212
+ True)
11203
11213
  else:
11204
11214
  unknownArgumentExit()
11205
11215
  if len(scopes) == 0:
@@ -11310,7 +11320,7 @@ def doOAuthUpdate():
11310
11320
  if 'scopes' in jsonDict:
11311
11321
  currentScopes = jsonDict['scopes']
11312
11322
  else:
11313
- currentScopes = API.getClientScopesURLs(GC.Values[GC.TODRIVE_CLIENTACCESS])
11323
+ currentScopes = API.getClientScopesURLs(GC.Values[GC.COMMANDDATA_CLIENTACCESS], GC.Values[GC.TODRIVE_CLIENTACCESS])
11314
11324
  else:
11315
11325
  currentScopes = []
11316
11326
  except (AttributeError, IndexError, KeyError, SyntaxError, TypeError, ValueError) as e:
@@ -12340,8 +12350,6 @@ def checkServiceAccount(users):
12340
12350
  saScopes[scope['api']].append(scope['roscope'])
12341
12351
  checkScopesSet.add(scope['roscope'])
12342
12352
  i += 1
12343
- if API.DRIVEACTIVITY in saScopes and API.DRIVE3 in saScopes:
12344
- saScopes[API.DRIVEACTIVITY].append(API.DRIVE_SCOPE)
12345
12353
  if API.DRIVE3 in saScopes:
12346
12354
  saScopes[API.DRIVE2] = saScopes[API.DRIVE3]
12347
12355
  GM.Globals[GM.OAUTH2SERVICE_JSON_DATA][API.OAUTH2SA_SCOPES] = saScopes
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 platform.system() != 'Linux':
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'
@@ -256,7 +256,6 @@ _INFO = {
256
256
  DOCS: {'name': 'Docs API', 'version': 'v1', 'v2discovery': True},
257
257
  DRIVE2: {'name': 'Drive API v2', 'version': 'v2', 'v2discovery': False, 'mappedAPI': 'drive'},
258
258
  DRIVE3: {'name': 'Drive API v3', 'version': 'v3', 'v2discovery': False, 'mappedAPI': 'drive'},
259
- DRIVECD: {'name': 'Drive API v3 - read command data', 'version': 'v3', 'v2discovery': False, 'mappedAPI': 'drive'},
260
259
  DRIVETD: {'name': 'Drive API v3 - write todrive data', 'version': 'v3', 'v2discovery': False, 'mappedAPI': 'drive'},
261
260
  DRIVEACTIVITY: {'name': 'Drive Activity API v2', 'version': 'v2', 'v2discovery': True},
262
261
  DRIVELABELS_ADMIN: {'name': 'Drive Labels API - Admin', 'version': 'v2', 'v2discovery': True, 'mappedAPI': DRIVELABELS},
@@ -287,7 +286,6 @@ _INFO = {
287
286
  SERVICEMANAGEMENT: {'name': 'Service Management API', 'version': 'v1', 'v2discovery': True},
288
287
  SERVICEUSAGE: {'name': 'Service Usage API', 'version': 'v1', 'v2discovery': True},
289
288
  SHEETS: {'name': 'Sheets API', 'version': 'v4', 'v2discovery': True},
290
- SHEETSCD: {'name': 'Sheets API - read command data', 'version': 'v4', 'v2discovery': True, 'mappedAPI': SHEETS},
291
289
  SHEETSTD: {'name': 'Sheets API - write todrive data', 'version': 'v4', 'v2discovery': True, 'mappedAPI': SHEETS},
292
290
  SITEVERIFICATION: {'name': 'Site Verification API', 'version': 'v1', 'v2discovery': True},
293
291
  STORAGE: {'name': 'Cloud Storage API', 'version': 'v1', 'v2discovery': True},
@@ -535,6 +533,17 @@ _CLIENT_SCOPES = [
535
533
  'scope': 'https://www.googleapis.com/auth/ediscovery'},
536
534
  ]
537
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
+
538
547
  _TODRIVE_CLIENT_SCOPES = [
539
548
  {'name': 'Drive API - todrive_clientaccess',
540
549
  'api': DRIVE3,
@@ -543,7 +552,7 @@ _TODRIVE_CLIENT_SCOPES = [
543
552
  {'name': 'Drive File API - todrive_clientaccess',
544
553
  'api': DRIVE3,
545
554
  'subscopes': [],
546
- 'scope': 'https://www.googleapis.com/auth/drive.file'},
555
+ 'scope': DRIVE_FILE_SCOPE},
547
556
  {'name': 'Gmail API - todrive_clientaccess',
548
557
  'api': GMAIL,
549
558
  'subscopes': [],
@@ -648,7 +657,8 @@ _SVCACCT_SCOPES = [
648
657
  {'name': 'Drive Activity API v2 - must pair with Drive API',
649
658
  'api': DRIVEACTIVITY,
650
659
  'subscopes': [],
651
- 'scope': 'https://www.googleapis.com/auth/drive.activity'},
660
+ 'scope': [DRIVE_READONLY_SCOPE,
661
+ 'https://www.googleapis.com/auth/drive.activity']},
652
662
  {'name': 'Drive Labels API - Admin',
653
663
  'api': DRIVELABELS_ADMIN,
654
664
  'subscopes': READONLY,
@@ -661,10 +671,12 @@ _SVCACCT_SCOPES = [
661
671
  'api': DOCS,
662
672
  'subscopes': READONLY,
663
673
  'scope': 'https://www.googleapis.com/auth/documents'},
664
- {'name': 'Forms API',
674
+ {'name': 'Forms API - must pair with Drive API',
665
675
  'api': FORMS,
666
676
  'subscopes': [],
667
- 'scope': DRIVE_SCOPE},
677
+ 'scope': [DRIVE_READONLY_SCOPE,
678
+ 'https://www.googleapis.com/auth/forms.body',
679
+ 'https://www.googleapis.com/auth/forms.responses.readonly']},
668
680
  {'name': 'Gmail API - Full Access (Labels, Messages)',
669
681
  'api': GMAIL,
670
682
  'subscopes': [],
@@ -755,12 +767,7 @@ _SVCACCT_SCOPES = [
755
767
  ]
756
768
 
757
769
  _SVCACCT_SPECIAL_SCOPES = [
758
- {'name': 'Drive API - read command data',
759
- 'api': DRIVECD,
760
- 'subscopes': [],
761
- 'offByDefault': True,
762
- 'scope': DRIVE_SCOPE+'.readonly'},
763
- {'name': 'Drive API - write todrive data',
770
+ {'name': 'Drive API - write todrive data - has access to all Drive',
764
771
  'api': DRIVETD,
765
772
  'subscopes': [],
766
773
  'offByDefault': True,
@@ -775,12 +782,7 @@ _SVCACCT_SPECIAL_SCOPES = [
775
782
  'subscopes': [],
776
783
  'offByDefault': True,
777
784
  'scope': GMAIL_SEND_SCOPE},
778
- {'name': 'Sheets API - read command data',
779
- 'api': SHEETSCD,
780
- 'offByDefault': True,
781
- 'subscopes': [],
782
- 'scope': 'https://www.googleapis.com/auth/spreadsheets.readonly'},
783
- {'name': 'Sheets API - write todrive data',
785
+ {'name': 'Sheets API - write todrive data - has access to all Sheets',
784
786
  'api': SHEETSTD,
785
787
  'offByDefault': True,
786
788
  'subscopes': [],
@@ -806,14 +808,18 @@ def getVersion(api):
806
808
  def getClientScopesSet(api):
807
809
  return {scope['scope'] for scope in _CLIENT_SCOPES if scope['api'] == api}
808
810
 
809
- def getClientScopesList(todriveClientAccess):
811
+ def getClientScopesList(commanddataClientAccess, todriveClientAccess):
810
812
  caScopes = _CLIENT_SCOPES[:]
813
+ if commanddataClientAccess:
814
+ caScopes.extend(_COMMANDDATA_CLIENT_SCOPES)
811
815
  if todriveClientAccess:
812
816
  caScopes.extend(_TODRIVE_CLIENT_SCOPES)
813
817
  return sorted(caScopes, key=lambda k: k['name'])
814
818
 
815
- def getClientScopesURLs(todriveClientAccess):
819
+ def getClientScopesURLs(commanddataClientAccess, todriveClientAccess):
816
820
  caScopes = _CLIENT_SCOPES[:]
821
+ if commanddataClientAccess:
822
+ caScopes.extend(_COMMANDDATA_CLIENT_SCOPES)
817
823
  if todriveClientAccess:
818
824
  caScopes.extend(_TODRIVE_CLIENT_SCOPES)
819
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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gam7
3
- Version: 7.24.1
3
+ Version: 7.25.1
4
4
  Summary: CLI tool to manage Google Workspace
5
5
  Project-URL: Homepage, https://github.com/GAM-team/GAM
6
6
  Project-URL: Issues, https://github.com/GAM-team/GAM/issues
@@ -1,5 +1,5 @@
1
- gam/__init__.py,sha256=i7YaQlrH7H5C7Zt11T0UazlQbcMgwLtfBN8v5tTXjFs,3623835
2
- gam/__main__.py,sha256=amz0-959ph6zkZKqjaar4n60yho-T37w6qWI36qx0CA,1049
1
+ gam/__init__.py,sha256=yap8ac2YE2vWhCUCB-BeTBpjot9iIWnkCDAIsEYLDrI,3624105
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=1iz0ml8GcWRhs2BesJ_LxrAcoRwZDn5WG6Dryoy6sg0,36755
26
- gam/gamlib/glcfg.py,sha256=jX9IIrqSa8CPZ-UdnMDs2RuGo8vPh3jpgvRhI9VRbII,28325
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.24.1.dist-info/METADATA,sha256=wRNSzJdAGm2Wy4lQuHlh_jBpxQSwfKu6iIfv3E6mtCQ,3092
51
- gam7-7.24.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
52
- gam7-7.24.1.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
53
- gam7-7.24.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
54
- gam7-7.24.1.dist-info/RECORD,,
50
+ gam7-7.25.1.dist-info/METADATA,sha256=6oZaQdu9zHBPDIShvoWWB3tKPftIvAE4F3CsEr5mBys,3092
51
+ gam7-7.25.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
52
+ gam7-7.25.1.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
53
+ gam7-7.25.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
54
+ gam7-7.25.1.dist-info/RECORD,,
File without changes