mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-05 13:21:35 +00:00
Update GamCommands.txt and Improve error message in get drivefile (#875)
* Update GamCommands.txt * Improve error message when trying to dowload files * Update GamCommands.txt
This commit is contained in:
@@ -775,38 +775,43 @@ Specify a collection of Users by directly specifying them or by specifiying item
|
|||||||
<SchemaFieldDefinition> ::=
|
<SchemaFieldDefinition> ::=
|
||||||
field <FieldName> (type bool|date|double|email|int64|phone|string) [multivalued|multivalue] [indexed] [restricted] [range <Number> <Number>] endfield
|
field <FieldName> (type bool|date|double|email|int64|phone|string) [multivalued|multivalue] [indexed] [restricted] [range <Number> <Number>] endfield
|
||||||
|
|
||||||
<UserAttributes> ::=
|
<UserBasicAttribute> ::=
|
||||||
(address clear|(type work|home|other|(custom <String>) [unstructured|formatted <String>] [pobox <String>] [extendedaddress <String>] [streetaddress <String>]
|
|
||||||
[locality <String>] [region <String>] [postalcode <String>] [country <String>] [countrycode <String>] notprimary|primary))|
|
|
||||||
(agreed2terms|agreedtoterms <Boolean>)|
|
(agreed2terms|agreedtoterms <Boolean>)|
|
||||||
(changepassword|changepasswordatnextlogin <Boolean>)|
|
(changepassword|changepasswordatnextlogin <Boolean>)|
|
||||||
(crypt|sha|sha1|sha-1|md5|nohash)|
|
(crypt|sha|sha1|sha-1|md5|nohash)|
|
||||||
(customerid <String>)|
|
(customerid <String>)|
|
||||||
(email|primaryemail|username <EmailAddress>)|
|
(email|primaryemail|username <EmailAddress>)|
|
||||||
(otheremail clear|(work|home|other|<String> <String>))|
|
|
||||||
(externalid clear|(account|customer|login_id|network|organization|<String> <String>))|
|
|
||||||
(firstname|givenname <String>)|
|
(firstname|givenname <String>)|
|
||||||
(gal|includeinglobaladdresslist <Boolean>)|
|
(gal|includeinglobaladdresslist <Boolean>)|
|
||||||
(gender clear|(female|male|unknown|(other <String>) [addressmeas <String>]))|
|
(gender clear|(female|male|unknown|(other <String>) [addressmeas <String>]))|
|
||||||
(im clear|(type work|home|other|(custom <String>) protocol aim|gtalk|icq|jabber|msn|net_meeting|qq|skype|yahoo|(custom_protocol <String>) <String> [notprimary|primary]))|
|
|
||||||
(ipwhitelisted <Boolean>)|
|
(ipwhitelisted <Boolean>)|
|
||||||
(keyword clear|(occupation|outlook|(custom <string>) <String>))|
|
|
||||||
(language clear|<LanguageList>)|
|
(language clear|<LanguageList>)|
|
||||||
(lastname|familyname <String>)|
|
(lastname|familyname <String>)|
|
||||||
(location clear|(type default|desk|<String> area <String> [building|buildingid <BuildingID>] [floor|floorname <FloorName>] [section|floorsection <String>] [desk|deskcode <String>] endlocation))|
|
(note clear|([text_html|text_plain] <String>|(file <FileName> [charset <Charset>])))|
|
||||||
(note clear|([text_plain|text_html] <String>|(file <FileName> [charset <Charset>])))|
|
|
||||||
(organization clear|([type domain_only|school|unknown|work] [customtype <String>] [name <String>] [title <String>] [department <String>] [symbol <String>]
|
|
||||||
[costcenter <String>] [location <String>] [description <String>] [domain <String>] notprimary|primary))|
|
|
||||||
(org|ou|orgunitpath <OrgUnitPath>)
|
(org|ou|orgunitpath <OrgUnitPath>)
|
||||||
(password random|<Password>)|
|
(password random|<Password>)|
|
||||||
(phone clear|([type work|home|other|work_fax|home_fax|other_fax|main|company_main|assistant|mobile|work_mobile|pager|work_pager|car|radio|callback|isdn|telex|tty_tdd|grand_central|(custom <String>)]
|
|
||||||
[value <String>] notprimary|primary))|
|
|
||||||
(posix clear|(username <String> uid <Integer> gid <Integer> [system|systemid <String>] [home|homedirectory <String>] [shell <String>] [gecos <String>] [primary <Boolean>] endposix))|
|
|
||||||
(relation clear|(spouse|child|mother|father|parent|brother|sister|friend|relative|domestic_partner|manager|dotted-line_manager|assistant|admin_assistant|exec_assistant|referred_by|partner|<String> <String>))|
|
|
||||||
(sshkeys clear|(key <String> [expires <Integer>] endssh))|
|
|
||||||
(suspended <Boolean>)|
|
(suspended <Boolean>)|
|
||||||
(website clear|(home_page|blog|profile|work|home|other|ftp|reservations|app_install_page|<String> <URL> [notprimary|primary]))|
|
(<SchemaName>.<FieldName> [multivalued|multivalue|value|multinonempty [type home|other|work|(custom <String>)]] <String>)
|
||||||
(<SchemaName>.<FieldName> [multivalued|multivalue|value|multinonempty [type work|home|other|(custom <String>)]] <String>)
|
<UserMultiAttributes> ::=
|
||||||
|
(address clear|(type home|other|work|(custom <String>) [unstructured|formatted <String>] [pobox <String>] [extendedaddress <String>] [streetaddress <String>]
|
||||||
|
[locality <String>] [region <String>] [postalcode <String>] [country <String>] [countrycode <String>] notprimary|primary))|
|
||||||
|
(otheremail clear|(home|other|work|<String> <String>))|
|
||||||
|
(externalid clear|(account|customer|login_id|network|organization|<String> <String>))|
|
||||||
|
(im clear|(type home|other|work|(custom <String>) protocol aim|gtalk|icq|jabber|msn|net_meeting|qq|skype|yahoo|(custom_protocol <String>) <String> [notprimary|primary]))|
|
||||||
|
(keyword clear|(mission|occupation|outlook|(custom <string>) <String>))|
|
||||||
|
(location clear|(type default|desk|<String> area <String> [building|buildingid <String>] [floor|floorname <String>] [section|floorsection <String>] [desk|deskcode <String>] endlocation))|
|
||||||
|
(organization clear|([type domain_only|school|unknown|work] [customtype <String>] [name <String>] [title <String>] [department <String>] [symbol <String>]
|
||||||
|
[costcenter <String>] [location <String>] [description <String>] [domain <String>] [fulltimeequivalent <Integer>] notprimary|primary))|
|
||||||
|
(phone clear|([type assistant|callback|car|company_main|grand_central|home|home_fax|isdn|main|mobile|other|other_fax|pager|radio|telex|tty_tdd|work|work_fax|work_mobile|work_pager|(custom <String>)]
|
||||||
|
[value <String>] notprimary|primary))|
|
||||||
|
(posix clear|(username <String> uid <Integer> gid <Integer> [system|systemid <String>] [home|homedirectory <String>] [shell <String>]
|
||||||
|
[gecos <String>] [os|operatingSystemType linux|unspecified|windows] [primary <Boolean>] endposix))|
|
||||||
|
(relation clear|(admin_assistant|assistant|brother|child|domestic_partner|dotted-line_manager|exec_assistant|father|friend|manager|mother|parent|partner|referred_by|relative|sister|spouse|<String> <String>))|
|
||||||
|
(sshkeys clear|(key <String> [expires <Integer>] endssh))|
|
||||||
|
(website clear|(app_install_page|blog|ftp|home|home_page|other|profile|reservations|resume|work|<String> <URL> [notprimary|primary]))
|
||||||
|
<UserAttribute> ::=
|
||||||
|
<UserBasicAttribute>|
|
||||||
|
<UserMultiAttribute>
|
||||||
|
|
||||||
gam version [check] [simple]
|
gam version [check] [simple]
|
||||||
gam help
|
gam help
|
||||||
|
|||||||
12
src/gam.py
12
src/gam.py
@@ -4665,6 +4665,8 @@ def createDriveFile(users):
|
|||||||
if csv_output:
|
if csv_output:
|
||||||
writeCSVfile(csv_rows, csv_titles, u'Files', to_drive)
|
writeCSVfile(csv_rows, csv_titles, u'Files', to_drive)
|
||||||
|
|
||||||
|
HTTP_ERROR_PATTERN = re.compile(r'^.*returned "(.*)">$')
|
||||||
|
|
||||||
def downloadDriveFile(users):
|
def downloadDriveFile(users):
|
||||||
i = 5
|
i = 5
|
||||||
fileIdSelection = {u'fileIds': [], u'query': None}
|
fileIdSelection = {u'fileIds': [], u'query': None}
|
||||||
@@ -4838,8 +4840,14 @@ def downloadDriveFile(users):
|
|||||||
GM_Globals[GM_SYSEXITRC] = 6
|
GM_Globals[GM_SYSEXITRC] = 6
|
||||||
fileDownloadFailed = True
|
fileDownloadFailed = True
|
||||||
break
|
break
|
||||||
except googleapiclient.http.HttpError:
|
except googleapiclient.http.HttpError as e:
|
||||||
sys.stderr.write(u'Format ({0}) not available\n'.format(extension[1:]))
|
mg = HTTP_ERROR_PATTERN.match(str(e))
|
||||||
|
if mg:
|
||||||
|
stderrErrorMsg(mg.group(1))
|
||||||
|
else:
|
||||||
|
stderrErrorMsg(str(e))
|
||||||
|
fileDownloadFailed = True
|
||||||
|
break
|
||||||
if fh and not targetStdout:
|
if fh and not targetStdout:
|
||||||
closeFile(fh)
|
closeFile(fh)
|
||||||
os.remove(filename)
|
os.remove(filename)
|
||||||
|
|||||||
Reference in New Issue
Block a user