diff --git a/docs/GamUpdates.md b/docs/GamUpdates.md index 7f36f820..953b1318 100644 --- a/docs/GamUpdates.md +++ b/docs/GamUpdates.md @@ -10,6 +10,28 @@ 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.65.14 + +Fixed bug in gam copy|move drivefile` that caused a trap. +``` +UnboundLocalError: cannot access local variable 'emailAddress' where it is not associated with a value +``` + +### 6.65.13 + +Added support for user language `en-CA`. + + +Added option `sizefield quotabytesused|size` to the following commands that specifies which +file size field to use when totaling file sizes; the default value is `quotabytesused`; previous versions used `size`. +``` +gam print|show filecounts +gam print filelist +gam print|show filetree +gam print diskusage +``` +See: https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Drive-Files-Display#file-size-fields + ### 6.65.12 Additional updates on MacOS when a `gam csv` command is interrupted with a contol-C. diff --git a/docs/How-to-Upgrade-from-Standard-GAM.md b/docs/How-to-Upgrade-from-Standard-GAM.md index a418dd9f..4b7ba0f7 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.65.12 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.65.14 - 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.65.12 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.65.14 - 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-Drive-Files-Display.md b/docs/Users-Drive-Files-Display.md index 47dfef6e..bb449865 100644 --- a/docs/Users-Drive-Files-Display.md +++ b/docs/Users-Drive-Files-Display.md @@ -5,6 +5,7 @@ - [Permission Matches](Permission-Matches) - [Definitions](#definitions) - [Return Codes](#return-codes) +- [File size fields](#file-size-fields) - [Display file information](#display-file-information) - [Display file paths](#display-file-paths) - [Select files for Display file counts, list, tree](#select-files-for-display-file-counts-list-tree) @@ -358,6 +359,29 @@ $ echo $? 60 ``` +## File size fields +The Drive API defines two fields that relate to file size: `quotaBytesUsed` and `size`. +``` +quotaBytesUsed - The number of storage quota bytes used by the file. + This includes the head revision as well as previous revisions with keepForever enabled. +size - Size in bytes of blobs and first party editor files. +``` +Previously, GAM used the `size` field when totaling file sizes, it now uses the `quotaBytesUsed` field. +The option `sizefield quotabytesused|size` allows you to select which field to use. + +For most MIME types, the values are the same; for the following MIME types, `quotabytesused` is larger. +``` +application/pdf +application/vnd.ms-powerpoint +application/vnd.openxmlformats-officedocument.presentationml.presentation +application/vnd.openxmlformats-officedocument.spreadsheetml.sheet +application/vnd.openxmlformats-officedocument.wordprocessingml.document +application/zip +audio/mpeg +image/jpeg +image/png +``` + ## Display file information Display file details in indented keyword: value format. The two forms are equivalent. ``` @@ -617,7 +641,8 @@ gam print filecounts [todrive *] [corpora ] [select ] [anyowner|(showownedby any|me|others)] - [showmimetype [not] ] [minimumfilesize ] [maximumfilesize ] + [showmimetype [not] ] + [sizefield quotabytesused|size] [minimumfilesize ] [maximumfilesize ] [filenamematchpattern ] * [] [] [excludetrashed] @@ -629,7 +654,8 @@ gam show filecounts [corpora ] [select ] [anyowner|(showownedby any|me|others)] - [showmimetype [not] ] [minimumfilesize ] [maximumfilesize ] + [showmimetype [not] ] + [sizefield quotabytesused|size] [minimumfilesize ] [maximumfilesize ] [filenamematchpattern ] * [] [] [excludetrashed] @@ -860,7 +886,8 @@ gam print filetree [todrive *] [select [selectsubquery ] [depth ]] [anyowner|(showownedby any|me|others)] - [showmimetype [not] ] [minimumfilesize ] [maximumfilesize ] + [showmimetype [not] ] + [sizefield quotabytesused|size] [minimumfilesize ] [maximumfilesize ] [filenamematchpattern ] * [] [] [excludetrashed] @@ -871,7 +898,8 @@ gam show filetree [select [selectsubquery ] [depth ]] [anyowner|(showownedby any|me|others)] - [showmimetype [not] ] [minimumfilesize ] [maximumfilesize ] + [showmimetype [not] ] + [sizefield quotabytesused|size] [minimumfilesize ] [maximumfilesize ] [filenamematchpattern ] * [] [] [excludetrashed] @@ -929,12 +957,14 @@ gam print|show filelist [todrive *] [select [selectsubquery ] [(norecursion [])|(depth )] [showparent]] [anyowner|(showownedby any|me|others)] - [showmimetype [not] ] [minimumfilesize ] [maximumfilesize ] + [showmimetype [not] ] + [sizefield quotabytesused|size] [minimumfilesize ] [maximumfilesize ] [filenamematchpattern ] * [] [] [pmfilter] [oneitemperrow] [excludetrashed] [maxfiles ] [nodataheaders ] - [countsonly [summary none|only|plus] [summaryuser ] [showsource] [showsize] [showmimetypesize]] [countsrowfilter] + [countsonly [summary none|only|plus] [summaryuser ] + [showsource] [showsize] [showmimetypesize]] [countsrowfilter] [filepath|fullpath [pathdelimiter ] [addpathstojson] [showdepth]] [buildtree] [allfields|*|(fields )] [showdrivename] [showshareddrivepermissions] @@ -1442,6 +1472,7 @@ BadNews-NoData ``` gam print diskusage [todrive *] [anyowner|(showownedby any|me|others)] + [sizefield quotabytesused|size] [pathdelimiter ] [excludetrashed] [stripcrsfromname] (addcsvdata )* [noprogress] [show all|summary|summaryandtrash] diff --git a/docs/Version-and-Help.md b/docs/Version-and-Help.md index 35d3ea4a..493a120d 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.65.12 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.65.14 - 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.65.12 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.65.14 - 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.65.12 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource +GAMADV-XTD3 6.65.14 - 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.65.12 + Latest: 6.65.14 echo $? 1 ``` @@ -73,7 +73,7 @@ echo $? Print the current version number without details ``` gam version simple -6.65.12 +6.65.14 ``` 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.65.12 - https://github.com/taers232c/GAMADV-XTD3 +GAM 6.65.14 - 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/GamCommands.txt b/src/GamCommands.txt index 9985d81b..2f907739 100644 --- a/src/GamCommands.txt +++ b/src/GamCommands.txt @@ -125,7 +125,7 @@ If an item contains spaces, it should be surrounded by ". #7a4706|#8a1c0a|#994a64|#ffffff ::= ach|af|ag|ak|am|ar|az|be|bem|bg|bn|br|bs|ca|chr|ckb|co|crs|cs|cy|da|de| - ee|el|en|en-gb|en-us|eo|es|es-419|et|eu|fa|fi|fil|fo|fr|fr-ca|fy| + ee|el|en|en-ca|en-gb|en-us|eo|es|es-419|et|eu|fa|fi|fil|fo|fr|fr-ca|fy| ga|gaa|gd|gl|gn|gu|ha|haw|he|hi|hr|ht|hu|hy|ia|id|ig|in|is|it|iw|ja|jw| ka|kg|kk|km|kn|ko|kri|ku|ky|la|lg|ln|lo|loz|lt|lua|lv| mfe|mg|mi|mk|ml|mn|mo|mr|ms|mt|my|ne|nl|nn|no|nso|ny|nyn|oc|om|or| @@ -6488,7 +6488,8 @@ gam print filecounts [todrive *] [corpora ] [select ] [anyowner|(showownedby any|me|others)] - [showmimetype [not] ] [minimumfilesize ] [maximumfilesize ] + [showmimetype [not] ] + [sizefield quotabytesused|size] [minimumfilesize ] [maximumfilesize ] [filenamematchpattern ] * [] [] [excludetrashed] @@ -6500,7 +6501,8 @@ gam show filecounts [corpora ] [select ] [anyowner|(showownedby any|me|others)] - [showmimetype [not] ] [minimumfilesize ] [maximumfilesize ] + [showmimetype [not] ] + [sizefield quotabytesused|size] [minimumfilesize ] [maximumfilesize ] [filenamematchpattern ] * [] [] [excludetrashed] @@ -6531,7 +6533,8 @@ gam print filetree [todrive *] [select [selectsubquery ] [depth ]] [anyowner|(showownedby any|me|others)] - [showmimetype [not] ] [minimumfilesize ] [maximumfilesize ] + [showmimetype [not] ] + [sizefield quotabytesused|size] [minimumfilesize ] [maximumfilesize ] [filenamematchpattern ] * [] [] [excludetrashed] @@ -6542,7 +6545,8 @@ gam show filetree [select [selectsubquery ] [depth ]] [anyowner|(showownedby any|me|others)] - [showmimetype [not] ] [minimumfilesize ] [maximumfilesize ] + [showmimetype [not] ] + [sizefield quotabytesused|size] [minimumfilesize ] [maximumfilesize ] [filenamematchpattern ] * [] [] [excludetrashed] @@ -6558,12 +6562,15 @@ gam print filelist [todrive *] [select [selectsubquery ] [(norecursion [])|(depth )] [showparent]] [anyowner|(showownedby any|me|others)] - [showmimetype [not] ] [minimumfilesize ] [maximumfilesize ] + [showmimetype [not] ] + [sizefield quotabytesused|size] [minimumfilesize ] [maximumfilesize ] [filenamematchpattern ] * [] [] [pmfilter] [oneitemperrow] [excludetrashed] [maxfiles ] [nodataheaders ] - [countsonly [summary none|only|plus] [summaryuser ] [showsource] [showsize] [showmimetypesize]] [countsrowfilter] + [countsonly [summary none|only|plus] [summaryuser ] + [showsource] [showsize] [showmimetypesize]] + [countsrowfilter] [filepath|fullpath [pathdelimiter ] [addpathstojson] [showdepth]] [buildtree] [allfields|*|(fields )] [showdrivename] [showshareddrivepermissions] @@ -6576,6 +6583,7 @@ gam print filelist [todrive *] gam print diskusage [todrive *] [anyowner|(showownedby any|me|others)] + [sizefield quotabytesused|size] [pathdelimiter ] [excludetrashed] [stripcrsfromname] (addcsvdata )* [noprogress] [show all|summary|summaryandtrash] diff --git a/src/GamUpdate.txt b/src/GamUpdate.txt index 803b8ea8..c1aef278 100644 --- a/src/GamUpdate.txt +++ b/src/GamUpdate.txt @@ -2,6 +2,27 @@ Merged GAM-Team version +6.65.14 + +Fixed bug in gam copy|move drivefile` that caused a trap. +``` +UnboundLocalError: cannot access local variable 'emailAddress' where it is not associated with a value +``` + +6.65.13 + +Added support for user language `en-CA`. + +Added option `sizefield quotabytesused|size` to the following commands that specifies which +file size field to use when totaling file sizes; the default value is `quotabytesused`; previous versions used `size`. +``` +gam print|show filecounts +gam print filelist +gam print|show filetree +gam print diskusage +``` +See: https://github.com/taers232c/GAMADV-XTD3/wiki/Users-Drive-Files-Display#file-size-fields + 6.65.12 Additional updates on MacOS when a `gam csv` command is interrupted with a contol-C. diff --git a/src/gam/__init__.py b/src/gam/__init__.py index 0ed3c2ec..4eed9a65 100755 --- a/src/gam/__init__.py +++ b/src/gam/__init__.py @@ -1101,7 +1101,7 @@ LANGUAGE_CODES_MAP = { 'ach': 'ach', 'af': 'af', 'ag': 'ga', 'ak': 'ak', 'am': 'am', 'ar': 'ar', 'az': 'az', #Luo, Afrikaans, Irish, Akan, Amharic, Arabica, Azerbaijani 'be': 'be', 'bem': 'bem', 'bg': 'bg', 'bn': 'bn', 'br': 'br', 'bs': 'bs', 'ca': 'ca', #Belarusian, Bemba, Bulgarian, Bengali, Breton, Bosnian, Catalan 'chr': 'chr', 'ckb': 'ckb', 'co': 'co', 'crs': 'crs', 'cs': 'cs', 'cy': 'cy', 'da': 'da', #Cherokee, Kurdish (Sorani), Corsican, Seychellois Creole, Czech, Welsh, Danish - 'de': 'de', 'ee': 'ee', 'el': 'el', 'en': 'en', 'en-gb': 'en-GB', 'en-us': 'en-US', 'eo': 'eo', #German, Ewe, Greek, English, English (UK), English (US), Esperanto + 'de': 'de', 'ee': 'ee', 'el': 'el', 'en': 'en', 'en-ca': 'en-CA', 'en-gb': 'en-GB', 'en-us': 'en-US', 'eo': 'eo', #German, Ewe, Greek, English, English (CA), English (UK), English (US), Esperanto 'es': 'es', 'es-419': 'es-419', 'et': 'et', 'eu': 'eu', 'fa': 'fa', 'fi': 'fi', 'fil': 'fil', 'fo': 'fo', #Spanish, Spanish (Latin American), Estonian, Basque, Persian, Finnish, Filipino, Faroese 'fr': 'fr', 'fr-ca': 'fr-CA', 'fy': 'fy', 'ga': 'ga', 'gaa': 'gaa', 'gd': 'gd', 'gl': 'gl', #French, French (Canada), Frisian, Irish, Ga, Scots Gaelic, Galician 'gn': 'gn', 'gu': 'gu', 'ha': 'ha', 'haw': 'haw', 'he': 'he', 'hi': 'hi', 'hr': 'hr', #Guarani, Gujarati, Hausa, Hawaiian, Hebrew, Hindi, Croatian @@ -9564,7 +9564,8 @@ def MultiprocessGAMCommands(items, showCmds): parallelPoolProcesses = numPoolProcesses else: parallelPoolProcesses = min(numItems, GC.Values[GC.MULTIPROCESS_POOL_LIMIT]) - origSigintHandler = signal.signal(signal.SIGINT, signal.SIG_IGN) +# origSigintHandler = signal.signal(signal.SIGINT, signal.SIG_IGN) + signal.signal(signal.SIGINT, signal.SIG_IGN) mpManager = multiprocessing.Manager() l = mpManager.Lock() try: @@ -52145,8 +52146,8 @@ class DriveListParameters(): def CheckMimeType(self, fileInfo): return self.mimeTypeCheck.Check(fileInfo) - def CheckFileSize(self, fileInfo): - size = int(fileInfo.get('size', '0')) + def CheckFileSize(self, fileInfo, sizeField): + size = int(fileInfo.get(sizeField, '0')) if self.minimumFileSize is not None and size < self.minimumFileSize: return False if self.maximumFileSize is not None and size > self.maximumFileSize: @@ -52177,6 +52178,11 @@ FILECOUNT_SUMMARY_CHOICE_MAP = { } FILECOUNT_SUMMARY_USER = 'Summary' +SIZE_FIELD_CHOICE_MAP = { + 'size': 'size', + 'quotabytesused': 'quotaBytesUsed' + } + # gam print filelist [todrive *] # [((query ) | (fullquery ) | ) (querytime