From 48862997b0f38df15959e9c24f5ca5bf56fabf29 Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Thu, 7 Dec 2023 08:29:11 -0800 Subject: [PATCH] Added additional columns `isBase` and `baseId' to `gam print fileparenttree` --- docs/GamUpdates.md | 5 +++++ docs/How-to-Upgrade-from-Standard-GAM.md | 4 ++-- docs/Users-Gmail-Messages-Threads.md | 4 ++-- docs/Version-and-Help.md | 12 ++++++------ src/GamUpdate.txt | 5 +++++ src/gam/__init__.py | 12 ++++++++---- 6 files changed, 28 insertions(+), 14 deletions(-) diff --git a/docs/GamUpdates.md b/docs/GamUpdates.md index fca78482..4f950994 100644 --- a/docs/GamUpdates.md +++ b/docs/GamUpdates.md @@ -10,6 +10,11 @@ Add the `-s` option to the end of the above commands to suppress creating the `g See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation +### 6.66.08 + +Added additional columns `isBase` and `baseId' to `gam print fileparenttree` +to simplify processing the output in a script. + ### 6.66.07 Fixed bug in `gam print diskusage` that caused a trap. diff --git a/docs/How-to-Upgrade-from-Standard-GAM.md b/docs/How-to-Upgrade-from-Standard-GAM.md index 97f22ade..06288160 100644 --- a/docs/How-to-Upgrade-from-Standard-GAM.md +++ b/docs/How-to-Upgrade-from-Standard-GAM.md @@ -334,7 +334,7 @@ writes the credentials into the file oauth2.txt. admin@server:/Users/admin/bin/gamadv-xtd3$ rm -f /Users/admin/GAMConfig/oauth2.txt admin@server:/Users/admin/bin/gamadv-xtd3$ ./gam version WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found -GAMADV-XTD3 6.66.07 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.66.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.10.8 64-bit final MacOS High Sierra 10.13.6 x86_64 @@ -1002,7 +1002,7 @@ writes the credentials into the file oauth2.txt. C:\GAMADV-XTD3>del C:\GAMConfig\oauth2.txt C:\GAMADV-XTD3>gam version WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found -GAMADV-XTD3 6.66.07 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.66.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.0 64-bit final Windows-10-10.0.17134 AMD64 diff --git a/docs/Users-Gmail-Messages-Threads.md b/docs/Users-Gmail-Messages-Threads.md index ddb27ffe..ef31a44a 100644 --- a/docs/Users-Gmail-Messages-Threads.md +++ b/docs/Users-Gmail-Messages-Threads.md @@ -17,7 +17,7 @@ - [Display a selected set of messages](#display-a-selected-set-of-messages) - [Choose information to display](#choose-information-to-display) - [Display message content](#display-message-content) - - [Display message count](#display-message-count) + - [Display message counts](#display-message-counts) - [Display label counts](#display-label-counts) - [Print only options](#print-only-options) - [Show only options](#show-only-options) @@ -539,7 +539,7 @@ The `dateheaderconverttimezone []>` option converts `` * `showsize` - Display the message size * `showsnippet` - Display the message snippet -### Display message count and optionally cumulative message size +### Display message counts * `countsonly` - Display the count of the number of messages * `showsize` - Display the cumulative message size diff --git a/docs/Version-and-Help.md b/docs/Version-and-Help.md index b9ceb14e..173a46eb 100644 --- a/docs/Version-and-Help.md +++ b/docs/Version-and-Help.md @@ -4,7 +4,7 @@ Print the current version of Gam with details ``` gam version -GAMADV-XTD3 6.66.07 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.66.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.0 64-bit final MacOS Monterey 12.7 x86_64 @@ -16,7 +16,7 @@ Time: 2023-06-02T21:10:00-07:00 Print the current version of Gam with details and time offset information ``` gam version timeoffset -GAMADV-XTD3 6.66.07 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.66.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.0 64-bit final MacOS Monterey 12.7 x86_64 @@ -28,7 +28,7 @@ Your system time differs from www.googleapis.com by less than 1 second Print the current version of Gam with extended details and SSL information ``` gam version extended -GAMADV-XTD3 6.66.07 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.66.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.0 64-bit final MacOS Monterey 12.7 x86_64 @@ -65,7 +65,7 @@ MacOS High Sierra 10.13.6 x86_64 Path: /Users/Admin/bin/gamadv-xtd3 Version Check: Current: 5.35.08 - Latest: 6.66.07 + Latest: 6.66.08 echo $? 1 ``` @@ -73,7 +73,7 @@ echo $? Print the current version number without details ``` gam version simple -6.66.07 +6.66.08 ``` In Linux/MacOS you can do: ``` @@ -83,7 +83,7 @@ echo $VER Print the current version of Gam and address of this Wiki ``` gam help -GAM 6.66.07 - https://github.com/taers232c/GAMADV-XTD3 +GAM 6.66.08 - https://github.com/taers232c/GAMADV-XTD3 Ross Scroggs Python 3.12.0 64-bit final MacOS Monterey 12.7 x86_64 diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index 255a4642..f3b29711 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -2,6 +2,11 @@ Merged GAM-Team version +6.66.08 + +Added additional columns `isBase` and `baseId` to `gam print fileparenttree` +to simplify processing the output in a script. + 6.66.07 Fixed bug in `gam print diskusage` that caused a trap. diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 4ed0046f..3d69def8 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -53344,7 +53344,7 @@ def printShowFilePaths(users): # [stripcrsfromname] def printFileParentTree(users): fileNameTitle = 'title' if not GC.Values[GC.DRIVE_V3_NATIVE_NAMES] else 'name' - csvPF = CSVPrintFile(['Owner', 'id', fileNameTitle, 'parentId', 'depth', 'isRoot'], 'sortall') + csvPF = CSVPrintFile(['Owner', 'isBase', 'baseId', 'id', fileNameTitle, 'parentId', 'depth', 'isRoot'], 'sortall') fileIdEntity = getDriveFileEntity() stripCRsFromName = False while Cmd.ArgumentsRemaining(): @@ -53372,6 +53372,7 @@ def printFileParentTree(users): for fileId in fileIdEntity['list']: j += 1 fileList = [] + baseId = fileId while True: try: result = callGAPI(drive.files(), 'get', @@ -53401,9 +53402,11 @@ def printFileParentTree(users): userSvcNotApplicableOrDriveDisabled(user, str(e), i, count) break kcount = len(fileList) + isBase = True for result in fileList: - csvPF.WriteRow({'Owner': user, 'id': result['id'], fileNameTitle: result['name'], 'parentId': result['parents'][0], - 'depth': kcount, 'isRoot': result['isRoot']}) + csvPF.WriteRow({'Owner': user, 'isBase': isBase, 'baseId': baseId, 'id': result['id'], fileNameTitle: result['name'], + 'parentId': result['parents'][0], 'depth': kcount, 'isRoot': result['isRoot']}) + isBase = False kcount -= 1 csvPF.writeCSVfile('Drive File Parent Tree') @@ -66825,7 +66828,8 @@ def printShowMessagesThreads(users, entityType): if senderMatchPattern: row['Sender'] = sender if not show_size: - labelsMap.pop('size', None) + for label in labelsMap.values(): + label.pop('size', None) csvPF.WriteRowTitles(flattenJSON({'Labels': sorted(iter(labelsMap.values()), key=lambda k: k['name'])}, flattened=row)) elif not senderMatchPattern: if not csvPF: