gam7 7.27.0__py3-none-any.whl → 7.27.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gam7 might be problematic. Click here for more details.
- gam/__init__.py +37 -13
- {gam7-7.27.0.dist-info → gam7-7.27.2.dist-info}/METADATA +1 -1
- {gam7-7.27.0.dist-info → gam7-7.27.2.dist-info}/RECORD +6 -6
- {gam7-7.27.0.dist-info → gam7-7.27.2.dist-info}/WHEEL +0 -0
- {gam7-7.27.0.dist-info → gam7-7.27.2.dist-info}/entry_points.txt +0 -0
- {gam7-7.27.0.dist-info → gam7-7.27.2.dist-info}/licenses/LICENSE +0 -0
gam/__init__.py
CHANGED
|
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
|
|
25
25
|
"""
|
|
26
26
|
|
|
27
27
|
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
|
28
|
-
__version__ = '7.27.
|
|
28
|
+
__version__ = '7.27.02'
|
|
29
29
|
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
|
30
30
|
|
|
31
31
|
#pylint: disable=wrong-import-position
|
|
@@ -9182,7 +9182,7 @@ def showJSON(showName, showValue, skipObjects=None, timeObjects=None,
|
|
|
9182
9182
|
return
|
|
9183
9183
|
if objectName is not None:
|
|
9184
9184
|
printJSONKey(objectName)
|
|
9185
|
-
|
|
9185
|
+
subObjectKey = dictObjectsKey.get(objectName)
|
|
9186
9186
|
if isinstance(objectValue, list):
|
|
9187
9187
|
if objectName in simpleLists:
|
|
9188
9188
|
printJSONValue(' '.join(objectValue))
|
|
@@ -26506,14 +26506,18 @@ CHAT_TIME_OBJECTS = {'createTime', 'deleteTime', 'eventTime', 'lastActiveTime',
|
|
|
26506
26506
|
def _showChatItem(citem, entityType, FJQC, i=0, count=0):
|
|
26507
26507
|
if entityType == Ent.CHAT_SPACE:
|
|
26508
26508
|
_cleanChatSpace(citem)
|
|
26509
|
+
dictObjectsKey = {None: 'displayName'}
|
|
26509
26510
|
elif entityType == Ent.CHAT_MESSAGE:
|
|
26510
26511
|
_cleanChatMessage(citem)
|
|
26512
|
+
dictObjectsKey = {None: 'text'}
|
|
26513
|
+
else:
|
|
26514
|
+
dictObjectsKey={}
|
|
26511
26515
|
if FJQC.formatJSON:
|
|
26512
26516
|
printLine(json.dumps(cleanJSON(citem, timeObjects=CHAT_TIME_OBJECTS), ensure_ascii=False, sort_keys=True))
|
|
26513
26517
|
return
|
|
26514
26518
|
printEntity([entityType, citem['name']], i, count)
|
|
26515
26519
|
Ind.Increment()
|
|
26516
|
-
showJSON(None, citem, timeObjects=CHAT_TIME_OBJECTS)
|
|
26520
|
+
showJSON(None, citem, timeObjects=CHAT_TIME_OBJECTS, dictObjectsKey=dictObjectsKey)
|
|
26517
26521
|
Ind.Decrement()
|
|
26518
26522
|
|
|
26519
26523
|
def _printChatItem(user, citem, parent, entityType, csvPF, FJQC, addCSVData=None):
|
|
@@ -27986,10 +27990,11 @@ def _getChatSenderEmail(cd, sender):
|
|
|
27986
27990
|
sender['email'], _ = convertUIDtoEmailAddressWithType(f'uid:{senderUid}', cd, None, emailTypes=['user'])
|
|
27987
27991
|
|
|
27988
27992
|
def trimChatMessageIfRequired(body):
|
|
27989
|
-
|
|
27990
|
-
|
|
27991
|
-
|
|
27992
|
-
|
|
27993
|
+
if 'text' in body:
|
|
27994
|
+
msgLen = len(body['text'])
|
|
27995
|
+
if msgLen > 4096:
|
|
27996
|
+
stderrWarningMsg(Msg.TRIMMED_MESSAGE_FROM_LENGTH_TO_MAXIMUM.format(msgLen, 4096))
|
|
27997
|
+
body['text'] = body['text'][:4095]
|
|
27993
27998
|
|
|
27994
27999
|
CHAT_MESSAGE_REPLY_OPTION_MAP = {
|
|
27995
28000
|
'fail': 'REPLY_MESSAGE_OR_FAIL',
|
|
@@ -28066,22 +28071,29 @@ def doCreateChatMessage():
|
|
|
28066
28071
|
createChatMessage([None])
|
|
28067
28072
|
|
|
28068
28073
|
# gam [<UserTypeMessage>] update chatmessage name <ChatMessage>
|
|
28069
|
-
# <ChatContent>
|
|
28074
|
+
# [<ChatContent>] [clearattachments <String>]
|
|
28070
28075
|
def updateChatMessage(users):
|
|
28071
28076
|
name = None
|
|
28072
28077
|
body = {}
|
|
28078
|
+
updateMask = []
|
|
28079
|
+
clearMsg = ''
|
|
28073
28080
|
while Cmd.ArgumentsRemaining():
|
|
28074
28081
|
myarg = getArgument()
|
|
28075
28082
|
if myarg == 'name':
|
|
28076
28083
|
name = getString(Cmd.OB_CHAT_MESSAGE)
|
|
28077
28084
|
elif myarg in SORF_TEXT_ARGUMENTS:
|
|
28078
28085
|
body['text'] = getStringOrFile(myarg, minLen=0, unescapeCRLF=True)[0]
|
|
28086
|
+
updateMask.append('text')
|
|
28087
|
+
elif myarg == 'clearattachments':
|
|
28088
|
+
clearMsg = getString(Cmd.OB_STRING, minLen=0)
|
|
28089
|
+
body['attachment'] = []
|
|
28090
|
+
updateMask.append('attachment')
|
|
28079
28091
|
else:
|
|
28080
28092
|
unknownArgumentExit()
|
|
28081
28093
|
if not name:
|
|
28082
28094
|
missingArgumentExit('name')
|
|
28083
|
-
if
|
|
28084
|
-
missingArgumentExit('text
|
|
28095
|
+
if not updateMask:
|
|
28096
|
+
missingArgumentExit('text|textfile|clearattachments')
|
|
28085
28097
|
trimChatMessageIfRequired(body)
|
|
28086
28098
|
i, count, users = getEntityArgument(users)
|
|
28087
28099
|
for user in users:
|
|
@@ -28090,9 +28102,19 @@ def updateChatMessage(users):
|
|
|
28090
28102
|
if not chat:
|
|
28091
28103
|
continue
|
|
28092
28104
|
try:
|
|
28105
|
+
if 'attachment' in updateMask and 'text' not in updateMask:
|
|
28106
|
+
resp = callGAPI(chat.spaces().messages(), 'get',
|
|
28107
|
+
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED, GAPI.FAILED_PRECONDITION],
|
|
28108
|
+
name=name, fields='text')
|
|
28109
|
+
body['text'] = resp.get('text', '')
|
|
28110
|
+
if clearMsg:
|
|
28111
|
+
body['text'] += clearMsg
|
|
28112
|
+
elif not body['text']:
|
|
28113
|
+
body['text'] = 'Attachments cleared'
|
|
28114
|
+
updateMask.append('text')
|
|
28093
28115
|
resp = callGAPI(chat.spaces().messages(), 'patch',
|
|
28094
28116
|
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED, GAPI.FAILED_PRECONDITION],
|
|
28095
|
-
name=name, updateMask='
|
|
28117
|
+
name=name, updateMask=','.join(updateMask), body=body)
|
|
28096
28118
|
kvList.extend([Ent.CHAT_THREAD, resp['thread']['name']])
|
|
28097
28119
|
entityActionPerformed(kvList, i, count)
|
|
28098
28120
|
except (GAPI.notFound, GAPI.invalidArgument, GAPI.permissionDenied) as e:
|
|
@@ -33001,6 +33023,8 @@ def doCreateGroup(ciGroupsAPI=False):
|
|
|
33001
33023
|
initialGroupConfig = 'WITH_INITIAL_OWNER'
|
|
33002
33024
|
elif ciGroupsAPI and myarg in {'security', 'makesecuritygroup'}:
|
|
33003
33025
|
body['labels'][CIGROUP_SECURITY_LABEL] = ''
|
|
33026
|
+
elif ciGroupsAPI and myarg in ['locked']:
|
|
33027
|
+
body['labels'][CIGROUP_LOCKED_LABEL] = ''
|
|
33004
33028
|
elif myarg == 'verifynotinvitable':
|
|
33005
33029
|
verifyNotInvitable = True
|
|
33006
33030
|
else:
|
|
@@ -64917,11 +64941,11 @@ def claimOwnership(users):
|
|
|
64917
64941
|
elif myarg == 'onlyusers':
|
|
64918
64942
|
_, userList = getEntityToModify(defaultEntityType=Cmd.ENTITY_USERS)
|
|
64919
64943
|
checkOnly = True
|
|
64920
|
-
onlyOwners =
|
|
64944
|
+
onlyOwners = {normalizeEmailAddressOrUID(user, noUid=True) for user in userList}
|
|
64921
64945
|
elif myarg == 'skipusers':
|
|
64922
64946
|
_, userList = getEntityToModify(defaultEntityType=Cmd.ENTITY_USERS)
|
|
64923
64947
|
checkSkip = len(userList) > 0
|
|
64924
|
-
skipOwners =
|
|
64948
|
+
skipOwners = {normalizeEmailAddressOrUID(user, noUid=True) for user in userList}
|
|
64925
64949
|
elif myarg == 'subdomains':
|
|
64926
64950
|
subdomains = getEntityList(Cmd.OB_DOMAIN_NAME_ENTITY)
|
|
64927
64951
|
elif myarg == 'includetrashed':
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
gam/__init__.py,sha256=
|
|
1
|
+
gam/__init__.py,sha256=EnUSCJAWtV0XmDfyv9xGnFy-aorEW7h6vw8zGpxR_5g,3626766
|
|
2
2
|
gam/__main__.py,sha256=VwEYS7a9vYQPbT6iLduMOoVUJ6p4R-HZgerZQmM1NpE,1307
|
|
3
3
|
gam/cacerts.pem,sha256=DUsVo2XlFYwfkhe3gnxa-Km4Z4noz74hSApXwTT-nQE,44344
|
|
4
4
|
gam/cbcm-v1.1beta1.json,sha256=xO5XloCQQULmPbFBx5bckdqmbLFQ7sJ2TImhE1ysDIY,19439
|
|
@@ -47,8 +47,8 @@ gam/gdata/apps/audit/__init__.py,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrK
|
|
|
47
47
|
gam/gdata/apps/audit/service.py,sha256=Z1eueThcNeVUMWP1DRWc_DGHrJCiJI8W_xj6L-cqu-Q,9658
|
|
48
48
|
gam/gdata/apps/contacts/__init__.py,sha256=Um6zgIkiahZns7yAEuC3pxHSMD8iciZ_EoynSLoYPfU,30463
|
|
49
49
|
gam/gdata/apps/contacts/service.py,sha256=5lNb-Ii1Gyek6ePFji3kyoYtCBc8CuJTwagx2BL2o14,15684
|
|
50
|
-
gam7-7.27.
|
|
51
|
-
gam7-7.27.
|
|
52
|
-
gam7-7.27.
|
|
53
|
-
gam7-7.27.
|
|
54
|
-
gam7-7.27.
|
|
50
|
+
gam7-7.27.2.dist-info/METADATA,sha256=Bi9nZmwHkfkhYgAivixqTujoA2nZIbM8pSWz9W2yFy4,3093
|
|
51
|
+
gam7-7.27.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
52
|
+
gam7-7.27.2.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
|
|
53
|
+
gam7-7.27.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
54
|
+
gam7-7.27.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|