Fixed progress messages for gam <UserTypeEntity> print filelist

This commit is contained in:
Ross Scroggs
2026-03-31 07:50:36 -07:00
parent 1ea3c29ba2
commit 4642868969
2 changed files with 10 additions and 6 deletions

View File

@@ -1,6 +1,11 @@
7.39.02
Fixed progress messages for `gam <UserTypeEntity> print filelist` when permissions were being
displayed/matched for Shared Drives.
7.39.01 7.39.01
Updated 'gam <UserTypeEntity> transfer drive <UserItem>` to handle the following error: Updated `gam <UserTypeEntity> transfer drive <UserItem>` to handle the following error:
``` ```
ERROR: 403: cannotDeletePermission - The authenticated user cannot delete the permission. ERROR: 403: cannotDeletePermission - The authenticated user cannot delete the permission.
``` ```

View File

@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
""" """
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>' __author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
__version__ = '7.39.01' __version__ = '7.39.02'
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)' __license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
# pylint: disable=wrong-import-position # pylint: disable=wrong-import-position
@@ -59337,7 +59337,7 @@ def printFileList(users):
csvPF.WriteRowTitlesJSONNoFilter(row) csvPF.WriteRowTitlesJSONNoFilter(row)
def _printFileInfo(drive, user, f_file, cleanFileName): def _printFileInfo(drive, user, f_file, cleanFileName):
nonlocal getSharedDriveACLsCount, getSharedDriveACLsCountMsg nonlocal getSharedDriveACLsCount
driveId = f_file.get('driveId') driveId = f_file.get('driveId')
checkSharedDrivePermissions = getPermissionsForSharedDrives and driveId and 'permissions' not in f_file checkSharedDrivePermissions = getPermissionsForSharedDrives and driveId and 'permissions' not in f_file
if (f_file.get('noDisplay', False) or if (f_file.get('noDisplay', False) or
@@ -59354,7 +59354,7 @@ def printFileList(users):
if not incrementalPrint: if not incrementalPrint:
getSharedDriveACLsCount += 1 getSharedDriveACLsCount += 1
if getSharedDriveACLsCount % 100 == 0: if getSharedDriveACLsCount % 100 == 0:
writeStderr(f'{Msg.GOT} {getSharedDriveACLsCount} {getSharedDriveACLsCountMsg}') writeStderr(f'{Msg.GOT} {getSharedDriveACLsCount} {Ent.Plural(Ent.DRIVE_FILE_OR_FOLDER_ACL)} {Msg.FOR} {gettingEntity}\n')
try: try:
f_file['permissions'] = callGAPIpages(drive.permissions(), 'list', 'permissions', f_file['permissions'] = callGAPIpages(drive.permissions(), 'list', 'permissions',
throwReasons=GAPI.DRIVE3_GET_ACL_REASONS, throwReasons=GAPI.DRIVE3_GET_ACL_REASONS,
@@ -59530,7 +59530,7 @@ def printFileList(users):
simpleLists = ['permissionIds', 'spaces'] simpleLists = ['permissionIds', 'spaces']
skipObjects = set() skipObjects = set()
fileIdEntity = {} fileIdEntity = {}
getSharedDriveACLsCountMsg = selectSubQuery = '' selectSubQuery = ''
delimiter = GC.Values[GC.CSV_OUTPUT_FIELD_DELIMITER] delimiter = GC.Values[GC.CSV_OUTPUT_FIELD_DELIMITER]
DLP = DriveListParameters({'allowChoose': True, 'allowCorpora': True, 'allowQuery': True, 'mimeTypeInQuery': False}) DLP = DriveListParameters({'allowChoose': True, 'allowCorpora': True, 'allowQuery': True, 'mimeTypeInQuery': False})
DFF = DriveFileFields() DFF = DriveFileFields()
@@ -59613,7 +59613,6 @@ def printFileList(users):
elif myarg == 'showshareddrivepermissions': elif myarg == 'showshareddrivepermissions':
getPermissionsForSharedDrives = True getPermissionsForSharedDrives = True
permissionsFields = f'nextPageToken,permissions({",".join(DRIVEFILE_BASIC_PERMISSION_FIELDS)})' permissionsFields = f'nextPageToken,permissions({",".join(DRIVEFILE_BASIC_PERMISSION_FIELDS)})'
getSharedDriveACLsCountMsg = f'{Ent.Plural(Ent.DRIVE_FILE_OR_FOLDER_ACL)} {Msg.FOR} {Ent.Plural(Ent.SHAREDDRIVE)}\n'
elif myarg == 'pmfilter': elif myarg == 'pmfilter':
pmselect = False pmselect = False
elif myarg == 'oneitemperrow': elif myarg == 'oneitemperrow':