gam7 7.20.1__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 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.01'
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
@@ -51233,7 +51233,7 @@ def printShowClassroomProfile(users):
51233
51233
 
51234
51234
  # gam create course-studentgroups
51235
51235
  # (course|class <CourseEntity>)*|([teacher <UserItem>] [student <UserItem>] [states <CourseStateList>])
51236
- # title <String>
51236
+ # ((title <String>)|(select <StringEntity))+
51237
51237
  # [csv [todrive <ToDriveAttribute>*] [formatjson [quotechar <Character>]]]
51238
51238
  def doCreateCourseStudentGroups():
51239
51239
  croom = buildGAPIObject(API.CLASSROOM)
@@ -51243,10 +51243,13 @@ def doCreateCourseStudentGroups():
51243
51243
  courseShowProperties = _initCourseShowProperties(['name'])
51244
51244
  useOwnerAccess = GC.Values[GC.USE_COURSE_OWNER_ACCESS]
51245
51245
  kwargs = {'courseId': None, 'body': {}}
51246
+ titles = []
51246
51247
  while Cmd.ArgumentsRemaining():
51247
51248
  myarg = getArgument()
51248
51249
  if myarg == 'title':
51249
- kwargs['body']['title'] = getString(Cmd.OB_STRING)
51250
+ titles.append(getString(Cmd.OB_STRING))
51251
+ elif myarg == 'select':
51252
+ titles.extend(getEntityList(Cmd.OB_STRING_ENTITY, shlexSplit=True))
51250
51253
  elif _getCourseSelectionParameters(myarg, courseSelectionParameters):
51251
51254
  pass
51252
51255
  elif myarg == 'csv':
@@ -51256,8 +51259,9 @@ def doCreateCourseStudentGroups():
51256
51259
  csvPF.GetTodriveParameters()
51257
51260
  else:
51258
51261
  FJQC.GetFormatJSONQuoteChar(myarg, True)
51259
- if 'title' not in kwargs['body']:
51262
+ if not titles:
51260
51263
  missingArgumentExit('title')
51264
+ jcount = len(titles)
51261
51265
  if csvPF and FJQC.formatJSON:
51262
51266
  csvPF.SetJSONTitles(['courseId', 'courseName', 'JSON'])
51263
51267
  coursesInfo = _getCoursesInfo(croom, courseSelectionParameters, courseShowProperties, useOwnerAccess)
@@ -51272,29 +51276,36 @@ def doCreateCourseStudentGroups():
51272
51276
  if not ocroom:
51273
51277
  continue
51274
51278
  kwargs['courseId'] = courseId
51275
- kvList = [Ent.COURSE, courseId, Ent.COURSE_STUDENTGROUP, None]
51276
- try:
51277
- studentGroup = callGAPI(ocroom.courses().studentGroups(), 'create',
51278
- throwReasons=[GAPI.NOT_FOUND, GAPI.SERVICE_NOT_AVAILABLE, GAPI.NOT_IMPLEMENTED,
51279
- GAPI.FORBIDDEN, GAPI.PERMISSION_DENIED],
51280
- retryReasons=GAPI.SERVICE_NOT_AVAILABLE_RETRY_REASONS,
51281
- previewVersion='V1_20250630_PREVIEW',
51282
- **kwargs)
51283
- kvList[-1] = f"{studentGroup['title']}({studentGroup['id']})"
51284
- if not csvPF:
51285
- entityActionPerformed(kvList, i, count)
51286
- elif not FJQC.formatJSON:
51287
- csvPF.WriteRow({'courseId': courseId, 'courseName': course['name'],
51288
- 'studentGroupId': studentGroup['id'], 'studentGroupTitle': studentGroup['title']})
51289
- else:
51290
- csvPF.WriteRowNoFilter({'courseId': courseId, 'courseName': course['name'],
51291
- 'JSON': json.dumps(cleanJSON(studentGroup), ensure_ascii=False, sort_keys=True)})
51292
- except GAPI.notFound as e:
51293
- entityActionFailedWarning(kvList, str(e), i, count)
51294
- except (GAPI.serviceNotAvailable, GAPI.notImplemented) as e:
51295
- entityActionFailedExit([Ent.COURSE, courseId], str(e), i, count)
51296
- except (GAPI.forbidden, GAPI.permissionDenied) as e:
51297
- ClientAPIAccessDeniedExit(str(e))
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()
51298
51309
  if csvPF:
51299
51310
  csvPF.writeCSVfile('Course Student Groups')
51300
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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gam7
3
- Version: 7.20.1
3
+ Version: 7.20.2
4
4
  Summary: CLI tool to manage Google Workspace
5
5
  Project-URL: Homepage, https://github.com/GAM-team/GAM
6
6
  Project-URL: Issues, https://github.com/GAM-team/GAM/issues
@@ -1,4 +1,4 @@
1
- gam/__init__.py,sha256=sa-yzi7R7kgKEULVunOY9AKzQbWAZfX9XH3tRPwGefg,3608416
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=9Oze97BT_GS2WXf4LYg4JlSCmZ_8fG2a33Ft1_pX43k,44134
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.1.dist-info/METADATA,sha256=7C53COsDbo2DNmBB177TsMQBp3Y_fgnMnx88aqQXuHg,2940
69
- gam7-7.20.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
70
- gam7-7.20.1.dist-info/entry_points.txt,sha256=HVUM5J7dA8YwvJfG30jiLefR19ExMs387TWugWd9sf4,42
71
- gam7-7.20.1.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
72
- gam7-7.20.1.dist-info/RECORD,,
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