mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-06 05:41:36 +00:00
Update draft/import/insert/sendemail (#959)
* Update draft/import/insert/sendemail If possible, use same option names as already exist in my Gam for same commands. Include charset with file. * Code cleanup
This commit is contained in:
@@ -1286,7 +1286,10 @@ gam <UserTypeEntity> untrash messages query <QueryGmail> [doit] [max_to_untrash|
|
||||
|
||||
gam <UserTypeEntity> show gmailprofile [todrive]
|
||||
|
||||
gam <UserTypeEntity> sendemail [recipient <EmailAddress>] [subject <String>] [body <String>]
|
||||
gam <UserTypeEntity> draftemail [recipient <EmailAddress>] [subject <String>] [(message <String>)|(file <FileName> [charset <Charset>])]
|
||||
gam <UserTypeEntity> importemail [recipient <EmailAddress>] [subject <String> [(message <String>)|(file <FileName> [charset <Charset>])]]
|
||||
gam <UserTypeEntity> insertemail [recipient <EmailAddress>] [subject <String>] [(message <String>)|(file <FileName> [charset <Charset>])]
|
||||
gam <UserTypeEntity> sendemail [recipient <EmailAddress>] [subject <String>] [(message <String>)|(file <FileName> [charset <Charset>])]
|
||||
|
||||
gam <UserTypeEntity> create|add delegate|delegates <EmailAddress>
|
||||
gam <UserTypeEntity> delegate|delegates to <EmailAddress>
|
||||
|
||||
11
src/gam.py
11
src/gam.py
@@ -1074,7 +1074,7 @@ def callGAPI(service, function,
|
||||
continue
|
||||
systemErrorExit(4, str(e))
|
||||
except (httplib2.ServerNotFoundError, RuntimeError) as e:
|
||||
if (n != retries):
|
||||
if n != retries:
|
||||
service._http.connections = {}
|
||||
waitOnFailure(n, retries, str(e))
|
||||
continue
|
||||
@@ -5351,12 +5351,13 @@ def sendOrDropEmail(users, method='send'):
|
||||
i = 4
|
||||
while i < len(sys.argv):
|
||||
myarg = sys.argv[i].lower().replace('_', '')
|
||||
if myarg == 'body':
|
||||
if myarg == 'message':
|
||||
body = sys.argv[i+1]
|
||||
i += 2
|
||||
elif myarg == 'bodyfile':
|
||||
body = readFile(sys.argv[i+1])
|
||||
i += 2
|
||||
elif myarg == 'file':
|
||||
filename = sys.argv[i+1]
|
||||
i, encoding = getCharSet(i+2)
|
||||
body = readFile(filename, encoding=encoding)
|
||||
elif myarg == 'subject':
|
||||
subject = sys.argv[i+1]
|
||||
i += 2
|
||||
|
||||
Reference in New Issue
Block a user