gam7 7.10.0__py3-none-any.whl → 7.10.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 +52 -6
- gam/gamlib/glapi.py +1 -1
- {gam7-7.10.0.dist-info → gam7-7.10.2.dist-info}/METADATA +1 -1
- {gam7-7.10.0.dist-info → gam7-7.10.2.dist-info}/RECORD +7 -7
- {gam7-7.10.0.dist-info → gam7-7.10.2.dist-info}/WHEEL +0 -0
- {gam7-7.10.0.dist-info → gam7-7.10.2.dist-info}/entry_points.txt +0 -0
- {gam7-7.10.0.dist-info → gam7-7.10.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.10.
|
|
28
|
+
__version__ = '7.10.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
|
|
@@ -13556,7 +13556,10 @@ REPORT_CHOICE_MAP = {
|
|
|
13556
13556
|
'calendars': 'calendar',
|
|
13557
13557
|
'chat': 'chat',
|
|
13558
13558
|
'chrome': 'chrome',
|
|
13559
|
+
'classroom': 'classroom',
|
|
13560
|
+
'cloud': 'gcp',
|
|
13559
13561
|
'contextawareaccess': 'context_aware_access',
|
|
13562
|
+
'currents': 'gplus',
|
|
13560
13563
|
'customer': 'customer',
|
|
13561
13564
|
'customers': 'customer',
|
|
13562
13565
|
'datastudio': 'data_studio',
|
|
@@ -70130,6 +70133,7 @@ def _initMessageThreadParameters(entityType, doIt, maxToProcess):
|
|
|
70130
70133
|
'query': '', 'queryTimes': {},
|
|
70131
70134
|
'entityType': entityType, 'messageEntity': None, 'doIt': doIt, 'quick': True,
|
|
70132
70135
|
'labelMatchPattern': None, 'senderMatchPattern': None,
|
|
70136
|
+
'labelIds': [],
|
|
70133
70137
|
'maxToProcess': maxToProcess, 'maxItems': 0, 'maxMessagesPerThread': 0,
|
|
70134
70138
|
'maxToKeywords': [MESSAGES_MAX_TO_KEYWORDS[Act.Get()], 'maxtoprocess'],
|
|
70135
70139
|
'listType': listType, 'fields': f'nextPageToken,{listType}(id)'}
|
|
@@ -70162,6 +70166,8 @@ def _getMessageSelectParameters(myarg, parameters):
|
|
|
70162
70166
|
parameters['labelMatchPattern'] = getREPattern(re.IGNORECASE)
|
|
70163
70167
|
elif myarg == 'sendermatchpattern':
|
|
70164
70168
|
parameters['senderMatchPattern'] = getREPattern(re.IGNORECASE)
|
|
70169
|
+
elif myarg == 'labelids':
|
|
70170
|
+
parameters['labelIds'].extend(getEntityList(Cmd.OB_LABEL_ID_LIST))
|
|
70165
70171
|
elif myarg == 'ids':
|
|
70166
70172
|
parameters['messageEntity'] = getUserObjectEntity(Cmd.OB_MESSAGE_ID, parameters['entityType'])
|
|
70167
70173
|
elif myarg == 'quick':
|
|
@@ -71806,7 +71812,8 @@ def printShowMessagesThreads(users, entityType):
|
|
|
71806
71812
|
listResult = callGAPIpages(service, 'list', parameters['listType'],
|
|
71807
71813
|
pageMessage=getPageMessageForWhom(), maxItems=parameters['maxItems'],
|
|
71808
71814
|
throwReasons=GAPI.GMAIL_THROW_REASONS+GAPI.GMAIL_LIST_THROW_REASONS,
|
|
71809
|
-
userId='me', q=parameters['query'],
|
|
71815
|
+
userId='me', q=parameters['query'], labelIds=parameters['labelIds'],
|
|
71816
|
+
fields=parameters['fields'], includeSpamTrash=includeSpamTrash,
|
|
71810
71817
|
maxResults=GC.Values[GC.MESSAGE_MAX_RESULTS])
|
|
71811
71818
|
messageIds = [message['id'] for message in listResult]
|
|
71812
71819
|
else:
|
|
@@ -72603,8 +72610,28 @@ def updateFormRequestUpdateMasks(ubody):
|
|
|
72603
72610
|
v['updateMask'] = ','.join(v['updateMask'])
|
|
72604
72611
|
break
|
|
72605
72612
|
|
|
72613
|
+
def _initPublishSettings():
|
|
72614
|
+
return {'publishSettings': {'publishState': {}}, 'updateMask': ''}
|
|
72615
|
+
|
|
72616
|
+
def _getPublishSettings(myarg, pbody):
|
|
72617
|
+
if myarg == 'ispublished':
|
|
72618
|
+
bval = getBoolean()
|
|
72619
|
+
pbody['publishSettings']['publishState']['isPublished'] = bval
|
|
72620
|
+
if not bval:
|
|
72621
|
+
pbody['publishSettings']['publishState']['isAcceptingResponses'] = bval
|
|
72622
|
+
elif myarg == 'isacceptingresponses':
|
|
72623
|
+
bval = getBoolean()
|
|
72624
|
+
pbody['publishSettings']['publishState']['isAcceptingResponses'] = bval
|
|
72625
|
+
if bval:
|
|
72626
|
+
pbody['publishSettings']['publishState']['isPublished'] = bval
|
|
72627
|
+
else:
|
|
72628
|
+
return False
|
|
72629
|
+
pbody['updateMask'] = 'publishState'
|
|
72630
|
+
return True
|
|
72631
|
+
|
|
72606
72632
|
# gam <UserTypeEntity> create form
|
|
72607
72633
|
# title <String> [description <String>] [isquiz [<Boolean>]] [<JSONData>]
|
|
72634
|
+
# [ispublished [<Boolean>] isacceptingresponses [<Boolean>]]
|
|
72608
72635
|
# [drivefilename <DriveFileName>] [<DriveFileParentAttribute>]
|
|
72609
72636
|
# [(csv [todrive <ToDriveAttribute>*]) | returnidonly]
|
|
72610
72637
|
def createForm(users):
|
|
@@ -72613,6 +72640,7 @@ def createForm(users):
|
|
|
72613
72640
|
title = ''
|
|
72614
72641
|
body = {'mimeType': MIMETYPE_GA_FORM}
|
|
72615
72642
|
ubody = {'includeFormInResponse': True, 'requests': []}
|
|
72643
|
+
pbody = _initPublishSettings()
|
|
72616
72644
|
parentParms = initDriveFileAttributes()
|
|
72617
72645
|
while Cmd.ArgumentsRemaining():
|
|
72618
72646
|
myarg = getArgument()
|
|
@@ -72626,6 +72654,8 @@ def createForm(users):
|
|
|
72626
72654
|
elif myarg == 'json':
|
|
72627
72655
|
jsonData = getJSON([])
|
|
72628
72656
|
ubody['requests'].extend(jsonData.get('requests', []))
|
|
72657
|
+
elif _getPublishSettings(myarg, pbody):
|
|
72658
|
+
pass
|
|
72629
72659
|
elif myarg == 'drivefilename':
|
|
72630
72660
|
body['name'] = getString(Cmd.OB_DRIVE_FILE_NAME)
|
|
72631
72661
|
elif getDriveFileParentAttribute(myarg, parentParms):
|
|
@@ -72666,6 +72696,10 @@ def createForm(users):
|
|
|
72666
72696
|
form = callGAPI(gform.forms(), 'batchUpdate',
|
|
72667
72697
|
throwReasons=[GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
|
|
72668
72698
|
formId=formId, body=ubody)
|
|
72699
|
+
if pbody['updateMask']:
|
|
72700
|
+
callGAPI(gform.forms(), 'setPublishSettings',
|
|
72701
|
+
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
|
|
72702
|
+
formId=formId, body=pbody)
|
|
72669
72703
|
if returnIdOnly:
|
|
72670
72704
|
writeStdout(f'{formId}\n')
|
|
72671
72705
|
elif not csvPF:
|
|
@@ -72690,8 +72724,10 @@ def createForm(users):
|
|
|
72690
72724
|
|
|
72691
72725
|
# gam <UserTypeEntity> update form <DriveFileEntity>
|
|
72692
72726
|
# [title <String>] [description <String>] [isquiz [Boolean>]] [<JSONData>]
|
|
72727
|
+
# [ispublished [<Boolean>] isacceptingresponses [<Boolean>]]
|
|
72693
72728
|
def updateForm(users):
|
|
72694
72729
|
ubody = {'includeFormInResponse': False, 'requests': []}
|
|
72730
|
+
pbody = _initPublishSettings()
|
|
72695
72731
|
fileIdEntity = getDriveFileEntity()
|
|
72696
72732
|
while Cmd.ArgumentsRemaining():
|
|
72697
72733
|
myarg = getArgument()
|
|
@@ -72704,10 +72740,12 @@ def updateForm(users):
|
|
|
72704
72740
|
elif myarg == 'json':
|
|
72705
72741
|
jsonData = getJSON([])
|
|
72706
72742
|
ubody['requests'].extend(jsonData.get('requests', []))
|
|
72743
|
+
elif _getPublishSettings(myarg, pbody):
|
|
72744
|
+
pass
|
|
72707
72745
|
else:
|
|
72708
72746
|
unknownArgumentExit()
|
|
72709
72747
|
updateFormRequestUpdateMasks(ubody)
|
|
72710
|
-
if not ubody['requests']:
|
|
72748
|
+
if not ubody['requests'] and not pbody['updateMask']:
|
|
72711
72749
|
return
|
|
72712
72750
|
i, count, users = getEntityArgument(users)
|
|
72713
72751
|
for user in users:
|
|
@@ -72723,9 +72761,14 @@ def updateForm(users):
|
|
|
72723
72761
|
for formId in fileIdEntity['list']:
|
|
72724
72762
|
j += 1
|
|
72725
72763
|
try:
|
|
72726
|
-
|
|
72727
|
-
|
|
72728
|
-
|
|
72764
|
+
if ubody['requests']:
|
|
72765
|
+
callGAPI(gform.forms(), 'batchUpdate',
|
|
72766
|
+
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
|
|
72767
|
+
formId=formId, body=ubody)
|
|
72768
|
+
if pbody['updateMask']:
|
|
72769
|
+
callGAPI(gform.forms(), 'setPublishSettings',
|
|
72770
|
+
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.PERMISSION_DENIED],
|
|
72771
|
+
formId=formId, body=pbody)
|
|
72729
72772
|
entityActionPerformed([Ent.USER, user, Ent.FORM, formId], j, jcount)
|
|
72730
72773
|
except (GAPI.notFound, GAPI.invalidArgument) as e:
|
|
72731
72774
|
entityActionFailedWarning([Ent.USER, user, Ent.FORM, formId], str(e), j, jcount)
|
|
@@ -72774,6 +72817,9 @@ def printShowForms(users):
|
|
|
72774
72817
|
result = callGAPI(gform.forms(), 'get',
|
|
72775
72818
|
throwReasons=[GAPI.NOT_FOUND, GAPI.PERMISSION_DENIED],
|
|
72776
72819
|
formId=formId)
|
|
72820
|
+
if 'publishSettings' in result and 'publishState' in result['publishSettings']:
|
|
72821
|
+
result['publishSettings']['publishState'].setdefault('isPublished', False)
|
|
72822
|
+
result['publishSettings']['publishState'].setdefault('isAcceptingResponses', False)
|
|
72777
72823
|
if not csvPF:
|
|
72778
72824
|
if not FJQC.formatJSON:
|
|
72779
72825
|
printEntity([Ent.FORM, result['formId']], j, jcount)
|
gam/gamlib/glapi.py
CHANGED
|
@@ -650,7 +650,7 @@ _SVCACCT_SCOPES = [
|
|
|
650
650
|
'api': GMAIL,
|
|
651
651
|
'subscopes': [],
|
|
652
652
|
'scope': 'https://www.googleapis.com/auth/gmail.modify'},
|
|
653
|
-
{'name': 'Gmail API - Basic Settings (Filters,IMAP, Language, POP, Vacation) - read/write, Sharing Settings (Delegates, Forwarding, SendAs) - read',
|
|
653
|
+
{'name': 'Gmail API - Basic Settings (Filters, IMAP, Language, POP, Vacation) - read/write, Sharing Settings (Delegates, Forwarding, SendAs) - read',
|
|
654
654
|
'api': GMAIL,
|
|
655
655
|
'subscopes': [],
|
|
656
656
|
'scope': 'https://www.googleapis.com/auth/gmail.settings.basic'},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
gam/__init__.py,sha256=
|
|
1
|
+
gam/__init__.py,sha256=0tfJVNeH1l47v2sr8o2Pbji48zIKWeuOG3Tw71RedRs,3532028
|
|
2
2
|
gam/__main__.py,sha256=amz0-959ph6zkZKqjaar4n60yho-T37w6qWI36qx0CA,1049
|
|
3
3
|
gam/cacerts.pem,sha256=82Ak7btW_2XvocLUvAwPmpx8Chi0oqtZUG1gseLK_t4,50235
|
|
4
4
|
gam/cbcm-v1.1beta1.json,sha256=xO5XloCQQULmPbFBx5bckdqmbLFQ7sJ2TImhE1ysDIY,19439
|
|
@@ -23,7 +23,7 @@ gam/atom/token_store.py,sha256=7E6Ecvxa86WCvl1pJAhv78jg9OxQv8pMtIUcPhZCq04,3803
|
|
|
23
23
|
gam/atom/url.py,sha256=pxO1TlORxyKQTQ1bkBE1unFzjnv9c8LjJkm-UEORShY,4276
|
|
24
24
|
gam/gamlib/__init__.py,sha256=z5mF-y0j8pm-YNFBaiuxB4M_GAUPG-cXWwrhYwrVReM,679
|
|
25
25
|
gam/gamlib/glaction.py,sha256=1Il_HrChVnPkzZwiZs5au4mFQVtq4K1Z42uIuR6qdnI,9419
|
|
26
|
-
gam/gamlib/glapi.py,sha256=
|
|
26
|
+
gam/gamlib/glapi.py,sha256=A6kdyCacc9tvTaxMUNvWj8jWbOrss8e8XdkqF1xbN70,34572
|
|
27
27
|
gam/gamlib/glcfg.py,sha256=bNTckxzIM_HruxO2DfYsDbEgqOIz1RX6CbU6XOQQQyg,28296
|
|
28
28
|
gam/gamlib/glclargs.py,sha256=Ohe746FOQqMlXlutH-XJ6E1unYNzf_EJhdubnPp3new,42472
|
|
29
29
|
gam/gamlib/glentity.py,sha256=c9-7MAp0HruXEUVq8Nwkllxc4KypFeZRUFkvVzPwrwk,33760
|
|
@@ -65,8 +65,8 @@ gam/googleapiclient/discovery_cache/base.py,sha256=yCDPtxnbNN-p5_9fzBacC6P3wcUPl
|
|
|
65
65
|
gam/googleapiclient/discovery_cache/file_cache.py,sha256=sim3Mg4HgRYo3vX75jvcKy_aV568EvIrtBfvfbw-044,4774
|
|
66
66
|
gam/iso8601/__init__.py,sha256=Z2PsYbXgAH5a5xzUvgczCboPzqWpm65kRcIngCnhViU,1218
|
|
67
67
|
gam/iso8601/iso8601.py,sha256=Li2FHZ4sBTWuthuQhyCvmvj0j6At8JbGzkSv2fc2RHU,4384
|
|
68
|
-
gam7-7.10.
|
|
69
|
-
gam7-7.10.
|
|
70
|
-
gam7-7.10.
|
|
71
|
-
gam7-7.10.
|
|
72
|
-
gam7-7.10.
|
|
68
|
+
gam7-7.10.2.dist-info/METADATA,sha256=HWD4kRxt5a3KpGcPRUv3XlFABH_RP4OlazSgrReISEk,2978
|
|
69
|
+
gam7-7.10.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
70
|
+
gam7-7.10.2.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
|
|
71
|
+
gam7-7.10.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
72
|
+
gam7-7.10.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|