From 8945fd163c697b748270d1646f12443feea93b59 Mon Sep 17 00:00:00 2001 From: Ross Scroggs Date: Mon, 16 Sep 2024 14:12:43 -0700 Subject: [PATCH] Updated print filecounts and update filerevisions --- docs/GamUpdates.md | 11 ++++++ docs/How-to-Upgrade-from-Standard-GAM.md | 4 +- docs/Users-Drive-Files-Display.md | 11 ++++-- docs/Users-Drive-Revisions.md | 2 + docs/Version-and-Help.md | 12 +++--- src/GamCommands.txt | 5 ++- src/GamUpdate.txt | 12 +++++- src/gam/__init__.py | 48 ++++++++++++++++++++---- 8 files changed, 84 insertions(+), 21 deletions(-) diff --git a/docs/GamUpdates.md b/docs/GamUpdates.md index ae789be8..1a53606b 100644 --- a/docs/GamUpdates.md +++ b/docs/GamUpdates.md @@ -10,6 +10,17 @@ Add the `-s` option to the end of the above commands to suppress creating the `g See [Downloads-Installs](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads-Installs) for Windows or other options, including manual installation +### 7.00.02 + +Added option `showlastmodification` to `gam print|show filecounts` that adds +the following fields to the output: `lastModifiedFileId,lastModifiedFileName,lastModifyingUser,lastModifiedTime`; +these are for the most recently modified file. + +Added option `keepforever []` to `gam update filerevisions` that allows setting +`Keep forever` in revisions. + +Upgraded to Python 3.12.6 where possible. + ### 7.00.01 Added option `shownames` to `gam print|show sheet` that causes GAM diff --git a/docs/How-to-Upgrade-from-Standard-GAM.md b/docs/How-to-Upgrade-from-Standard-GAM.md index 9b6bd2ac..5d92943f 100644 --- a/docs/How-to-Upgrade-from-Standard-GAM.md +++ b/docs/How-to-Upgrade-from-Standard-GAM.md @@ -251,7 +251,7 @@ writes the credentials into the file oauth2.txt. admin@server:/Users/admin$ rm -f /Users/admin/GAMConfig/oauth2.txt admin@server:/Users/admin$ 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 7.00.01 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 7.00.02 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.5 64-bit final MacOS Sonoma 14.5 x86_64 @@ -923,7 +923,7 @@ writes the credentials into the file oauth2.txt. C:\>del C:\GAMConfig\oauth2.txt C:\>gam version WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found -GAMADV-XTD3 7.00.01 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 7.00.02 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.5 64-bit final Windows-10-10.0.17134 AMD64 diff --git a/docs/Users-Drive-Files-Display.md b/docs/Users-Drive-Files-Display.md index b7406d79..1dd71455 100644 --- a/docs/Users-Drive-Files-Display.md +++ b/docs/Users-Drive-Files-Display.md @@ -693,7 +693,8 @@ gam print filecounts [todrive *] [filenamematchpattern ] * [] [] [excludetrashed] - [showsize] [showmimetypesize] (addcsvdata )* + [showsize] [showmimetypesize] [showlastmodification] + (addcsvdata )* [summary none|only|plus] [summaryuser ] gam show filecounts [((query ) | (fullquery ) | ) @@ -707,13 +708,13 @@ gam show filecounts [filenamematchpattern ] * [] [] [excludetrashed] - [showsize] [showmimetypesize] + [showsize] [showmimetypesize] [showlastmodification] [summary none|only|plus] [summaryuser ] ``` By default, print filecounts displays counts of all files owned by the specified [``](Collections-of-Users). -The option `continueoninvalidquery [] can be used in special cases where a query of the form +The option `continueoninvalidquery [] can be used in special cases where a query of the form `query "'labels/mRoha85IbwCRl490E00xGLvBsSbkwIiuZ6PRNNEbwxyz' in labels" causes Google to issue an error saying that the query is invalid when, in fact, it is but the user does not have a license that suppprts drive file labels. When `continueoninvalidquery` is true, GAM prints an error message and proceeds to the next user rather that terminating @@ -723,6 +724,10 @@ The `showsize` option displays the total size (in bytes) of the files counted. The showmimetypesize' displays the total size (in bytes) of each MIME type counted. +The option `showlastmodification` displays the following fields: +`lastModifiedFileId,lastModifiedFileName,lastModifyingUser,lastModifiedTime`; +these are for the most recently modified file. + For print filecouts, add additional columns of data from the command line to the output: * `addcsvdata ` - Add additional columns of data from the command line to the output diff --git a/docs/Users-Drive-Revisions.md b/docs/Users-Drive-Revisions.md index f921661d..f856ac46 100644 --- a/docs/Users-Drive-Revisions.md +++ b/docs/Users-Drive-Revisions.md @@ -85,6 +85,8 @@ gam update filerevisions select ` is omitted, all revisions are updated. +* `keepforever true` - Keep revision forever, even if it is no longer the head revision +* `keepforever false` - Do not keep revision forever * `published true` - Publish these revision to the web * `published false` - Do not publish these revision to the web * `publishauto true` - Automaticaly publish subsequent revisions to the web diff --git a/docs/Version-and-Help.md b/docs/Version-and-Help.md index 25f6ed7c..1d9857a1 100644 --- a/docs/Version-and-Help.md +++ b/docs/Version-and-Help.md @@ -3,7 +3,7 @@ Print the current version of Gam with details ``` gam version -GAMADV-XTD3 7.00.01 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 7.00.02 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.5 64-bit final MacOS Sonoma 14.5 x86_64 @@ -15,7 +15,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 7.00.01 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 7.00.02 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.5 64-bit final MacOS Sonoma 14.5 x86_64 @@ -27,7 +27,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 7.00.01 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 7.00.02 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource Ross Scroggs Python 3.12.5 64-bit final MacOS Sonoma 14.5 x86_64 @@ -64,7 +64,7 @@ MacOS High Sierra 10.13.6 x86_64 Path: /Users/Admin/bin/gamadv-xtd3 Version Check: Current: 5.35.08 - Latest: 7.00.01 + Latest: 7.00.02 echo $? 1 ``` @@ -72,7 +72,7 @@ echo $? Print the current version number without details ``` gam version simple -7.00.01 +7.00.02 ``` In Linux/MacOS you can do: ``` @@ -82,7 +82,7 @@ echo $VER Print the current version of Gam and address of this Wiki ``` gam help -GAM 7.00.01 - https://github.com/taers232c/GAMADV-XTD3 +GAM 7.00.02 - https://github.com/taers232c/GAMADV-XTD3 Ross Scroggs Python 3.12.5 64-bit final MacOS Sonoma 14.5 x86_64 diff --git a/src/GamCommands.txt b/src/GamCommands.txt index f2f1ff7c..b0f27def 100644 --- a/src/GamCommands.txt +++ b/src/GamCommands.txt @@ -7043,7 +7043,8 @@ gam print filecounts [todrive *] [filenamematchpattern ] * [] [] [excludetrashed] - [showsize] [showmimetypesize] (addcsvdata )* + [showsize] [showmimetypesize] [showlastmodification] + (addcsvdata )* [summary none|only|plus] [summaryuser ] gam show filecounts [((query ) | (fullquery ) | ) @@ -7057,7 +7058,7 @@ gam show filecounts [filenamematchpattern ] * [] [] [excludetrashed] - [showsize] [showmimetypesize] + [showsize] [showmimetypesize] [showlastmodification] [summary none|only|plus] [summaryuser ] gam print filesharecounts [todrive *] diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index ca6a96fd..0ad2a0d9 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -1,9 +1,19 @@ +7.00.02 + +Added option `showlastmodification` to `gam print|show filecounts` that adds +the following fields to the output: `lastModifiedFileId,lastModifiedFileName,lastModifyingUser,lastModifiedTime`; +these are for the most recently modified file. + +Added option `keepforever []` to `gam update filerevisions` that allows setting +`Keep forever` in revisions. + +Upgraded to Python 3.12.6 where possible. + 7.00.01 Added option `shownames` to `gam print|show sheet` that causes GAM to make an additional API call to get and display the sheet file name that is not supplied by the Sheets API. - 7.00.00 Merged GAM-Team version diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 757c8b72..9cc6eacf 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki """ __author__ = 'GAM Team ' -__version__ = '7.00.01' +__version__ = '7.00.02' __license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)' #pylint: disable=wrong-import-position @@ -53967,12 +53967,14 @@ def deleteFileRevisions(users): Ind.Decrement() REVISIONS_FIELDS_CHOICE_MAP = { + 'keepforever': 'keepForever', 'published': 'published', 'publishauto': 'publishAuto', 'publishedoutsidedomain': 'publishedOutsideDomain' } # gam update filerevisions select [previewupdate] # [published []] [publishauto []] [publishedoutsidedomain []] +# [keepforever []} # [showtitles] [doit] [max_to_update ] def updateFileRevisions(users): fileIdEntity = getDriveFileEntity() @@ -56118,7 +56120,8 @@ def printFileParentTree(users): # [filenamematchpattern ] # * [] [] # [excludetrashed] (addcsvdata )* -# [showsize] [showmimetypesize] +# [showsize] [showmimetypesize] [showlastmodification] +# (addcsvdata )* # [summary none|only|plus] [summaryuser ] # gam show filecounts # [((query ) | (fullquery ) | ) (querytime