gam7 7.20.0__py3-none-any.whl → 7.20.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 +59 -31
- gam/gamlib/glclargs.py +1 -0
- {gam7-7.20.0.dist-info → gam7-7.20.2.dist-info}/METADATA +1 -1
- {gam7-7.20.0.dist-info → gam7-7.20.2.dist-info}/RECORD +7 -7
- {gam7-7.20.0.dist-info → gam7-7.20.2.dist-info}/WHEEL +0 -0
- {gam7-7.20.0.dist-info → gam7-7.20.2.dist-info}/entry_points.txt +0 -0
- {gam7-7.20.0.dist-info → gam7-7.20.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.20.
|
|
28
|
+
__version__ = '7.20.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
|
|
@@ -27004,31 +27004,33 @@ CHAT_SPACES_ADMIN_ORDERBY_CHOICE_MAP = {
|
|
|
27004
27004
|
|
|
27005
27005
|
# gam [<UserTypeEntity>] show chatspaces
|
|
27006
27006
|
# [types <ChatSpaceTypeList>]
|
|
27007
|
-
# [fields <ChatSpaceFieldNameList>]
|
|
27007
|
+
# [fields <ChatSpaceFieldNameList>] [showaccesssettings]
|
|
27008
27008
|
# [formatjson]
|
|
27009
27009
|
# gam [<UserTypeEntity>] print chatspaces [todrive <ToDriveAttribute>*]
|
|
27010
27010
|
# [types <ChatSpaceTypeList>]
|
|
27011
|
-
# [fields <ChatSpaceFieldNameList>]
|
|
27011
|
+
# [fields <ChatSpaceFieldNameList>] [showaccesssettings]
|
|
27012
27012
|
# [formatjson [quotechar <Character>]]
|
|
27013
27013
|
# gam <UserItem> show chatspaces asadmin
|
|
27014
27014
|
# [query <String>] [querytime<String> <Time>]
|
|
27015
27015
|
# [orderby <ChatSpaceAdminOrderByFieldName> [ascending|descending]]
|
|
27016
|
-
# [fields <ChatSpaceFieldNameList>]
|
|
27016
|
+
# [fields <ChatSpaceFieldNameList>] [showaccesssettings]
|
|
27017
27017
|
# [formatjson]
|
|
27018
27018
|
# gam <UserItem> print chatspaces asadmin [todrive <ToDriveAttribute>*]
|
|
27019
27019
|
# [query <String>] [querytime<String> <Time>]
|
|
27020
27020
|
# [orderby <ChatSpaceAdminOrderByFieldName> [ascending|descending]]
|
|
27021
|
-
# [fields <ChatSpaceFieldNameList>]
|
|
27021
|
+
# [fields <ChatSpaceFieldNameList>] [showaccesssettings]
|
|
27022
27022
|
# [formatjson [quotechar <Character>]]
|
|
27023
27023
|
def printShowChatSpaces(users):
|
|
27024
27024
|
csvPF = CSVPrintFile(['User', 'name'] if not isinstance(users, list) else ['name']) if Act.csvFormat() else None
|
|
27025
27025
|
FJQC = FormatJSONQuoteChar(csvPF)
|
|
27026
27026
|
OBY = OrderBy(CHAT_SPACES_ADMIN_ORDERBY_CHOICE_MAP)
|
|
27027
27027
|
useAdminAccess, api, kwargsCS = _getChatAdminAccess(API.CHAT_SPACES_ADMIN, API.CHAT_SPACES)
|
|
27028
|
+
kwargsSAS = {'useAdminAccess': useAdminAccess}
|
|
27028
27029
|
fieldsList = []
|
|
27029
27030
|
queries = []
|
|
27030
27031
|
queryTimes = {}
|
|
27031
27032
|
pfilter = ''
|
|
27033
|
+
showAccessSettings = False
|
|
27032
27034
|
if useAdminAccess:
|
|
27033
27035
|
function = 'search'
|
|
27034
27036
|
queries = ['customer = "customers/my_customer" AND spaceType = "SPACE"']
|
|
@@ -27044,8 +27046,12 @@ def printShowChatSpaces(users):
|
|
|
27044
27046
|
pass
|
|
27045
27047
|
elif useAdminAccess and _getChatSpaceSearchParms(myarg, queries, queryTimes, OBY):
|
|
27046
27048
|
pass
|
|
27049
|
+
elif myarg == 'showaccesssettings':
|
|
27050
|
+
showAccessSettings = True
|
|
27047
27051
|
else:
|
|
27048
27052
|
FJQC.GetFormatJSONQuoteChar(myarg, True)
|
|
27053
|
+
if showAccessSettings and fieldsList:
|
|
27054
|
+
fieldsList.extend(['name', 'spaceType'])
|
|
27049
27055
|
fields = getItemFieldsFromFieldsList('spaces', fieldsList)
|
|
27050
27056
|
i, count, users = getEntityArgument(users)
|
|
27051
27057
|
if useAdminAccess:
|
|
@@ -27070,6 +27076,17 @@ def printShowChatSpaces(users):
|
|
|
27070
27076
|
GAPI.PERMISSION_DENIED, GAPI.FAILED_PRECONDITION],
|
|
27071
27077
|
retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS,
|
|
27072
27078
|
fields=fields, pageSize=CHAT_PAGE_SIZE, **kwargsCS)
|
|
27079
|
+
if showAccessSettings:
|
|
27080
|
+
for space in spaces:
|
|
27081
|
+
if space['spaceType'] == 'SPACE':
|
|
27082
|
+
try:
|
|
27083
|
+
result = callGAPI(chat.spaces(), 'get',
|
|
27084
|
+
throwReasons=[GAPI.NOT_FOUND, GAPI.INVALID_ARGUMENT, GAPI.INTERNAL_ERROR,
|
|
27085
|
+
GAPI.PERMISSION_DENIED, GAPI.FAILED_PRECONDITION],
|
|
27086
|
+
name=space['name'], fields='accessSettings', **kwargsSAS)
|
|
27087
|
+
space.update(result)
|
|
27088
|
+
except (GAPI.notFound, GAPI.invalidArgument, GAPI.internalError, GAPI.permissionDenied, GAPI.failedPrecondition):
|
|
27089
|
+
pass
|
|
27073
27090
|
except (GAPI.notFound, GAPI.invalidArgument, GAPI.internalError, GAPI.permissionDenied) as e:
|
|
27074
27091
|
exitIfChatNotConfigured(chat, kvList, str(e), i, count)
|
|
27075
27092
|
continue
|
|
@@ -51216,7 +51233,7 @@ def printShowClassroomProfile(users):
|
|
|
51216
51233
|
|
|
51217
51234
|
# gam create course-studentgroups
|
|
51218
51235
|
# (course|class <CourseEntity>)*|([teacher <UserItem>] [student <UserItem>] [states <CourseStateList>])
|
|
51219
|
-
# title <String>
|
|
51236
|
+
# ((title <String>)|(select <StringEntity))+
|
|
51220
51237
|
# [csv [todrive <ToDriveAttribute>*] [formatjson [quotechar <Character>]]]
|
|
51221
51238
|
def doCreateCourseStudentGroups():
|
|
51222
51239
|
croom = buildGAPIObject(API.CLASSROOM)
|
|
@@ -51226,10 +51243,13 @@ def doCreateCourseStudentGroups():
|
|
|
51226
51243
|
courseShowProperties = _initCourseShowProperties(['name'])
|
|
51227
51244
|
useOwnerAccess = GC.Values[GC.USE_COURSE_OWNER_ACCESS]
|
|
51228
51245
|
kwargs = {'courseId': None, 'body': {}}
|
|
51246
|
+
titles = []
|
|
51229
51247
|
while Cmd.ArgumentsRemaining():
|
|
51230
51248
|
myarg = getArgument()
|
|
51231
51249
|
if myarg == 'title':
|
|
51232
|
-
|
|
51250
|
+
titles.append(getString(Cmd.OB_STRING))
|
|
51251
|
+
elif myarg == 'select':
|
|
51252
|
+
titles.extend(getEntityList(Cmd.OB_STRING_ENTITY, shlexSplit=True))
|
|
51233
51253
|
elif _getCourseSelectionParameters(myarg, courseSelectionParameters):
|
|
51234
51254
|
pass
|
|
51235
51255
|
elif myarg == 'csv':
|
|
@@ -51239,8 +51259,9 @@ def doCreateCourseStudentGroups():
|
|
|
51239
51259
|
csvPF.GetTodriveParameters()
|
|
51240
51260
|
else:
|
|
51241
51261
|
FJQC.GetFormatJSONQuoteChar(myarg, True)
|
|
51242
|
-
if
|
|
51262
|
+
if not titles:
|
|
51243
51263
|
missingArgumentExit('title')
|
|
51264
|
+
jcount = len(titles)
|
|
51244
51265
|
if csvPF and FJQC.formatJSON:
|
|
51245
51266
|
csvPF.SetJSONTitles(['courseId', 'courseName', 'JSON'])
|
|
51246
51267
|
coursesInfo = _getCoursesInfo(croom, courseSelectionParameters, courseShowProperties, useOwnerAccess)
|
|
@@ -51255,29 +51276,36 @@ def doCreateCourseStudentGroups():
|
|
|
51255
51276
|
if not ocroom:
|
|
51256
51277
|
continue
|
|
51257
51278
|
kwargs['courseId'] = courseId
|
|
51258
|
-
|
|
51259
|
-
|
|
51260
|
-
|
|
51261
|
-
|
|
51262
|
-
|
|
51263
|
-
|
|
51264
|
-
|
|
51265
|
-
|
|
51266
|
-
|
|
51267
|
-
|
|
51268
|
-
|
|
51269
|
-
|
|
51270
|
-
|
|
51271
|
-
|
|
51272
|
-
|
|
51273
|
-
|
|
51274
|
-
|
|
51275
|
-
|
|
51276
|
-
|
|
51277
|
-
|
|
51278
|
-
|
|
51279
|
-
|
|
51280
|
-
|
|
51279
|
+
entityPerformActionNumItems([Ent.COURSE, courseId], jcount, Ent.COURSE_STUDENTGROUP, i, count)
|
|
51280
|
+
Ind.Increment()
|
|
51281
|
+
j = 0
|
|
51282
|
+
for title in titles:
|
|
51283
|
+
j += 1
|
|
51284
|
+
kwargs['body']['title'] = title
|
|
51285
|
+
kvList = [Ent.COURSE, courseId, Ent.COURSE_STUDENTGROUP, None]
|
|
51286
|
+
try:
|
|
51287
|
+
studentGroup = callGAPI(ocroom.courses().studentGroups(), 'create',
|
|
51288
|
+
throwReasons=[GAPI.NOT_FOUND, GAPI.SERVICE_NOT_AVAILABLE, GAPI.NOT_IMPLEMENTED,
|
|
51289
|
+
GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED],
|
|
51290
|
+
retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS,
|
|
51291
|
+
previewVersion='V1_20250630_PREVIEW',
|
|
51292
|
+
**kwargs)
|
|
51293
|
+
kvList[-1] = f"{studentGroup['title']}({studentGroup['id']})"
|
|
51294
|
+
if not csvPF:
|
|
51295
|
+
entityActionPerformed(kvList, j, jcount)
|
|
51296
|
+
elif not FJQC.formatJSON:
|
|
51297
|
+
csvPF.WriteRow({'courseId': courseId, 'courseName': course['name'],
|
|
51298
|
+
'studentGroupId': studentGroup['id'], 'studentGroupTitle': studentGroup['title']})
|
|
51299
|
+
else:
|
|
51300
|
+
csvPF.WriteRowNoFilter({'courseId': courseId, 'courseName': course['name'],
|
|
51301
|
+
'JSON': json.dumps(cleanJSON(studentGroup), ensure_ascii=False, sort_keys=True)})
|
|
51302
|
+
except GAPI.notFound as e:
|
|
51303
|
+
entityActionFailedWarning(kvList, str(e), j, jcount)
|
|
51304
|
+
except (GAPI.serviceNotAvailable, GAPI.notImplemented) as e:
|
|
51305
|
+
entityActionFailedExit([Ent.COURSE, courseId], str(e), j, jcount)
|
|
51306
|
+
except (GAPI.forbidden, GAPI.permissionDenied) as e:
|
|
51307
|
+
ClientAPIAccessDeniedExit(str(e))
|
|
51308
|
+
Ind.Decrement()
|
|
51281
51309
|
if csvPF:
|
|
51282
51310
|
csvPF.writeCSVfile('Course Student Groups')
|
|
51283
51311
|
|
gam/gamlib/glclargs.py
CHANGED
|
@@ -1057,6 +1057,7 @@ class GamCLArgs():
|
|
|
1057
1057
|
OB_SPREADSHEET_RANGE_LIST = 'SpreadsheetRangeList'
|
|
1058
1058
|
OB_STATE_NAME_LIST = "StateNameList"
|
|
1059
1059
|
OB_STRING = 'String'
|
|
1060
|
+
OB_STRING_ENTITY = 'StringEntity'
|
|
1060
1061
|
OB_STRING_LIST = 'StringList'
|
|
1061
1062
|
OB_STUDENTGROUP_ID = 'StudentGroupID'
|
|
1062
1063
|
OB_STUDENTGROUP_ID_ENTITY = 'StudentGroupIDEntity'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
gam/__init__.py,sha256=
|
|
1
|
+
gam/__init__.py,sha256=Og3IJDcd2aooFJB-qfDqe39cEcQc6-CPGbdHFsv0LqY,3608827
|
|
2
2
|
gam/__main__.py,sha256=amz0-959ph6zkZKqjaar4n60yho-T37w6qWI36qx0CA,1049
|
|
3
3
|
gam/cacerts.pem,sha256=DUsVo2XlFYwfkhe3gnxa-Km4Z4noz74hSApXwTT-nQE,44344
|
|
4
4
|
gam/cbcm-v1.1beta1.json,sha256=xO5XloCQQULmPbFBx5bckdqmbLFQ7sJ2TImhE1ysDIY,19439
|
|
@@ -25,7 +25,7 @@ gam/gamlib/__init__.py,sha256=z5mF-y0j8pm-YNFBaiuxB4M_GAUPG-cXWwrhYwrVReM,679
|
|
|
25
25
|
gam/gamlib/glaction.py,sha256=1Il_HrChVnPkzZwiZs5au4mFQVtq4K1Z42uIuR6qdnI,9419
|
|
26
26
|
gam/gamlib/glapi.py,sha256=u97M7Y2BeP3tYEEGYEz-9kY4fdV0fYkeqC3YN-sRwNc,36028
|
|
27
27
|
gam/gamlib/glcfg.py,sha256=7Ut-7sDTw-WVHZfvDWn_dlVNfuWd6VsPDBpQ3qnyzJE,28100
|
|
28
|
-
gam/gamlib/glclargs.py,sha256=
|
|
28
|
+
gam/gamlib/glclargs.py,sha256=vDHe3heii7s-VN0xren0CCS5S6c1e5dCLigWTZlyeY8,44170
|
|
29
29
|
gam/gamlib/glentity.py,sha256=8F98YR1ronheiQShD6WHlY-YnBKfMDrc33iRuRoLIvo,35097
|
|
30
30
|
gam/gamlib/glgapi.py,sha256=pdBbwNtnCwFWxJGaP-_3hdTjSNoOCJF2yo76WdQOi1k,40426
|
|
31
31
|
gam/gamlib/glgdata.py,sha256=weRppttWm6uRyqtBoGPKoHiNZ2h28nhfUV4J_mbCszY,2707
|
|
@@ -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.20.
|
|
69
|
-
gam7-7.20.
|
|
70
|
-
gam7-7.20.
|
|
71
|
-
gam7-7.20.
|
|
72
|
-
gam7-7.20.
|
|
68
|
+
gam7-7.20.2.dist-info/METADATA,sha256=c9_lWA1fLzDtqEw6pI_v7ReKM3Sy18VnJpq6gU7xnHQ,2940
|
|
69
|
+
gam7-7.20.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
70
|
+
gam7-7.20.2.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
|
|
71
|
+
gam7-7.20.2.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
72
|
+
gam7-7.20.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|