gam7 7.5.15__py3-none-any.whl → 7.5.17__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.05.15'
28
+ __version__ = '7.05.17'
29
29
  __license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
30
30
 
31
31
  #pylint: disable=wrong-import-position
@@ -4113,8 +4113,8 @@ def SetGlobalVariables():
4113
4113
  if checkArgumentPresent(Cmd.MULTIPROCESSEXIT_CMD):
4114
4114
  _setMultiprocessExit()
4115
4115
  # redirect csv <FileName> [multiprocess] [append] [noheader] [charset <CharSet>]
4116
- # [columndelimiter <Character>] [noescapechar <Boolean>] [quotechar <Character>]]
4117
- # [sortheaders <StringList>] [timestampcolumn <String>]
4116
+ # [columndelimiter <Character>] [noescapechar [<Boolean>]] [quotechar <Character>]]
4117
+ # [sortheaders <StringList>] [timestampcolumn <String>] [transpose [<Boolean>]]
4118
4118
  # [todrive <ToDriveAttribute>*]
4119
4119
  # redirect stdout <FileName> [multiprocess] [append]
4120
4120
  # redirect stdout null
@@ -4139,6 +4139,8 @@ def SetGlobalVariables():
4139
4139
  GM.Globals[GM.CSV_OUTPUT_SORT_HEADERS] = GC.Values[GC.CSV_OUTPUT_SORT_HEADERS] = getString(Cmd.OB_STRING_LIST, minLen=0).replace(',', ' ').split()
4140
4140
  if checkArgumentPresent('timestampcolumn'):
4141
4141
  GM.Globals[GM.CSV_OUTPUT_TIMESTAMP_COLUMN] = GC.Values[GC.CSV_OUTPUT_TIMESTAMP_COLUMN] = getString(Cmd.OB_STRING, minLen=0)
4142
+ if checkArgumentPresent('transpose'):
4143
+ GM.Globals[GM.CSV_OUTPUT_TRANSPOSE] = getBoolean()
4142
4144
  _setCSVFile(filename, mode, encoding, writeHeader, multi)
4143
4145
  GM.Globals[GM.CSVFILE][GM.REDIRECT_QUEUE_CSVPF] = CSVPrintFile()
4144
4146
  if checkArgumentPresent('todrive'):
@@ -7794,6 +7796,7 @@ class CSVPrintFile():
7794
7796
  def __init__(self, titles=None, sortTitles=None, indexedTitles=None):
7795
7797
  self.rows = []
7796
7798
  self.rowCount = 0
7799
+ self.outputTranspose = GM.Globals[GM.CSV_OUTPUT_TRANSPOSE]
7797
7800
  self.todrive = GM.Globals[GM.CSV_TODRIVE]
7798
7801
  self.titlesSet = set()
7799
7802
  self.titlesList = []
@@ -8993,6 +8996,22 @@ class CSVPrintFile():
8993
8996
  self.JSONtitlesList = self.orderHeaders(self.JSONtitlesList)
8994
8997
  titlesList = self.JSONtitlesList
8995
8998
  normalizeSortHeaders()
8999
+ if self.outputTranspose:
9000
+ newRows = []
9001
+ pivotKey = titlesList[0]
9002
+ newTitlesList = [pivotKey]
9003
+ newTitlesSet = set(newTitlesList)
9004
+ for title in titlesList[1:]:
9005
+ newRow = {pivotKey: title}
9006
+ for row in self.rows:
9007
+ pivotValue = row[pivotKey]
9008
+ if pivotValue not in newTitlesSet:
9009
+ newTitlesSet.add(pivotValue)
9010
+ newTitlesList.append(pivotValue)
9011
+ newRow[pivotValue] = row.get(title)
9012
+ newRows.append(newRow)
9013
+ titlesList = newTitlesList
9014
+ self.rows = newRows
8996
9015
  if (not self.todrive) or self.todrive['localcopy']:
8997
9016
  if GM.Globals[GM.CSVFILE][GM.REDIRECT_NAME] == '-':
8998
9017
  if GM.Globals[GM.STDOUT][GM.REDIRECT_MULTI_FD]:
@@ -58726,7 +58745,7 @@ def _copyPermissions(drive, user, i, count, j, jcount,
58726
58745
  except (GAPI.notFound, GAPI.permissionNotFound,
58727
58746
  GAPI.fileNotFound, GAPI.forbidden, GAPI.internalError, GAPI.insufficientFilePermissions, GAPI.unknownError,
58728
58747
  GAPI.fileNeverWritable, GAPI.badRequest, GAPI.cannotRemoveOwner, GAPI.cannotModifyInheritedTeamDrivePermission,
58729
- GAPI.insufficientAdministratorPrivileges, GAPI.sharingRateLimitExceeded) as e:
58748
+ GAPI.insufficientAdministratorPrivileges, GAPI.sharingRateLimitExceeded, GAPI.cannotDeletePermission) as e:
58730
58749
  entityActionFailedWarning(kvList, str(e), k, kcount)
58731
58750
  except (GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy) as e:
58732
58751
  userDriveServiceNotEnabledWarning(user, str(e), i, count)
@@ -59757,7 +59776,7 @@ def _updateMoveFilePermissions(drive, user, i, count,
59757
59776
  except (GAPI.notFound, GAPI.permissionNotFound,
59758
59777
  GAPI.fileNotFound, GAPI.forbidden, GAPI.internalError, GAPI.insufficientFilePermissions, GAPI.unknownError,
59759
59778
  GAPI.fileNeverWritable, GAPI.badRequest, GAPI.cannotRemoveOwner, GAPI.cannotModifyInheritedTeamDrivePermission,
59760
- GAPI.insufficientAdministratorPrivileges, GAPI.sharingRateLimitExceeded) as e:
59779
+ GAPI.insufficientAdministratorPrivileges, GAPI.sharingRateLimitExceeded, GAPI.cannotDeletePermission) as e:
59761
59780
  entityActionFailedWarning(kvList, str(e), k, kcount)
59762
59781
  except (GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy) as e:
59763
59782
  userDriveServiceNotEnabledWarning(user, str(e), i, count)
@@ -61460,7 +61479,7 @@ def transferDrive(users):
61460
61479
  if showRetentionMessages:
61461
61480
  entityActionPerformed([Ent.USER, sourceUser, childFileType, childFileName, Ent.ROLE, ownerRetainRoleBody['role']], j, jcount)
61462
61481
  except (GAPI.fileNotFound, GAPI.forbidden, GAPI.internalError, GAPI.insufficientFilePermissions, GAPI.unknownError,
61463
- GAPI.badRequest, GAPI.sharingRateLimitExceeded, GAPI.cannotRemoveOwner) as e:
61482
+ GAPI.badRequest, GAPI.sharingRateLimitExceeded, GAPI.cannotRemoveOwner, GAPI.cannotDeletePermission) as e:
61464
61483
  entityActionFailedWarning([Ent.USER, sourceUser, childFileType, childFileName], str(e), j, jcount)
61465
61484
  except GAPI.permissionNotFound:
61466
61485
  entityDoesNotHaveItemWarning([Ent.USER, sourceUser, childFileType, childFileName, Ent.PERMISSION_ID, sourcePermissionId], j, jcount)
@@ -61513,7 +61532,7 @@ def transferDrive(users):
61513
61532
  if showRetentionMessages:
61514
61533
  entityActionPerformed([Ent.USER, sourceUser, childFileType, childFileName, Ent.ROLE, sourceUpdateRole['role']], j, jcount)
61515
61534
  except (GAPI.fileNotFound, GAPI.forbidden, GAPI.internalError, GAPI.insufficientFilePermissions, GAPI.unknownError,
61516
- GAPI.badRequest, GAPI.sharingRateLimitExceeded, GAPI.cannotRemoveOwner) as e:
61535
+ GAPI.badRequest, GAPI.sharingRateLimitExceeded, GAPI.cannotRemoveOwner, GAPI.cannotDeletePermission) as e:
61517
61536
  entityActionFailedWarning([Ent.USER, ownerUser, childFileType, childFileName], str(e), j, jcount)
61518
61537
  except GAPI.permissionNotFound:
61519
61538
  entityDoesNotHaveItemWarning([Ent.USER, ownerUser, childFileType, childFileName, Ent.PERMISSION_ID, sourcePermissionId], j, jcount)
@@ -61537,7 +61556,7 @@ def transferDrive(users):
61537
61556
  if showRetentionMessages:
61538
61557
  entityActionPerformed([Ent.USER, targetUser, childFileType, childFileName, Ent.ROLE, targetInsertBody['role']], j, jcount)
61539
61558
  except (GAPI.fileNotFound, GAPI.forbidden, GAPI.internalError, GAPI.insufficientFilePermissions, GAPI.unknownError,
61540
- GAPI.badRequest, GAPI.sharingRateLimitExceeded) as e:
61559
+ GAPI.badRequest, GAPI.sharingRateLimitExceeded, GAPI.cannotDeletePermission) as e:
61541
61560
  entityActionFailedWarning([Ent.USER, ownerUser, childFileType, childFileName], str(e), j, jcount)
61542
61561
  except GAPI.invalidSharingRequest as e:
61543
61562
  entityActionFailedWarning([Ent.USER, ownerUser, childFileType, childFileName], Ent.TypeNameMessage(Ent.PERMISSION_ID, targetPermissionId, str(e)), j, jcount)
@@ -62280,7 +62299,7 @@ def claimOwnership(users):
62280
62299
  entityActionPerformed([Ent.USER, oldOwner, entityType, fileDesc, Ent.ROLE, sourceRetainRoleBody['role']], l, lcount)
62281
62300
  except GAPI.permissionNotFound:
62282
62301
  entityDoesNotHaveItemWarning([Ent.USER, oldOwner, entityType, fileDesc, Ent.PERMISSION_ID, oldOwnerPermissionId], l, lcount)
62283
- except (GAPI.badRequest, GAPI.insufficientFilePermissions) as e:
62302
+ except (GAPI.badRequest, GAPI.insufficientFilePermissions, GAPI.cannotDeletePermission) as e:
62284
62303
  entityActionFailedWarning([Ent.USER, oldOwner, entityType, fileDesc], str(e), l, lcount)
62285
62304
  except (GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy) as e:
62286
62305
  userDriveServiceNotEnabledWarning(user, str(e), i, count)
@@ -63452,7 +63471,7 @@ def deleteDriveFileACLs(users, useDomainAdminAccess=False):
63452
63471
  _updateSheetProtectedRangesACLchange(sheet, user, i, count, j, jcount, fileId, fileName, False, permission)
63453
63472
  except (GAPI.fileNotFound, GAPI.forbidden, GAPI.internalError, GAPI.insufficientFilePermissions, GAPI.unknownError,
63454
63473
  GAPI.fileNeverWritable, GAPI.badRequest, GAPI.cannotRemoveOwner, GAPI.cannotModifyInheritedTeamDrivePermission,
63455
- GAPI.insufficientAdministratorPrivileges, GAPI.sharingRateLimitExceeded) as e:
63474
+ GAPI.insufficientAdministratorPrivileges, GAPI.sharingRateLimitExceeded, GAPI.cannotDeletePermission) as e:
63456
63475
  entityActionFailedWarning([Ent.USER, user, entityType, fileName], str(e), j, jcount)
63457
63476
  except GAPI.notFound as e:
63458
63477
  entityActionFailedWarning([Ent.USER, user, Ent.SHAREDDRIVE, fileName], str(e), j, jcount)
@@ -63508,7 +63527,7 @@ def deletePermissions(users, useDomainAdminAccess=False):
63508
63527
  entityActionPerformed([Ent.DRIVE_FILE_OR_FOLDER_ID, ri[RI_ENTITY], Ent.PERMISSION_ID, ri[RI_ITEM]], int(ri[RI_J]), int(ri[RI_JCOUNT]))
63509
63528
  except (GAPI.fileNotFound, GAPI.forbidden, GAPI.internalError, GAPI.insufficientFilePermissions, GAPI.unknownError,
63510
63529
  GAPI.badRequest, GAPI.cannotRemoveOwner, GAPI.cannotModifyInheritedTeamDrivePermission,
63511
- GAPI.insufficientAdministratorPrivileges, GAPI.sharingRateLimitExceeded, GAPI.permissionNotFound,
63530
+ GAPI.insufficientAdministratorPrivileges, GAPI.sharingRateLimitExceeded, GAPI.permissionNotFound, GAPI.cannotDeletePermission,
63512
63531
  GAPI.serviceNotAvailable, GAPI.authError, GAPI.domainPolicy) as e:
63513
63532
  entityActionFailedWarning([Ent.DRIVE_FILE_OR_FOLDER_ID, ri[RI_ENTITY], Ent.PERMISSION_ID, ri[RI_ITEM]], str(e), int(ri[RI_J]), int(ri[RI_JCOUNT]))
63514
63533
  if int(ri[RI_J]) == int(ri[RI_JCOUNT]):
gam/gamlib/glgapi.py CHANGED
@@ -37,6 +37,7 @@ CANNOT_CHANGE_OWNER_ACL = 'cannotChangeOwnerAcl'
37
37
  CANNOT_CHANGE_OWN_PRIMARY_SUBSCRIPTION = 'cannotChangeOwnPrimarySubscription'
38
38
  CANNOT_COPY_FILE = 'cannotCopyFile'
39
39
  CANNOT_DELETE_ONLY_REVISION = 'cannotDeleteOnlyRevision'
40
+ CANNOT_DELETE_PERMISSION = 'cannotDeletePermission'
40
41
  CANNOT_DELETE_PRIMARY_CALENDAR = 'cannotDeletePrimaryCalendar'
41
42
  CANNOT_DELETE_PRIMARY_SENDAS = 'cannotDeletePrimarySendAs'
42
43
  CANNOT_DELETE_RESOURCE_WITH_CHILDREN = 'cannotDeleteResourceWithChildren'
@@ -246,7 +247,7 @@ DRIVE3_UPDATE_ACL_THROW_REASONS = [BAD_REQUEST, INVALID_OWNERSHIP_TRANSFER, CANN
246
247
  DRIVE3_DELETE_ACL_THROW_REASONS = [BAD_REQUEST, CANNOT_REMOVE_OWNER,
247
248
  CANNOT_MODIFY_INHERITED_TEAMDRIVE_PERMISSION,
248
249
  INSUFFICIENT_ADMINISTRATOR_PRIVILEGES, SHARING_RATE_LIMIT_EXCEEDED,
249
- NOT_FOUND, PERMISSION_NOT_FOUND]
250
+ NOT_FOUND, PERMISSION_NOT_FOUND, CANNOT_DELETE_PERMISSION]
250
251
  DRIVE3_MODIFY_LABEL_THROW_REASONS = DRIVE_USER_THROW_REASONS+[FILE_NOT_FOUND, NOT_FOUND, FORBIDDEN, INTERNAL_ERROR,
251
252
  FILE_NEVER_WRITABLE, APPLY_LABEL_FORBIDDEN,
252
253
  INSUFFICIENT_ADMINISTRATOR_PRIVILEGES, INSUFFICIENT_FILE_PERMISSIONS,
@@ -382,6 +383,8 @@ class cannotCopyFile(Exception):
382
383
  pass
383
384
  class cannotDeleteOnlyRevision(Exception):
384
385
  pass
386
+ class cannotDeletePermission(Exception):
387
+ pass
385
388
  class cannotDeletePrimaryCalendar(Exception):
386
389
  pass
387
390
  class cannotDeletePrimarySendAs(Exception):
@@ -676,6 +679,7 @@ REASON_EXCEPTION_MAP = {
676
679
  CANNOT_CHANGE_OWN_PRIMARY_SUBSCRIPTION: cannotChangeOwnPrimarySubscription,
677
680
  CANNOT_COPY_FILE: cannotCopyFile,
678
681
  CANNOT_DELETE_ONLY_REVISION: cannotDeleteOnlyRevision,
682
+ CANNOT_DELETE_PERMISSION: cannotDeletePermission,
679
683
  CANNOT_DELETE_PRIMARY_CALENDAR: cannotDeletePrimaryCalendar,
680
684
  CANNOT_DELETE_PRIMARY_SENDAS: cannotDeletePrimarySendAs,
681
685
  CANNOT_DELETE_RESOURCE_WITH_CHILDREN: cannotDeleteResourceWithChildren,
gam/gamlib/glglobals.py CHANGED
@@ -85,6 +85,8 @@ CSV_OUTPUT_ROW_FILTER_MODE = 'corm'
85
85
  CSV_OUTPUT_ROW_LIMIT = 'corl'
86
86
  # Add timestamp column to CSV output file
87
87
  CSV_OUTPUT_TIMESTAMP_COLUMN = 'cotc'
88
+ # Transpose output rows/columns
89
+ CSV_OUTPUT_TRANSPOSE = 'cotr'
88
90
  # Output sort headers
89
91
  CSV_OUTPUT_SORT_HEADERS = 'cosh'
90
92
  # CSV todrive options
@@ -250,6 +252,7 @@ Globals = {
250
252
  CSV_OUTPUT_ROW_LIMIT: 0,
251
253
  CSV_OUTPUT_SORT_HEADERS: [],
252
254
  CSV_OUTPUT_TIMESTAMP_COLUMN: None,
255
+ CSV_OUTPUT_TRANSPOSE: False,
253
256
  CSV_TODRIVE: {},
254
257
  CURRENT_API_SERVICES: {},
255
258
  CURRENT_CLIENT_API: None,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gam7
3
- Version: 7.5.15
3
+ Version: 7.5.17
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=7Eir0fwDwfwLMnd9ATkWeI0HYiEk4510od0N_ghrDQk,3482168
1
+ gam/__init__.py,sha256=tA4Z9D_gcIqT7nHkXHoNr4GdGye0q2-M4KoAqHwMI7g,3483148
2
2
  gam/__main__.py,sha256=amz0-959ph6zkZKqjaar4n60yho-T37w6qWI36qx0CA,1049
3
3
  gam/cacerts.pem,sha256=nJuWha0xm5dHw_5ptGphwRoO-r36Ccpqiww9pCEDbSc,67484
4
4
  gam/cbcm-v1.1beta1.json,sha256=xO5XloCQQULmPbFBx5bckdqmbLFQ7sJ2TImhE1ysDIY,19439
@@ -27,9 +27,9 @@ gam/gamlib/glapi.py,sha256=EAQXkaM13t6jjh9vL4eHJqIZRI5kmzeneiFs5xcWXfg,34304
27
27
  gam/gamlib/glcfg.py,sha256=cV011FpIWge4oi5_dJrdof66vUqX6UCvTGWWTNVmYEg,28055
28
28
  gam/gamlib/glclargs.py,sha256=ptSTGELZHQS6SfvGGJ3NrXRoHAToO108NTYsFQE-C4c,42200
29
29
  gam/gamlib/glentity.py,sha256=ZLbyMl9NhN-MBf9Rxmho2dBYeS4SNLMctpeaKFZSbQ4,33801
30
- gam/gamlib/glgapi.py,sha256=TYPc91Ab-tNr-_nRArhPdRaB_6FbCZjBBNpEmRJuXrw,38295
30
+ gam/gamlib/glgapi.py,sha256=49PPbxiW6EpPE4E8fAlLMx1mSMcQra1zwi-CSXPa7rk,38473
31
31
  gam/gamlib/glgdata.py,sha256=weRppttWm6uRyqtBoGPKoHiNZ2h28nhfUV4J_mbCszY,2707
32
- gam/gamlib/glglobals.py,sha256=B0kCz4K6PO1-n3eZI_lvdRG99Ane1-dH4zS4J4aymlI,9566
32
+ gam/gamlib/glglobals.py,sha256=Y73xM1RNhIbtcqnMv1gcZF3wDWOeLWW-7SvoQyWw6tA,9659
33
33
  gam/gamlib/glindent.py,sha256=RfBa2LDfLIqPLL5vMfC689TCVmqn8xf-qulSzkiatrc,1228
34
34
  gam/gamlib/glmsgs.py,sha256=fUEwnzJsyThJDgrqslhXFLp7Ah_5e3VuyGNWAJKRi5o,33260
35
35
  gam/gamlib/glskus.py,sha256=Gi0jjrSGwhCD4SvtqQfuAXwtEiL2zU4c8qXdxO1yY9k,15058
@@ -65,8 +65,8 @@ gam/googleapiclient/discovery_cache/base.py,sha256=yCDPtxnbNN-p5_9fzBacC6P3wcUPl
65
65
  gam/googleapiclient/discovery_cache/file_cache.py,sha256=sim3Mg4HgRYo3vX75jvcKy_aV568EvIrtBfvfbw-044,4774
66
66
  gam/iso8601/__init__.py,sha256=Z2PsYbXgAH5a5xzUvgczCboPzqWpm65kRcIngCnhViU,1218
67
67
  gam/iso8601/iso8601.py,sha256=Li2FHZ4sBTWuthuQhyCvmvj0j6At8JbGzkSv2fc2RHU,4384
68
- gam7-7.5.15.dist-info/METADATA,sha256=FQzlMBzuewfS_WQfAb6WNFWAAm6AL-npFYLtPrw7rXc,2889
69
- gam7-7.5.15.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
70
- gam7-7.5.15.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
71
- gam7-7.5.15.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
72
- gam7-7.5.15.dist-info/RECORD,,
68
+ gam7-7.5.17.dist-info/METADATA,sha256=LFvbdN1WEH57N7LgJ6pniGv1a82HW893OR-CZoR-RkI,2889
69
+ gam7-7.5.17.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
70
+ gam7-7.5.17.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
71
+ gam7-7.5.17.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
72
+ gam7-7.5.17.dist-info/RECORD,,
File without changes