mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 20:31:35 +00:00
Added option tdreturnidonly [<Boolean>] to <ToDriveAttribute>
This commit is contained in:
@@ -10,6 +10,11 @@ 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
|
See [Downloads-Installs](https://github.com/taers232c/GAMADV-XTD3/wiki/Downloads-Installs) for Windows or other options, including manual installation
|
||||||
|
|
||||||
|
### 6.80.06
|
||||||
|
|
||||||
|
Added option `tdreturnidonly [<Boolean>]` to `<ToDriveAttribute>` that when true (the default), causes GAM to display
|
||||||
|
only the uploaded file ID to stdout. This can be captured and used in subsequent commands, `tdfileid <DriveFileID>` that will update the same file.
|
||||||
|
|
||||||
### 6.80.05
|
### 6.80.05
|
||||||
|
|
||||||
Added option `individualstudentcoursework copy|delete|maptoall` to `gam create|update course ... copyfrom`
|
Added option `individualstudentcoursework copy|delete|maptoall` to `gam create|update course ... copyfrom`
|
||||||
|
|||||||
@@ -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$ rm -f /Users/admin/GAMConfig/oauth2.txt
|
||||||
admin@server:/Users/admin$ gam version
|
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
|
WARNING: Config File: /Users/admin/GAMConfig/gam.cfg, Section: DEFAULT, Item: oauth2_txt, Value: /Users/admin/GAMConfig/oauth2.txt, Not Found
|
||||||
GAMADV-XTD3 6.80.05 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.80.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.4 64-bit final
|
Python 3.12.4 64-bit final
|
||||||
MacOS Sonoma 14.5 x86_64
|
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:\>del C:\GAMConfig\oauth2.txt
|
||||||
C:\>gam version
|
C:\>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.80.05 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.80.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.4 64-bit final
|
Python 3.12.4 64-bit final
|
||||||
Windows-10-10.0.17134 AMD64
|
Windows-10-10.0.17134 AMD64
|
||||||
|
|||||||
@@ -191,6 +191,7 @@ direct the uploaded file to a particular user and location and add a timestamp t
|
|||||||
(tdnotify [<Boolean>])|
|
(tdnotify [<Boolean>])|
|
||||||
(tdparent (id:<DriveFolderID>)|<DriveFolderName>)|
|
(tdparent (id:<DriveFolderID>)|<DriveFolderName>)|
|
||||||
(tdretaintitle [<Boolean>])|
|
(tdretaintitle [<Boolean>])|
|
||||||
|
(tdreturnidonly [<Boolean>])|
|
||||||
(tdshare <EmailAddress> commenter|reader|writer)*|
|
(tdshare <EmailAddress> commenter|reader|writer)*|
|
||||||
(tdsheet (id:<Number>)|<String>)|
|
(tdsheet (id:<Number>)|<String>)|
|
||||||
(tdsheettimestamp [<Boolean>] [tdsheettimeformat <String>])
|
(tdsheettimestamp [<Boolean>] [tdsheettimeformat <String>])
|
||||||
@@ -238,6 +239,9 @@ If `tdfileid <DriveFileID>` is not specified, a new file is created.
|
|||||||
* `tdcellwrap clip|overflow|wrap` - The Spreadsheet cell wrapping strategy.
|
* `tdcellwrap clip|overflow|wrap` - The Spreadsheet cell wrapping strategy.
|
||||||
* `tdcellnumberformat text|number` - The Spreadsheet number format.
|
* `tdcellnumberformat text|number` - The Spreadsheet number format.
|
||||||
|
|
||||||
|
## Report action
|
||||||
|
* `tdreturnidonly` - If False, a message is written to stdout with the uploaded file URL; if True, only the uploaded file ID is written to stdout
|
||||||
|
|
||||||
## Open browser and send email
|
## Open browser and send email
|
||||||
* `tdnobrowser` - If False, a browser is opened to view the file uploaded to Google Drive; if not specified, the `todrive_nobrowser` value from gam.cfg is used. If True, no browser is opened.
|
* `tdnobrowser` - If False, a browser is opened to view the file uploaded to Google Drive; if not specified, the `todrive_nobrowser` value from gam.cfg is used. If True, no browser is opened.
|
||||||
* `tdnoemail` - If False, an email is sent to `tduser` informing them of name and URL of the uploaded file; if not specified, the `todrive_noemail` value from gam.cfg is used. If True, no email is sent to `tduser`.
|
* `tdnoemail` - If False, an email is sent to `tduser` informing them of name and URL of the uploaded file; if not specified, the `todrive_noemail` value from gam.cfg is used. If True, no email is sent to `tduser`.
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
Print the current version of Gam with details
|
Print the current version of Gam with details
|
||||||
```
|
```
|
||||||
gam version
|
gam version
|
||||||
GAMADV-XTD3 6.80.05 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.80.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.4 64-bit final
|
Python 3.12.4 64-bit final
|
||||||
MacOS Sonoma 14.5 x86_64
|
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
|
Print the current version of Gam with details and time offset information
|
||||||
```
|
```
|
||||||
gam version timeoffset
|
gam version timeoffset
|
||||||
GAMADV-XTD3 6.80.05 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.80.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.4 64-bit final
|
Python 3.12.4 64-bit final
|
||||||
MacOS Sonoma 14.5 x86_64
|
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
|
Print the current version of Gam with extended details and SSL information
|
||||||
```
|
```
|
||||||
gam version extended
|
gam version extended
|
||||||
GAMADV-XTD3 6.80.05 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
GAMADV-XTD3 6.80.06 - https://github.com/taers232c/GAMADV-XTD3 - pythonsource
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.4 64-bit final
|
Python 3.12.4 64-bit final
|
||||||
MacOS Sonoma 14.5 x86_64
|
MacOS Sonoma 14.5 x86_64
|
||||||
@@ -64,7 +64,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.80.05
|
Latest: 6.80.06
|
||||||
echo $?
|
echo $?
|
||||||
1
|
1
|
||||||
```
|
```
|
||||||
@@ -72,7 +72,7 @@ echo $?
|
|||||||
Print the current version number without details
|
Print the current version number without details
|
||||||
```
|
```
|
||||||
gam version simple
|
gam version simple
|
||||||
6.80.05
|
6.80.06
|
||||||
```
|
```
|
||||||
In Linux/MacOS you can do:
|
In Linux/MacOS you can do:
|
||||||
```
|
```
|
||||||
@@ -82,7 +82,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.80.05 - https://github.com/taers232c/GAMADV-XTD3
|
GAM 6.80.06 - https://github.com/taers232c/GAMADV-XTD3
|
||||||
Ross Scroggs <ross.scroggs@gmail.com>
|
Ross Scroggs <ross.scroggs@gmail.com>
|
||||||
Python 3.12.4 64-bit final
|
Python 3.12.4 64-bit final
|
||||||
MacOS Sonoma 14.5 x86_64
|
MacOS Sonoma 14.5 x86_64
|
||||||
|
|||||||
@@ -627,6 +627,7 @@ If an item contains spaces, it should be surrounded by ".
|
|||||||
(tdnotify [<Boolean>])|
|
(tdnotify [<Boolean>])|
|
||||||
(tdparent (id:<DriveFolderID>)|<DriveFolderName>)|
|
(tdparent (id:<DriveFolderID>)|<DriveFolderName>)|
|
||||||
(tdretaintitle [<Boolean>])|
|
(tdretaintitle [<Boolean>])|
|
||||||
|
(tdreturnidonly [<Boolean>])|
|
||||||
(tdshare <EmailAddress> commenter|reader|writer)*|
|
(tdshare <EmailAddress> commenter|reader|writer)*|
|
||||||
(tdsheet (id:<Number>)|<String>)|
|
(tdsheet (id:<Number>)|<String>)|
|
||||||
(tdsheettimestamp [<Boolean>] [tdsheettimeformat <String>])
|
(tdsheettimestamp [<Boolean>] [tdsheettimeformat <String>])
|
||||||
|
|||||||
@@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
Merged GAM-Team version
|
Merged GAM-Team version
|
||||||
|
|
||||||
|
6.80.06
|
||||||
|
|
||||||
|
Added option `tdreturnidonly [<Boolean>]` to `<ToDriveAttribute>` that when true (the default), causes GAM to display
|
||||||
|
only the uploaded file ID to stdout. This can be captured and used in subsequent commands, `tdfileid <DriveFileID>` that will update the same file.
|
||||||
|
|
||||||
6.80.05
|
6.80.05
|
||||||
|
|
||||||
Added option `individualstudentcoursework copy|delete|maptoall` to `gam create|update course ... copyfrom`
|
Added option `individualstudentcoursework copy|delete|maptoall` to `gam create|update course ... copyfrom`
|
||||||
|
|||||||
@@ -7938,7 +7938,7 @@ class CSVPrintFile():
|
|||||||
'sheetdaysoffset': None, 'sheethoursoffset': None,
|
'sheetdaysoffset': None, 'sheethoursoffset': None,
|
||||||
'fileId': None, 'parentId': None, 'parent': GC.Values[GC.TODRIVE_PARENT], 'retaintitle': False,
|
'fileId': None, 'parentId': None, 'parent': GC.Values[GC.TODRIVE_PARENT], 'retaintitle': False,
|
||||||
'localcopy': GC.Values[GC.TODRIVE_LOCALCOPY], 'uploadnodata': GC.Values[GC.TODRIVE_UPLOAD_NODATA],
|
'localcopy': GC.Values[GC.TODRIVE_LOCALCOPY], 'uploadnodata': GC.Values[GC.TODRIVE_UPLOAD_NODATA],
|
||||||
'nobrowser': GC.Values[GC.TODRIVE_NOBROWSER], 'noemail': GC.Values[GC.TODRIVE_NOEMAIL],
|
'nobrowser': GC.Values[GC.TODRIVE_NOBROWSER], 'noemail': GC.Values[GC.TODRIVE_NOEMAIL], 'returnidonly': False,
|
||||||
'alert': [], 'share': [], 'notify': False, 'subject': None, 'from': None}
|
'alert': [], 'share': [], 'notify': False, 'subject': None, 'from': None}
|
||||||
while Cmd.ArgumentsRemaining():
|
while Cmd.ArgumentsRemaining():
|
||||||
myarg = getArgument()
|
myarg = getArgument()
|
||||||
@@ -8009,6 +8009,8 @@ class CSVPrintFile():
|
|||||||
self.todrive['nobrowser'] = getBoolean()
|
self.todrive['nobrowser'] = getBoolean()
|
||||||
elif myarg == 'tdnoemail':
|
elif myarg == 'tdnoemail':
|
||||||
self.todrive['noemail'] = getBoolean()
|
self.todrive['noemail'] = getBoolean()
|
||||||
|
elif myarg == 'tdreturnidonly':
|
||||||
|
self.todrive['returnidonly'] = getBoolean()
|
||||||
elif myarg == 'tdnoescapechar':
|
elif myarg == 'tdnoescapechar':
|
||||||
self.todrive['noescapechar'] = getBoolean()
|
self.todrive['noescapechar'] = getBoolean()
|
||||||
elif myarg == 'tdalert':
|
elif myarg == 'tdalert':
|
||||||
@@ -8775,7 +8777,13 @@ class CSVPrintFile():
|
|||||||
Act.Set(action)
|
Act.Set(action)
|
||||||
file_url = result['webViewLink']
|
file_url = result['webViewLink']
|
||||||
msg_txt = f'{Msg.DATA_UPLOADED_TO_DRIVE_FILE}:\n{file_url}'
|
msg_txt = f'{Msg.DATA_UPLOADED_TO_DRIVE_FILE}:\n{file_url}'
|
||||||
|
if not self.todrive['returnidonly']:
|
||||||
printKeyValueList([msg_txt])
|
printKeyValueList([msg_txt])
|
||||||
|
else:
|
||||||
|
if self.todrive['fileId']:
|
||||||
|
writeStdout(f'{self.todrive['fileId']}\n')
|
||||||
|
else:
|
||||||
|
writeStdout(f'{spreadsheetId}\n')
|
||||||
if not self.todrive['subject']:
|
if not self.todrive['subject']:
|
||||||
subject = title
|
subject = title
|
||||||
else:
|
else:
|
||||||
@@ -75664,9 +75672,12 @@ def closeSTDFilesIfNotMultiprocessing(closeSTD):
|
|||||||
rdFd = GM.Globals[stdtype].get(GM.REDIRECT_FD)
|
rdFd = GM.Globals[stdtype].get(GM.REDIRECT_FD)
|
||||||
rdMultiFd = GM.Globals[stdtype].get(GM.REDIRECT_MULTI_FD)
|
rdMultiFd = GM.Globals[stdtype].get(GM.REDIRECT_MULTI_FD)
|
||||||
if rdFd and rdMultiFd and (rdFd == rdMultiFd) and (rdFd != stdfile):
|
if rdFd and rdMultiFd and (rdFd == rdMultiFd) and (rdFd != stdfile):
|
||||||
|
try:
|
||||||
rdFd.flush()
|
rdFd.flush()
|
||||||
if closeSTD:
|
if closeSTD:
|
||||||
rdFd.close()
|
rdFd.close()
|
||||||
|
except BrokenPipeError:
|
||||||
|
pass
|
||||||
|
|
||||||
closeSTDFile(GM.STDOUT, sys.stdout)
|
closeSTDFile(GM.STDOUT, sys.stdout)
|
||||||
if GM.Globals[GM.STDERR].get(GM.REDIRECT_NAME) != 'stdout':
|
if GM.Globals[GM.STDERR].get(GM.REDIRECT_NAME) != 'stdout':
|
||||||
|
|||||||
Reference in New Issue
Block a user