gam7 7.20.3__py3-none-any.whl → 7.20.4__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.20.03'
28
+ __version__ = '7.20.04'
29
29
  __license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
30
30
 
31
31
  #pylint: disable=wrong-import-position
@@ -120,6 +120,10 @@ from google.auth.jwt import Credentials as JWTCredentials
120
120
  import google.oauth2.service_account
121
121
  import google_auth_oauthlib.flow
122
122
  import google_auth_httplib2
123
+ import googleapiclient
124
+ import googleapiclient.discovery
125
+ import googleapiclient.errors
126
+ import googleapiclient.http
123
127
  import httplib2
124
128
 
125
129
  httplib2.RETRIES = 5
@@ -139,6 +143,7 @@ from gamlib import glgapi as GAPI
139
143
  from gamlib import glgdata as GDATA
140
144
  from gamlib import glglobals as GM
141
145
  from gamlib import glindent
146
+ from gamlib import gliso8601 as iso8601
142
147
  from gamlib import glmsgs as Msg
143
148
  from gamlib import glskus as SKU
144
149
  from gamlib import gluprop as UProp
@@ -149,12 +154,6 @@ import gdata.apps.audit
149
154
  import gdata.apps.audit.service
150
155
  import gdata.apps.contacts
151
156
  import gdata.apps.contacts.service
152
- # Import local library, does not include discovery documents
153
- import googleapiclient
154
- import googleapiclient.discovery
155
- import googleapiclient.errors
156
- import googleapiclient.http
157
- from iso8601 import iso8601
158
157
 
159
158
  IS08601_TIME_FORMAT = '%Y-%m-%dT%H:%M:%S%:z'
160
159
  RFC2822_TIME_FORMAT = '%a, %d %b %Y %H:%M:%S %z'
@@ -2013,11 +2012,11 @@ def getTimeOrDeltaFromNow(returnDateTime=False):
2013
2012
  except OverflowError:
2014
2013
  pass
2015
2014
  try:
2016
- fullDateTime, tz = iso8601.parse_date(argstr)
2015
+ fullDateTime = iso8601.parse_date(argstr)
2017
2016
  Cmd.Advance()
2018
2017
  if not returnDateTime:
2019
2018
  return argstr.replace(' ', 'T')
2020
- return (fullDateTime, tz, argstr.replace(' ', 'T'))
2019
+ return (fullDateTime, fullDateTime.tzinfo, argstr.replace(' ', 'T'))
2021
2020
  except (iso8601.ParseError, OverflowError):
2022
2021
  pass
2023
2022
  invalidArgumentExit(YYYYMMDDTHHMMSS_FORMAT_REQUIRED)
@@ -2335,7 +2334,7 @@ def formatLocalTime(dateTimeStr):
2335
2334
  if dateTimeStr in {NEVER_TIME, NEVER_TIME_NOMS}:
2336
2335
  return GC.Values[GC.NEVER_TIME]
2337
2336
  try:
2338
- timestamp, _ = iso8601.parse_date(dateTimeStr)
2337
+ timestamp = iso8601.parse_date(dateTimeStr)
2339
2338
  if not GC.Values[GC.OUTPUT_TIMEFORMAT]:
2340
2339
  if GM.Globals[GM.CONVERT_TO_LOCAL_TIME]:
2341
2340
  return ISOformatTimeStamp(timestamp.astimezone(GC.Values[GC.TIMEZONE]))
@@ -3736,10 +3735,7 @@ def SetGlobalVariables():
3736
3735
  if value and not os.path.isabs(value):
3737
3736
  value = os.path.expanduser(os.path.join(_getCfgDirectory(sectionName, GC.CONFIG_DIR), value))
3738
3737
  elif not value and itemName == GC.CACERTS_PEM:
3739
- if hasattr(sys, '_MEIPASS'):
3740
- value = os.path.join(sys._MEIPASS, GC.FN_CACERTS_PEM) #pylint: disable=no-member
3741
- else:
3742
- value = os.path.join(GM.Globals[GM.GAM_PATH], GC.FN_CACERTS_PEM)
3738
+ value = os.path.join(GM.Globals[GM.GAM_PATH], GC.FN_CACERTS_PEM)
3743
3739
  return value
3744
3740
 
3745
3741
  def _readGamCfgFile(config, fileName):
@@ -7436,7 +7432,7 @@ def RowFilterMatch(row, titlesList, rowFilter, rowFilterModeAll, rowDropFilter,
7436
7432
  return None
7437
7433
  else:
7438
7434
  try:
7439
- rowTime, _ = iso8601.parse_date(rowDate)
7435
+ rowTime = iso8601.parse_date(rowDate)
7440
7436
  except (iso8601.ParseError, OverflowError):
7441
7437
  return None
7442
7438
  return ISOformatTimeStamp(datetime.datetime(rowTime.year, rowTime.month, rowTime.day, tzinfo=iso8601.UTC))
@@ -7501,7 +7497,7 @@ def RowFilterMatch(row, titlesList, rowFilter, rowFilterModeAll, rowDropFilter,
7501
7497
  if YYYYMMDD_PATTERN.match(rowDate):
7502
7498
  return None
7503
7499
  try:
7504
- rowTime, _ = iso8601.parse_date(rowDate)
7500
+ rowTime = iso8601.parse_date(rowDate)
7505
7501
  except (iso8601.ParseError, OverflowError):
7506
7502
  return None
7507
7503
  return f'{rowTime.hour:02d}:{rowTime.minute:02d}'
@@ -12413,7 +12409,7 @@ def checkServiceAccount(users):
12413
12409
  throwReasons=[GAPI.BAD_REQUEST, GAPI.INVALID, GAPI.NOT_FOUND,
12414
12410
  GAPI.PERMISSION_DENIED, GAPI.SERVICE_NOT_AVAILABLE],
12415
12411
  name=name, fields='validAfterTime')
12416
- key_created, _ = iso8601.parse_date(key['validAfterTime'])
12412
+ key_created = iso8601.parse_date(key['validAfterTime'])
12417
12413
  key_age = todaysTime()-key_created
12418
12414
  printPassFail(Msg.SERVICE_ACCOUNT_PRIVATE_KEY_AGE.format(key_age.days), testWarn if key_age.days > 30 else testPass)
12419
12415
  except GAPI.permissionDenied:
@@ -14368,7 +14364,7 @@ def doReport():
14368
14364
  eventTime = activity.get('id', {}).get('time', UNKNOWN)
14369
14365
  if eventTime != UNKNOWN:
14370
14366
  try:
14371
- eventTime, _ = iso8601.parse_date(eventTime)
14367
+ eventTime = iso8601.parse_date(eventTime)
14372
14368
  except (iso8601.ParseError, OverflowError):
14373
14369
  eventTime = UNKNOWN
14374
14370
  if eventTime != UNKNOWN:
@@ -23867,7 +23863,7 @@ def _filterDeviceFiles(cros, selected, listLimit, startTime, endTime):
23867
23863
  filteredItems = []
23868
23864
  i = 0
23869
23865
  for item in cros.get('deviceFiles', []):
23870
- timeValue, _ = iso8601.parse_date(item['createTime'])
23866
+ timeValue = iso8601.parse_date(item['createTime'])
23871
23867
  if ((startTime is None) or (timeValue >= startTime)) and ((endTime is None) or (timeValue <= endTime)):
23872
23868
  item['createTime'] = formatLocalTime(item['createTime'])
23873
23869
  filteredItems.append(item)
@@ -23884,7 +23880,7 @@ def _filterCPUStatusReports(cros, selected, listLimit, startTime, endTime):
23884
23880
  filteredItems = []
23885
23881
  i = 0
23886
23882
  for item in cros.get('cpuStatusReports', []):
23887
- timeValue, _ = iso8601.parse_date(item['reportTime'])
23883
+ timeValue = iso8601.parse_date(item['reportTime'])
23888
23884
  if ((startTime is None) or (timeValue >= startTime)) and ((endTime is None) or (timeValue <= endTime)):
23889
23885
  item['reportTime'] = formatLocalTime(item['reportTime'])
23890
23886
  for tempInfo in item.get('cpuTemperatureInfo', []):
@@ -23905,7 +23901,7 @@ def _filterSystemRamFreeReports(cros, selected, listLimit, startTime, endTime):
23905
23901
  filteredItems = []
23906
23902
  i = 0
23907
23903
  for item in cros.get('systemRamFreeReports', []):
23908
- timeValue, _ = iso8601.parse_date(item['reportTime'])
23904
+ timeValue = iso8601.parse_date(item['reportTime'])
23909
23905
  if ((startTime is None) or (timeValue >= startTime)) and ((endTime is None) or (timeValue <= endTime)):
23910
23906
  item['reportTime'] = formatLocalTime(item['reportTime'])
23911
23907
  item['systemRamFreeInfo'] = ','.join([str(x) for x in item['systemRamFreeInfo']])
@@ -23938,7 +23934,7 @@ def _filterScreenshotFiles(cros, selected, listLimit, startTime, endTime):
23938
23934
  filteredItems = []
23939
23935
  i = 0
23940
23936
  for item in cros.get('screenshotFiles', []):
23941
- timeValue, _ = iso8601.parse_date(item['createTime'])
23937
+ timeValue = iso8601.parse_date(item['createTime'])
23942
23938
  if ((startTime is None) or (timeValue >= startTime)) and ((endTime is None) or (timeValue <= endTime)):
23943
23939
  item['createTime'] = formatLocalTime(item['createTime'])
23944
23940
  filteredItems.append(item)
@@ -24386,7 +24382,7 @@ def getDeviceFilesEntity():
24386
24382
  else:
24387
24383
  for timeItem in myarg.split(','):
24388
24384
  try:
24389
- timestamp, _ = iso8601.parse_date(timeItem)
24385
+ timestamp = iso8601.parse_date(timeItem)
24390
24386
  deviceFilesEntity['list'].append(ISOformatTimeStamp(timestamp.astimezone(GC.Values[GC.TIMEZONE])))
24391
24387
  except (iso8601.ParseError, OverflowError):
24392
24388
  Cmd.Backup()
@@ -24415,14 +24411,14 @@ def _selectDeviceFiles(deviceId, deviceFiles, deviceFilesEntity):
24415
24411
  count = 0
24416
24412
  if deviceFilesEntity['time'][0] == 'before':
24417
24413
  for deviceFile in deviceFiles:
24418
- createTime, _ = iso8601.parse_date(deviceFile['createTime'])
24414
+ createTime = iso8601.parse_date(deviceFile['createTime'])
24419
24415
  if createTime >= dateTime:
24420
24416
  break
24421
24417
  count += 1
24422
24418
  return deviceFiles[:count]
24423
24419
  # if deviceFilesEntity['time'][0] == 'after':
24424
24420
  for deviceFile in deviceFiles:
24425
- createTime, _ = iso8601.parse_date(deviceFile['createTime'])
24421
+ createTime = iso8601.parse_date(deviceFile['createTime'])
24426
24422
  if createTime >= dateTime:
24427
24423
  break
24428
24424
  count += 1
@@ -24431,14 +24427,14 @@ def _selectDeviceFiles(deviceId, deviceFiles, deviceFilesEntity):
24431
24427
  dateTime = deviceFilesEntity['range'][1]
24432
24428
  spos = 0
24433
24429
  for deviceFile in deviceFiles:
24434
- createTime, _ = iso8601.parse_date(deviceFile['createTime'])
24430
+ createTime = iso8601.parse_date(deviceFile['createTime'])
24435
24431
  if createTime >= dateTime:
24436
24432
  break
24437
24433
  spos += 1
24438
24434
  dateTime = deviceFilesEntity['range'][2]
24439
24435
  epos = spos
24440
24436
  for deviceFile in deviceFiles[spos:]:
24441
- createTime, _ = iso8601.parse_date(deviceFile['createTime'])
24437
+ createTime = iso8601.parse_date(deviceFile['createTime'])
24442
24438
  if createTime >= dateTime:
24443
24439
  break
24444
24440
  epos += 1
@@ -25221,7 +25217,7 @@ def doInfoPrintShowCrOSTelemetry():
25221
25217
  i = 0
25222
25218
  for item in listItems:
25223
25219
  if 'reportTime' in item:
25224
- timeValue, _ = iso8601.parse_date(item['reportTime'])
25220
+ timeValue = iso8601.parse_date(item['reportTime'])
25225
25221
  else:
25226
25222
  timeValue = None
25227
25223
  if (timeValue is None) or (((startTime is None) or (timeValue >= startTime)) and ((endTime is None) or (timeValue <= endTime))):
@@ -40068,7 +40064,7 @@ def _getEventDaysOfWeek(event):
40068
40064
  pass
40069
40065
  elif 'dateTime' in event[attr]:
40070
40066
  try:
40071
- dateTime, _ = iso8601.parse_date(event[attr]['dateTime'])
40067
+ dateTime = iso8601.parse_date(event[attr]['dateTime'])
40072
40068
  event[attr]['dayOfWeek'] = calendarlib.day_abbr[dateTime.weekday()]
40073
40069
  except (iso8601.ParseError, OverflowError):
40074
40070
  pass
@@ -48699,7 +48695,7 @@ def _courseItemPassesFilter(item, courseItemFilter):
48699
48695
  return False
48700
48696
  startTime = courseItemFilter['startTime']
48701
48697
  endTime = courseItemFilter['endTime']
48702
- timeValue, _ = iso8601.parse_date(timeStr)
48698
+ timeValue = iso8601.parse_date(timeStr)
48703
48699
  return ((startTime is None) or (timeValue >= startTime)) and ((endTime is None) or (timeValue <= endTime))
48704
48700
 
48705
48701
  def _gettingCoursesQuery(courseSelectionParameters):
@@ -56258,7 +56254,7 @@ def _selectRevisionIds(drive, fileId, origUser, user, i, count, j, jcount, revis
56258
56254
  count = 0
56259
56255
  if revisionsEntity['time'][0] == 'before':
56260
56256
  for revision in results:
56261
- modifiedDateTime, _ = iso8601.parse_date(revision['modifiedTime'])
56257
+ modifiedDateTime = iso8601.parse_date(revision['modifiedTime'])
56262
56258
  if modifiedDateTime >= dateTime:
56263
56259
  break
56264
56260
  revisionIds.append(revision['id'])
@@ -56268,7 +56264,7 @@ def _selectRevisionIds(drive, fileId, origUser, user, i, count, j, jcount, revis
56268
56264
  return revisionIds
56269
56265
  # time: after
56270
56266
  for revision in results:
56271
- modifiedDateTime, _ = iso8601.parse_date(revision['modifiedTime'])
56267
+ modifiedDateTime = iso8601.parse_date(revision['modifiedTime'])
56272
56268
  if modifiedDateTime >= dateTime:
56273
56269
  revisionIds.append(revision['id'])
56274
56270
  count += 1
@@ -56280,7 +56276,7 @@ def _selectRevisionIds(drive, fileId, origUser, user, i, count, j, jcount, revis
56280
56276
  endDateTime = revisionsEntity['range'][2]
56281
56277
  count = 0
56282
56278
  for revision in results:
56283
- modifiedDateTime, _ = iso8601.parse_date(revision['modifiedTime'])
56279
+ modifiedDateTime = iso8601.parse_date(revision['modifiedTime'])
56284
56280
  if modifiedDateTime >= startDateTime:
56285
56281
  if modifiedDateTime >= endDateTime:
56286
56282
  break
@@ -56490,7 +56486,7 @@ def _selectRevisionResults(results, fileId, origUser, revisionsEntity, previewDe
56490
56486
  count = 0
56491
56487
  if revisionsEntity['time'][0] == 'before':
56492
56488
  for revision in results:
56493
- modifiedDateTime, _ = iso8601.parse_date(revision['modifiedTime'])
56489
+ modifiedDateTime = iso8601.parse_date(revision['modifiedTime'])
56494
56490
  if modifiedDateTime >= dateTime:
56495
56491
  break
56496
56492
  count += 1
@@ -56501,7 +56497,7 @@ def _selectRevisionResults(results, fileId, origUser, revisionsEntity, previewDe
56501
56497
  return results[:count]
56502
56498
  # time: after
56503
56499
  for revision in results:
56504
- modifiedDateTime, _ = iso8601.parse_date(revision['modifiedTime'])
56500
+ modifiedDateTime = iso8601.parse_date(revision['modifiedTime'])
56505
56501
  if modifiedDateTime >= dateTime:
56506
56502
  break
56507
56503
  count += 1
@@ -56518,7 +56514,7 @@ def _selectRevisionResults(results, fileId, origUser, revisionsEntity, previewDe
56518
56514
  count = 0
56519
56515
  selectedResults = []
56520
56516
  for revision in results:
56521
- modifiedDateTime, _ = iso8601.parse_date(revision['modifiedTime'])
56517
+ modifiedDateTime = iso8601.parse_date(revision['modifiedTime'])
56522
56518
  if modifiedDateTime >= startDateTime:
56523
56519
  if modifiedDateTime >= endDateTime:
56524
56520
  break
@@ -57056,7 +57052,7 @@ class PermissionMatch():
57056
57052
  break
57057
57053
  elif field in {'expirationstart', 'expirationend'}:
57058
57054
  if 'expirationTime' in permission:
57059
- expirationDateTime, _ = iso8601.parse_date(permission['expirationTime'])
57055
+ expirationDateTime = iso8601.parse_date(permission['expirationTime'])
57060
57056
  if field == 'expirationstart':
57061
57057
  if expirationDateTime < value:
57062
57058
  break
@@ -148,13 +148,12 @@ def parse_date(datestring):
148
148
  groups = m.groupdict()
149
149
  tz = parse_timezone(groups)
150
150
  try:
151
- return (datetime(year=int(groups['year']),
152
- month=int(groups['month']),
153
- day=int(groups['day']),
154
- hour=int(groups['hour']),
155
- minute=int(groups['minute']),
156
- second=int(groups['second']),
157
- tzinfo=tz),
158
- tz)
151
+ return datetime(year=int(groups['year']),
152
+ month=int(groups['month']),
153
+ day=int(groups['day']),
154
+ hour=int(groups['hour']),
155
+ minute=int(groups['minute']),
156
+ second=int(groups['second']),
157
+ tzinfo=tz)
159
158
  except Exception as e:
160
159
  raise ParseError(e)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gam7
3
- Version: 7.20.3
3
+ Version: 7.20.4
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,4 +1,4 @@
1
- gam/__init__.py,sha256=Dg18uAagGM_Ri_DQ16DbZHZY_PnpNgXH3VH4_nv1KHs,3610487
1
+ gam/__init__.py,sha256=CIc00eYsz1xXHeULeEY71VeYKnCN6rYKMf0LiEfy7B4,3610241
2
2
  gam/__main__.py,sha256=amz0-959ph6zkZKqjaar4n60yho-T37w6qWI36qx0CA,1049
3
3
  gam/cacerts.pem,sha256=DUsVo2XlFYwfkhe3gnxa-Km4Z4noz74hSApXwTT-nQE,44344
4
4
  gam/cbcm-v1.1beta1.json,sha256=xO5XloCQQULmPbFBx5bckdqmbLFQ7sJ2TImhE1ysDIY,19439
@@ -6,7 +6,6 @@ gam/contactdelegation-v1.json,sha256=kCWykxSH7jLHglb-nWE_RFauxRXa_1eisWXXAqHu6Ws
6
6
  gam/datastudio-v1.json,sha256=L_mQBN8oYmfWODGvgrwTF9d2i8rEZJmzqIxw_Yr83lI,15673
7
7
  gam/meet-v2beta.json,sha256=VUx2P9QMmmNK5tU4W9SYzmVhQzMoshP4VbvHSPoNdTI,50511
8
8
  gam/serviceaccountlookup-v1.json,sha256=NDe8BbviJo8_vlEOA7iobT5GSaBg6h-DjnkPwiAYlvs,4121
9
- gam/six.py,sha256=U4Z_yv534W5CNyjY9i8V1OXY2SjAny8y2L5vDLhhThM,34159
10
9
  gam/atom/__init__.py,sha256=pnPkqTZcRh1LniagGNTBDO9COzniXUgRQv_DNE3KPBw,52245
11
10
  gam/atom/auth.py,sha256=hvzDptCCSNRi1hUK89hFmYn5rct5glWJ6Ffzm0p43bw,1200
12
11
  gam/atom/client.py,sha256=6AQbkndS2BSpw_17cd8C2y2zSBa4hXwZpOTKYZDFEjY,8086
@@ -31,6 +30,7 @@ gam/gamlib/glgapi.py,sha256=pdBbwNtnCwFWxJGaP-_3hdTjSNoOCJF2yo76WdQOi1k,40426
31
30
  gam/gamlib/glgdata.py,sha256=weRppttWm6uRyqtBoGPKoHiNZ2h28nhfUV4J_mbCszY,2707
32
31
  gam/gamlib/glglobals.py,sha256=oJfaLUQj46XqwrOzRfWhGqO0f1P26xjJZefaILJUFGE,9695
33
32
  gam/gamlib/glindent.py,sha256=RfBa2LDfLIqPLL5vMfC689TCVmqn8xf-qulSzkiatrc,1228
33
+ gam/gamlib/gliso8601.py,sha256=DJNe9WgQZeWKj3ZKLqpDoDmXYjuc1UUEAqmDTramCGw,4360
34
34
  gam/gamlib/glmsgs.py,sha256=ODq-KS3jhXH5DB5DEo6eCX1DHhy4OGv_jeQjiLVPOHM,34049
35
35
  gam/gamlib/glskus.py,sha256=29vlBLBJCL4u9GawCt3eNeZq9HQG3hGFZk9-EainNng,15384
36
36
  gam/gamlib/gluprop.py,sha256=IyPLCyvn7-NHTUenM71YPQPXRZXx6CB5q-GtJ-FYd1c,11461
@@ -48,25 +48,8 @@ gam/gdata/apps/audit/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrK
48
48
  gam/gdata/apps/audit/service.py,sha256=Z1eueThcNeVUMWP1DRWc_DGHrJCiJI8W_xj6L-cqu-Q,9658
49
49
  gam/gdata/apps/contacts/__init__.py,sha256=Um6zgIkiahZns7yAEuC3pxHSMD8iciZ_EoynSLoYPfU,30463
50
50
  gam/gdata/apps/contacts/service.py,sha256=5lNb-Ii1Gyek6ePFji3kyoYtCBc8CuJTwagx2BL2o14,15684
51
- gam/googleapiclient/__init__.py,sha256=kFWxKShJalbnrCuV0klL7mjZaiXfPpjlqmyKyI8yfTU,904
52
- gam/googleapiclient/_auth.py,sha256=QttUwhmp7BmhW5CReaAOVGH6kEtITYmEHhVCVmsnDPs,5736
53
- gam/googleapiclient/_helpers.py,sha256=iNxILG6iNNFukr7lhaYfVqX4oFM5SERvcsU3JxeOo6I,6723
54
- gam/googleapiclient/channel.py,sha256=Fc4nxu-RxGkjY_STp9bwJfZaLan6VdX-DNniH-ANSuE,11054
55
- gam/googleapiclient/discovery.py,sha256=9TKz9stsr8Q9TPTjKG1I6yHoPH1ISRvh58q_NoX3mOM,66341
56
- gam/googleapiclient/errors.py,sha256=9h3uimcMcczBHZJFWAX_YDABzJeJugWB0jmj11rp-LI,5460
57
- gam/googleapiclient/http.py,sha256=ITE51oqDBqN1-AA5D-Tnlj3egGc_5O0V5xSzBw3UTKI,68241
58
- gam/googleapiclient/mimeparse.py,sha256=wwouQMCjppTocJtiQhkkTa27kocYwlFRALL2z11Xo1Y,6530
59
- gam/googleapiclient/model.py,sha256=NQDO1GhOGNVCJlSSCLOecdA11yf8RDXfSLFxYb3R7EE,14085
60
- gam/googleapiclient/schema.py,sha256=rR3u8WPQ_V8a7GCUsNuvtf6GxzwuMO0HaqsTBp3tnyM,10414
61
- gam/googleapiclient/version.py,sha256=CQnalMsxpdK1_gw_iADQK3D0RNBQ2vMlzw3PbyNFWC4,599
62
- gam/googleapiclient/discovery_cache/__init__.py,sha256=ww_vl0vhVLuHSEdRTv3-gq6EDG--Ff7rILYHHFifnzc,2315
63
- gam/googleapiclient/discovery_cache/appengine_memcache.py,sha256=6T1pQj-toAhDwfgLuiggFGhxKNGw5y-NnLUzLIF_M4s,1657
64
- gam/googleapiclient/discovery_cache/base.py,sha256=yCDPtxnbNN-p5_9fzBacC6P3wcUPlaCQIy5v_dXTons,1389
65
- gam/googleapiclient/discovery_cache/file_cache.py,sha256=sim3Mg4HgRYo3vX75jvcKy_aV568EvIrtBfvfbw-044,4774
66
- gam/iso8601/__init__.py,sha256=Z2PsYbXgAH5a5xzUvgczCboPzqWpm65kRcIngCnhViU,1218
67
- gam/iso8601/iso8601.py,sha256=Li2FHZ4sBTWuthuQhyCvmvj0j6At8JbGzkSv2fc2RHU,4384
68
- gam7-7.20.3.dist-info/METADATA,sha256=3rEbZ76pZrP2xa_v6tNKqFzRPGFDpZXuVXcgnkTUqgc,2940
69
- gam7-7.20.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
70
- gam7-7.20.3.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
71
- gam7-7.20.3.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
72
- gam7-7.20.3.dist-info/RECORD,,
51
+ gam7-7.20.4.dist-info/METADATA,sha256=5zQaUVUxrainX85ijOG3NeiXc7hVt5Vlec2028TsNdM,2940
52
+ gam7-7.20.4.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
53
+ gam7-7.20.4.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
54
+ gam7-7.20.4.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
55
+ gam7-7.20.4.dist-info/RECORD,,
@@ -1,27 +0,0 @@
1
- # Copyright 2014 Google Inc. All Rights Reserved.
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- # Set default logging handler to avoid "No handler found" warnings.
16
- import logging
17
-
18
- try: # Python 2.7+
19
- from logging import NullHandler
20
- except ImportError:
21
-
22
- class NullHandler(logging.Handler):
23
- def emit(self, record):
24
- pass
25
-
26
-
27
- logging.getLogger(__name__).addHandler(NullHandler())
@@ -1,167 +0,0 @@
1
- # Copyright 2016 Google Inc. All Rights Reserved.
2
- #
3
- # Licensed under the Apache License, Version 2.0 (the "License");
4
- # you may not use this file except in compliance with the License.
5
- # You may obtain a copy of the License at
6
- #
7
- # http://www.apache.org/licenses/LICENSE-2.0
8
- #
9
- # Unless required by applicable law or agreed to in writing, software
10
- # distributed under the License is distributed on an "AS IS" BASIS,
11
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
- # See the License for the specific language governing permissions and
13
- # limitations under the License.
14
-
15
- """Helpers for authentication using oauth2client or google-auth."""
16
-
17
- import httplib2
18
-
19
- try:
20
- import google.auth
21
- import google.auth.credentials
22
-
23
- HAS_GOOGLE_AUTH = True
24
- except ImportError: # pragma: NO COVER
25
- HAS_GOOGLE_AUTH = False
26
-
27
- try:
28
- import google_auth_httplib2
29
- except ImportError: # pragma: NO COVER
30
- google_auth_httplib2 = None
31
-
32
- try:
33
- import oauth2client
34
- import oauth2client.client
35
-
36
- HAS_OAUTH2CLIENT = True
37
- except ImportError: # pragma: NO COVER
38
- HAS_OAUTH2CLIENT = False
39
-
40
-
41
- def credentials_from_file(filename, scopes=None, quota_project_id=None):
42
- """Returns credentials loaded from a file."""
43
- if HAS_GOOGLE_AUTH:
44
- credentials, _ = google.auth.load_credentials_from_file(
45
- filename, scopes=scopes, quota_project_id=quota_project_id
46
- )
47
- return credentials
48
- else:
49
- raise EnvironmentError(
50
- "client_options.credentials_file is only supported in google-auth."
51
- )
52
-
53
-
54
- def default_credentials(scopes=None, quota_project_id=None):
55
- """Returns Application Default Credentials."""
56
- if HAS_GOOGLE_AUTH:
57
- credentials, _ = google.auth.default(
58
- scopes=scopes, quota_project_id=quota_project_id
59
- )
60
- return credentials
61
- elif HAS_OAUTH2CLIENT:
62
- if scopes is not None or quota_project_id is not None:
63
- raise EnvironmentError(
64
- "client_options.scopes and client_options.quota_project_id are not supported in oauth2client."
65
- "Please install google-auth."
66
- )
67
- return oauth2client.client.GoogleCredentials.get_application_default()
68
- else:
69
- raise EnvironmentError(
70
- "No authentication library is available. Please install either "
71
- "google-auth or oauth2client."
72
- )
73
-
74
-
75
- def with_scopes(credentials, scopes):
76
- """Scopes the credentials if necessary.
77
-
78
- Args:
79
- credentials (Union[
80
- google.auth.credentials.Credentials,
81
- oauth2client.client.Credentials]): The credentials to scope.
82
- scopes (Sequence[str]): The list of scopes.
83
-
84
- Returns:
85
- Union[google.auth.credentials.Credentials,
86
- oauth2client.client.Credentials]: The scoped credentials.
87
- """
88
- if HAS_GOOGLE_AUTH and isinstance(credentials, google.auth.credentials.Credentials):
89
- return google.auth.credentials.with_scopes_if_required(credentials, scopes)
90
- else:
91
- try:
92
- if credentials.create_scoped_required():
93
- return credentials.create_scoped(scopes)
94
- else:
95
- return credentials
96
- except AttributeError:
97
- return credentials
98
-
99
-
100
- def authorized_http(credentials):
101
- """Returns an http client that is authorized with the given credentials.
102
-
103
- Args:
104
- credentials (Union[
105
- google.auth.credentials.Credentials,
106
- oauth2client.client.Credentials]): The credentials to use.
107
-
108
- Returns:
109
- Union[httplib2.Http, google_auth_httplib2.AuthorizedHttp]: An
110
- authorized http client.
111
- """
112
- from googleapiclient.http import build_http
113
-
114
- if HAS_GOOGLE_AUTH and isinstance(credentials, google.auth.credentials.Credentials):
115
- if google_auth_httplib2 is None:
116
- raise ValueError(
117
- "Credentials from google.auth specified, but "
118
- "google-api-python-client is unable to use these credentials "
119
- "unless google-auth-httplib2 is installed. Please install "
120
- "google-auth-httplib2."
121
- )
122
- return google_auth_httplib2.AuthorizedHttp(credentials, http=build_http())
123
- else:
124
- return credentials.authorize(build_http())
125
-
126
-
127
- def refresh_credentials(credentials):
128
- # Refresh must use a new http instance, as the one associated with the
129
- # credentials could be a AuthorizedHttp or an oauth2client-decorated
130
- # Http instance which would cause a weird recursive loop of refreshing
131
- # and likely tear a hole in spacetime.
132
- refresh_http = httplib2.Http()
133
- if HAS_GOOGLE_AUTH and isinstance(credentials, google.auth.credentials.Credentials):
134
- request = google_auth_httplib2.Request(refresh_http)
135
- return credentials.refresh(request)
136
- else:
137
- return credentials.refresh(refresh_http)
138
-
139
-
140
- def apply_credentials(credentials, headers):
141
- # oauth2client and google-auth have the same interface for this.
142
- if not is_valid(credentials):
143
- refresh_credentials(credentials)
144
- return credentials.apply(headers)
145
-
146
-
147
- def is_valid(credentials):
148
- if HAS_GOOGLE_AUTH and isinstance(credentials, google.auth.credentials.Credentials):
149
- return credentials.valid
150
- else:
151
- return (
152
- credentials.access_token is not None
153
- and not credentials.access_token_expired
154
- )
155
-
156
-
157
- def get_credentials_from_http(http):
158
- if http is None:
159
- return None
160
- elif hasattr(http.request, "credentials"):
161
- return http.request.credentials
162
- elif hasattr(http, "credentials") and not isinstance(
163
- http.credentials, httplib2.Credentials
164
- ):
165
- return http.credentials
166
- else:
167
- return None