Updated gam <UserTypeEntity> get drivefile <DriveFileEntity>

to handle the following error
that seems to occur when multiple tabs from a Google sheet are being downloaded in parallel.
```
Download Failed: HTTP Error: 429
```
This commit is contained in:
Ross Scroggs
2023-11-13 16:59:11 -08:00
parent b5f5291e14
commit fac8c11798
7 changed files with 45 additions and 12 deletions

View File

@@ -10,6 +10,14 @@ 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 See [Downloads](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads) for Windows or other options, including manual installation
### 6.65.09
Updated `gam <UserTypeEntity> get drivefile <DriveFileEntity>` to handle the following error
that seems to occur when multiple tabs from a Google sheet are being downloaded in parallel.
```
Download Failed: HTTP Error: 429
```
### 6.65.08 ### 6.65.08
Added option `addcsvdata <FieldName> <String>` to `gam report <ActivityApplicationName>` that adds Added option `addcsvdata <FieldName> <String>` to `gam report <ActivityApplicationName>` that adds

View File

@@ -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$ rm -f /Users/admin/GAMConfig/oauth2.txt
admin@server:/Users/admin/bin/gamadv-xtd3$ ./gam version 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 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.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.65.09 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.10.8 64-bit final Python 3.10.8 64-bit final
MacOS High Sierra 10.13.6 x86_64 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>del C:\GAMConfig\oauth2.txt
C:\GAMADV-XTD3>gam version C:\GAMADV-XTD3>gam version
WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found WARNING: Config File: C:\GAMConfig\gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: C:\GAMConfig\oauth2.txt, Not Found
GAMADV-XTD3 6.65.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.65.09 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.0 64-bit final Python 3.12.0 64-bit final
Windows-10-10.0.17134 AMD64 Windows-10-10.0.17134 AMD64

View File

@@ -371,7 +371,8 @@ When creating a user or updating a user's password, you can send a message with
[subject <String>] [subject <String>]
[notifypassword <String>] [notifypassword <String>]
[from <EmailAaddress>] [from <EmailAaddress>]
[replyto <EmailAaddress>] [mailbox <EmailAddress>]
[replyto <EmailAddress>]
[<NotifyMessageContent>] [<NotifyMessageContent>]
(replace <Tag> <UserReplacement>)*] (replace <Tag> <UserReplacement>)*]
[notifyonupdate [<Boolean>]] [notifyonupdate [<Boolean>]]
@@ -420,6 +421,7 @@ is sent when the user is updated or created. Use `notifyonupdate false` to suppr
By default, the email is sent from the admin user identified in oauth2.txt, `gam oauth info` will show the value. By default, the email is sent from the admin user identified in oauth2.txt, `gam oauth info` will show the value.
Use `from <EmailAddress>` to specify an alternate from address. Use `from <EmailAddress>` to specify an alternate from address.
Use `mailbox <EmailAddress>` if `from <EmailAddress>` specifies a group; GAM has to login as a user to be able to send a message.
Gam gets no indication as to the status of the message delivery; the from user will get a non-delivery receipt if the message could not be sent to the `notify <EmailAddressList>`. Gam gets no indication as to the status of the message delivery; the from user will get a non-delivery receipt if the message could not be sent to the `notify <EmailAddressList>`.
By default, messages are sent as plain text, use `html` or `html true` to indicate that the message is HTML. By default, messages are sent as plain text, use `html` or `html true` to indicate that the message is HTML.
@@ -494,6 +496,7 @@ gam create user <EmailAddress> [ignorenullpassword] <UserAttribute>*
[subject <String>] [subject <String>]
[notifypassword <String>] [notifypassword <String>]
[from <EmailAaddress>] [from <EmailAaddress>]
[mailbox <EmailAddress>]
[replyto <EmailAaddress>] [replyto <EmailAaddress>]
[<NotifyMessageContent>] [<NotifyMessageContent>]
(replace <Tag> <UserReplacement>)*] (replace <Tag> <UserReplacement>)*]
@@ -605,6 +608,7 @@ gam update user <UserItem> [ignorenullpassword] <UserAttribute>*
[subject <String>] [subject <String>]
[notifypassword <String>] [notifypassword <String>]
[from <EmailAaddress>] [from <EmailAaddress>]
[mailbox <EmailAddress>]
[replyto <EmailAaddress>] [replyto <EmailAaddress>]
[<NotifyMessageContent>] [<NotifyMessageContent>]
(replace <Tag> <UserReplacement>)*] (replace <Tag> <UserReplacement>)*]
@@ -625,6 +629,7 @@ gam update users <UserTypeEntity> [ignorenullpassword] <UserAttribute>*
[subject <String>] [subject <String>]
[notifypassword <String>] [notifypassword <String>]
[from <EmailAaddress>] [from <EmailAaddress>]
[mailbox <EmailAddress>]
[replyto <EmailAaddress>] [replyto <EmailAaddress>]
[<NotifyMessageContent>] [<NotifyMessageContent>]
(replace <Tag> <UserReplacement>)*] (replace <Tag> <UserReplacement>)*]
@@ -645,6 +650,7 @@ gam <UserTypeEntity> update users [ignorenullpassword] <UserAttribute>*
[subject <String>] [subject <String>]
[notifypassword <String>] [notifypassword <String>]
[from <EmailAaddress>] [from <EmailAaddress>]
[mailbox <EmailAddress>]
[replyto <EmailAaddress>] [replyto <EmailAaddress>]
[<NotifyMessageContent>] [<NotifyMessageContent>]
(replace <Tag> <UserReplacement>)*] (replace <Tag> <UserReplacement>)*]

View File

@@ -4,7 +4,7 @@
Print the current version of Gam with details Print the current version of Gam with details
``` ```
gam version gam version
GAMADV-XTD3 6.65.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.65.09 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.0 64-bit final Python 3.12.0 64-bit final
MacOS Monterey 12.7 x86_64 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 Print the current version of Gam with details and time offset information
``` ```
gam version timeoffset gam version timeoffset
GAMADV-XTD3 6.65.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.65.09 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.0 64-bit final Python 3.12.0 64-bit final
MacOS Monterey 12.7 x86_64 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 Print the current version of Gam with extended details and SSL information
``` ```
gam version extended gam version extended
GAMADV-XTD3 6.65.08 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource GAMADV-XTD3 6.65.09 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.0 64-bit final Python 3.12.0 64-bit final
MacOS Monterey 12.7 x86_64 MacOS Monterey 12.7 x86_64
@@ -65,7 +65,7 @@ MacOS High Sierra 10.13.6 x86_64
Path: /Users/Admin/bin/gamadv-xtd3 Path: /Users/Admin/bin/gamadv-xtd3
Version Check: Version Check:
Current: 5.35.08 Current: 5.35.08
Latest: 6.65.08 Latest: 6.65.09
echo $? echo $?
1 1
``` ```
@@ -73,7 +73,7 @@ echo $?
Print the current version number without details Print the current version number without details
``` ```
gam version simple gam version simple
6.65.08 6.65.09
``` ```
In Linux/MacOS you can do: In Linux/MacOS you can do:
``` ```
@@ -83,7 +83,7 @@ echo $VER
Print the current version of Gam and address of this Wiki Print the current version of Gam and address of this Wiki
``` ```
gam help gam help
GAM 6.65.08 - https://github.com/taers232c/GAMADV-XTD3 GAM 6.65.09 - https://github.com/taers232c/GAMADV-XTD3
Ross Scroggs <ross.scroggs@gmail.com> Ross Scroggs <ross.scroggs@gmail.com>
Python 3.12.0 64-bit final Python 3.12.0 64-bit final
MacOS Monterey 12.7 x86_64 MacOS Monterey 12.7 x86_64

View File

@@ -5168,6 +5168,7 @@ gam create|add user <EmailAddress> [ignorenullpassword] <UserAttribute>*
[subject <String>] [subject <String>]
[notifypassword <String>] [notifypassword <String>]
[from <EmailAaddress>] [from <EmailAaddress>]
[mailbox <EmailAaddress>]
[replyto <EmailAaddress>] [replyto <EmailAaddress>]
[<NotifyMessageContent>] [<NotifyMessageContent>]
(replace <Tag> <UserReplacement>)*] (replace <Tag> <UserReplacement>)*]
@@ -5191,6 +5192,7 @@ gam update user <UserItem> [ignorenullpassword] <UserAttribute>*
[subject <String>] [subject <String>]
[notifypassword <String>] [notifypassword <String>]
[from <EmailAaddress>] [from <EmailAaddress>]
[mailbox <EmailAaddress>]
[replyto <EmailAaddress>] [replyto <EmailAaddress>]
[<NotifyMessageContent>] [<NotifyMessageContent>]
(replace <Tag> <UserReplacement>)*] (replace <Tag> <UserReplacement>)*]
@@ -5225,6 +5227,7 @@ gam update users <UserTypeEntity> [ignorenullpassword] <UserAttribute>*
[subject <String>] [subject <String>]
[notifypassword <String>] [notifypassword <String>]
[from <EmailAaddress>] [from <EmailAaddress>]
[mailbox <EmailAaddress>]
[<NotifyMessageContent>] [<NotifyMessageContent>]
(replace <Tag> <UserReplacement>)*] (replace <Tag> <UserReplacement>)*]
[notifyonupdate [<Boolean>]] [setchangepasswordoncreate [<Boolean>]] [notifyonupdate [<Boolean>]] [setchangepasswordoncreate [<Boolean>]]
@@ -5257,6 +5260,7 @@ gam <UserTypeEntity> update users [ignorenullpassword] <UserAttribute>*
[subject <String>] [subject <String>]
[notifypassword <String>] [notifypassword <String>]
[from <EmailAaddress>] [from <EmailAaddress>]
[mailbox <EmailAaddress>]
[<NotifyMessageContent>] [<NotifyMessageContent>]
(replace <Tag> <UserReplacement>)*] (replace <Tag> <UserReplacement>)*]
[notifyonupdate [<Boolean>]] [setchangepasswordoncreate [<Boolean>]] [notifyonupdate [<Boolean>]] [setchangepasswordoncreate [<Boolean>]]

View File

@@ -2,6 +2,14 @@
Merged GAM-Team version Merged GAM-Team version
6.65.09
Updated `gam <UserTypeEntity> get drivefile <DriveFileEntity>` to handle the following error
that seems to occur when multiple tabs from a Google sheet are being downloaded in parallel.
```
Download Failed: HTTP Error: 429
```
6.65.08 6.65.08
Added option `addcsvdata <FieldName> <String>` to `gam report <ActivityApplicationName>` that adds Added option `addcsvdata <FieldName> <String>` to `gam report <ActivityApplicationName>` that adds
@@ -5156,7 +5164,7 @@ Updated `gam [<UserTypeEntity>] create teamdrive <Name>` to output the name of t
Team Drive in addition to its ID. Team Drive in addition to its ID.
``` ```
$ gam user user@domain.com create teamdrive Test $ gam user user@domain.com create teamdrive Test
User: user@domain.com, Shared Drive Name: Test, Shared Drive ID: 0ALHCDtCDTx_4Uk9PVA, Created User: user@domain.com, Shared Drive Name: Test, Shared Drive ID: 0ALHCDtCDTx_4Uk9XYZ, Created
``` ```
6.03.20 6.03.20

View File

@@ -56966,7 +56966,14 @@ def getDriveFile(users):
else: else:
if GC.Values[GC.DEBUG_LEVEL] > 0: if GC.Values[GC.DEBUG_LEVEL] > 0:
sys.stderr.write(f'Debug: spreadsheetUrl: {spreadsheetUrl}\n') sys.stderr.write(f'Debug: spreadsheetUrl: {spreadsheetUrl}\n')
status, content = drive._http.request(uri=spreadsheetUrl, method='GET') maxRetries = 10
sleepTime = 5
for retry in range(1, maxRetries+1):
status, content = drive._http.request(uri=spreadsheetUrl, method='GET')
if status['status'] != '429':
break
writeStderr(Msg.RETRYING_GOOGLE_SHEET_EXPORT_SLEEPING.format(retry, maxRetries, sleepTime))
time.sleep(sleepTime)
if status['status'] == '200': if status['status'] == '200':
f.write(content) f.write(content)
if targetStdout and content[-1] != '\n': if targetStdout and content[-1] != '\n':
@@ -58132,7 +58139,7 @@ def transferOwnership(users):
i, count, users = getEntityArgument(users) i, count, users = getEntityArgument(users)
for user in users: for user in users:
i += 1 i += 1
user, drive, jcount = _validateUserGetFileIDs(user, i, count, fileIdEntity, entityType=Ent.DRIVE_FOLDER) user, drive, jcount = _validateUserGetFileIDs(user, i, count, fileIdEntity, entityType=Ent.DRIVE_FILE_OR_FOLDER)
if jcount == 0: if jcount == 0:
continue continue
if filepath: if filepath: