gam7 7.5.19__tar.gz → 7.5.20__tar.gz

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.
Files changed (107) hide show
  1. {gam7-7.5.19 → gam7-7.5.20}/PKG-INFO +1 -1
  2. {gam7-7.5.19 → gam7-7.5.20}/src/GamUpdate.txt +11 -0
  3. {gam7-7.5.19 → gam7-7.5.20}/src/gam/__init__.py +19 -21
  4. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gamlib/glclargs.py +1 -0
  5. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gamlib/glmsgs.py +0 -1
  6. {gam7-7.5.19 → gam7-7.5.20}/.github/ISSUE_TEMPLATE/aa-question.md +0 -0
  7. {gam7-7.5.19 → gam7-7.5.20}/.github/ISSUE_TEMPLATE/za-bug-report.md +0 -0
  8. {gam7-7.5.19 → gam7-7.5.20}/.github/ISSUE_TEMPLATE/zz-feature-request.md +0 -0
  9. {gam7-7.5.19 → gam7-7.5.20}/.github/ISSUE_TEMPLATE.txt +0 -0
  10. {gam7-7.5.19 → gam7-7.5.20}/.github/actions/creds.tar.xz.gpg +0 -0
  11. {gam7-7.5.19 → gam7-7.5.20}/.github/actions/decrypt.sh +0 -0
  12. {gam7-7.5.19 → gam7-7.5.20}/.github/actions/entitlements.plist +0 -0
  13. {gam7-7.5.19 → gam7-7.5.20}/.github/actions/package_exclusions.txt +0 -0
  14. {gam7-7.5.19 → gam7-7.5.20}/.github/stale.yml +0 -0
  15. {gam7-7.5.19 → gam7-7.5.20}/.github/workflows/build.yml +0 -0
  16. {gam7-7.5.19 → gam7-7.5.20}/.github/workflows/codeql-analysis.yml +0 -0
  17. {gam7-7.5.19 → gam7-7.5.20}/.github/workflows/get-cacerts.yml +0 -0
  18. {gam7-7.5.19 → gam7-7.5.20}/.github/workflows/pypi.yml +0 -0
  19. {gam7-7.5.19 → gam7-7.5.20}/.pre-commit-config.yaml +0 -0
  20. {gam7-7.5.19 → gam7-7.5.20}/LICENSE +0 -0
  21. {gam7-7.5.19 → gam7-7.5.20}/README.md +0 -0
  22. {gam7-7.5.19 → gam7-7.5.20}/pyproject.toml +0 -0
  23. {gam7-7.5.19 → gam7-7.5.20}/src/.gitignore +0 -0
  24. {gam7-7.5.19 → gam7-7.5.20}/src/GamCommands.txt +0 -0
  25. {gam7-7.5.19 → gam7-7.5.20}/src/LICENSE +0 -0
  26. {gam7-7.5.19 → gam7-7.5.20}/src/cacerts.pem +0 -0
  27. {gam7-7.5.19 → gam7-7.5.20}/src/callgam.py +0 -0
  28. {gam7-7.5.19 → gam7-7.5.20}/src/gam/__main__.py +0 -0
  29. {gam7-7.5.19 → gam7-7.5.20}/src/gam/atom/__init__.py +0 -0
  30. {gam7-7.5.19 → gam7-7.5.20}/src/gam/atom/auth.py +0 -0
  31. {gam7-7.5.19 → gam7-7.5.20}/src/gam/atom/client.py +0 -0
  32. {gam7-7.5.19 → gam7-7.5.20}/src/gam/atom/core.py +0 -0
  33. {gam7-7.5.19 → gam7-7.5.20}/src/gam/atom/data.py +0 -0
  34. {gam7-7.5.19 → gam7-7.5.20}/src/gam/atom/http.py +0 -0
  35. {gam7-7.5.19 → gam7-7.5.20}/src/gam/atom/http_core.py +0 -0
  36. {gam7-7.5.19 → gam7-7.5.20}/src/gam/atom/http_interface.py +0 -0
  37. {gam7-7.5.19 → gam7-7.5.20}/src/gam/atom/mock_http.py +0 -0
  38. {gam7-7.5.19 → gam7-7.5.20}/src/gam/atom/mock_http_core.py +0 -0
  39. {gam7-7.5.19 → gam7-7.5.20}/src/gam/atom/mock_service.py +0 -0
  40. {gam7-7.5.19 → gam7-7.5.20}/src/gam/atom/service.py +0 -0
  41. {gam7-7.5.19 → gam7-7.5.20}/src/gam/atom/token_store.py +0 -0
  42. {gam7-7.5.19 → gam7-7.5.20}/src/gam/atom/url.py +0 -0
  43. {gam7-7.5.19 → gam7-7.5.20}/src/gam/cacerts.pem +0 -0
  44. {gam7-7.5.19 → gam7-7.5.20}/src/gam/cbcm-v1.1beta1.json +0 -0
  45. {gam7-7.5.19 → gam7-7.5.20}/src/gam/contactdelegation-v1.json +0 -0
  46. {gam7-7.5.19 → gam7-7.5.20}/src/gam/datastudio-v1.json +0 -0
  47. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gamlib/__init__.py +0 -0
  48. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gamlib/glaction.py +0 -0
  49. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gamlib/glapi.py +0 -0
  50. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gamlib/glcfg.py +0 -0
  51. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gamlib/glentity.py +0 -0
  52. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gamlib/glgapi.py +0 -0
  53. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gamlib/glgdata.py +0 -0
  54. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gamlib/glglobals.py +0 -0
  55. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gamlib/glindent.py +0 -0
  56. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gamlib/glskus.py +0 -0
  57. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gamlib/gluprop.py +0 -0
  58. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gamlib/glverlibs.py +0 -0
  59. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gamlib/yubikey.py +0 -0
  60. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gdata/__init__.py +0 -0
  61. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gdata/alt/__init__.py +0 -0
  62. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gdata/alt/app_engine.py +0 -0
  63. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gdata/alt/appengine.py +0 -0
  64. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gdata/apps/__init__.py +0 -0
  65. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gdata/apps/audit/__init__.py +0 -0
  66. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gdata/apps/audit/service.py +0 -0
  67. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gdata/apps/contacts/__init__.py +0 -0
  68. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gdata/apps/contacts/service.py +0 -0
  69. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gdata/apps/service.py +0 -0
  70. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gdata/service.py +0 -0
  71. {gam7-7.5.19 → gam7-7.5.20}/src/gam/gdata/urlfetch.py +0 -0
  72. {gam7-7.5.19 → gam7-7.5.20}/src/gam/googleapiclient/__init__.py +0 -0
  73. {gam7-7.5.19 → gam7-7.5.20}/src/gam/googleapiclient/_auth.py +0 -0
  74. {gam7-7.5.19 → gam7-7.5.20}/src/gam/googleapiclient/_helpers.py +0 -0
  75. {gam7-7.5.19 → gam7-7.5.20}/src/gam/googleapiclient/channel.py +0 -0
  76. {gam7-7.5.19 → gam7-7.5.20}/src/gam/googleapiclient/discovery.py +0 -0
  77. {gam7-7.5.19 → gam7-7.5.20}/src/gam/googleapiclient/discovery_cache/__init__.py +0 -0
  78. {gam7-7.5.19 → gam7-7.5.20}/src/gam/googleapiclient/discovery_cache/appengine_memcache.py +0 -0
  79. {gam7-7.5.19 → gam7-7.5.20}/src/gam/googleapiclient/discovery_cache/base.py +0 -0
  80. {gam7-7.5.19 → gam7-7.5.20}/src/gam/googleapiclient/discovery_cache/file_cache.py +0 -0
  81. {gam7-7.5.19 → gam7-7.5.20}/src/gam/googleapiclient/errors.py +0 -0
  82. {gam7-7.5.19 → gam7-7.5.20}/src/gam/googleapiclient/http.py +0 -0
  83. {gam7-7.5.19 → gam7-7.5.20}/src/gam/googleapiclient/mimeparse.py +0 -0
  84. {gam7-7.5.19 → gam7-7.5.20}/src/gam/googleapiclient/model.py +0 -0
  85. {gam7-7.5.19 → gam7-7.5.20}/src/gam/googleapiclient/schema.py +0 -0
  86. {gam7-7.5.19 → gam7-7.5.20}/src/gam/googleapiclient/version.py +0 -0
  87. {gam7-7.5.19 → gam7-7.5.20}/src/gam/iso8601/__init__.py +0 -0
  88. {gam7-7.5.19 → gam7-7.5.20}/src/gam/iso8601/iso8601.py +0 -0
  89. {gam7-7.5.19 → gam7-7.5.20}/src/gam/meet-v2beta.json +0 -0
  90. {gam7-7.5.19 → gam7-7.5.20}/src/gam/serviceaccountlookup-v1.json +0 -0
  91. {gam7-7.5.19 → gam7-7.5.20}/src/gam/six.py +0 -0
  92. {gam7-7.5.19 → gam7-7.5.20}/src/gam-install.sh +0 -0
  93. {gam7-7.5.19 → gam7-7.5.20}/src/gam-setup.bat +0 -0
  94. {gam7-7.5.19 → gam7-7.5.20}/src/gam.exe.manifest +0 -0
  95. {gam7-7.5.19 → gam7-7.5.20}/src/gam.py +0 -0
  96. {gam7-7.5.19 → gam7-7.5.20}/src/gam.spec +0 -0
  97. {gam7-7.5.19 → gam7-7.5.20}/src/gam.wxs +0 -0
  98. {gam7-7.5.19 → gam7-7.5.20}/src/license.rtf +0 -0
  99. {gam7-7.5.19 → gam7-7.5.20}/src/requirements-dev.txt +0 -0
  100. {gam7-7.5.19 → gam7-7.5.20}/src/requirements.txt +0 -0
  101. {gam7-7.5.19 → gam7-7.5.20}/src/setup.cfg +0 -0
  102. {gam7-7.5.19 → gam7-7.5.20}/src/setup.py +0 -0
  103. {gam7-7.5.19 → gam7-7.5.20}/src/tools/a_atleast_b.py +0 -0
  104. {gam7-7.5.19 → gam7-7.5.20}/src/tools/gen-wix-xml-filelist.py +0 -0
  105. {gam7-7.5.19 → gam7-7.5.20}/src/tools/mkGamRef.py +0 -0
  106. {gam7-7.5.19 → gam7-7.5.20}/src/tools/openssl.props +0 -0
  107. {gam7-7.5.19 → gam7-7.5.20}/src/version_info.txt.in +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gam7
3
- Version: 7.5.19
3
+ Version: 7.5.20
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,3 +1,14 @@
1
+ 7.05.20
2
+
3
+ Updated code to validate both `<RegularExpression>` and `<ReplacementString>`
4
+ in the following command line options; this will expose errors when the command
5
+ is being parsed rather than at run-time.
6
+ ```
7
+ replaceregex <RegularExpression> <ReplacementString>
8
+ replacedescription <RegularExpression> <ReplacementString>
9
+ replacefilename <RegularExpression> <ReplacementString>
10
+ ```
11
+
1
12
  7.05.19
2
13
 
3
14
  Added `replaceregex <RegularExpression> <ReplacementString> <Tag> <String>` to the following commands:
@@ -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.05.19'
28
+ __version__ = '7.05.20'
29
29
  __license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
30
30
 
31
31
  #pylint: disable=wrong-import-position
@@ -1723,6 +1723,16 @@ def getREPattern(flags=0):
1723
1723
  return validateREPattern(patstr, flags)
1724
1724
  missingArgumentExit(Cmd.OB_RE_PATTERN)
1725
1725
 
1726
+ def getREPatternReplacement(flags=0):
1727
+ pattern = getREPattern(flags)
1728
+ replacement = getString(Cmd.OB_STRING, minLen=0)
1729
+ try:
1730
+ re.sub(pattern, replacement, '')
1731
+ return (pattern, replacement)
1732
+ except re.error as e:
1733
+ Cmd.Backup()
1734
+ usageErrorExit(f'{Cmd.OB_RE_REPLACEMENT} {Msg.ERROR}: {e}')
1735
+
1726
1736
  def getSheetEntity(allowBlankSheet):
1727
1737
  if Cmd.ArgumentsRemaining():
1728
1738
  sheet = Cmd.Current()
@@ -14521,7 +14531,7 @@ def _getTagReplacement(myarg, tagReplacements, allowSubs):
14521
14531
  if myarg == 'replace':
14522
14532
  trregex = None
14523
14533
  elif myarg == 'replaceregex':
14524
- trregex = (getREPattern(re.IGNORECASE), getString(Cmd.OB_STRING, minLen=0))
14534
+ trregex = getREPatternReplacement(re.IGNORECASE)
14525
14535
  else:
14526
14536
  return False
14527
14537
  matchTag = getString(Cmd.OB_TAG)
@@ -14600,10 +14610,7 @@ def _getTagReplacement(myarg, tagReplacements, allowSubs):
14600
14610
  if trregex is None:
14601
14611
  tagReplacements['tags'][matchTag] = {'value': matchReplacement}
14602
14612
  else:
14603
- try:
14604
- tagReplacements['tags'][matchTag] = {'value': re.sub(trregex[0], trregex[1], matchReplacement)}
14605
- except re.error as e:
14606
- systemErrorExit(ACTION_FAILED_RC, Msg.REGEX_REPLACEMENT_ERROR.format(trregex[1], str(e)))
14613
+ tagReplacements['tags'][matchTag] = {'value': re.sub(trregex[0], trregex[1], matchReplacement)}
14607
14614
  return True
14608
14615
 
14609
14616
  def _getTagReplacementFieldValues(user, i, count, tagReplacements, results=None):
@@ -14688,10 +14695,7 @@ def _getTagReplacementFieldValues(user, i, count, tagReplacements, results=None)
14688
14695
  tag['value'] = _substituteForUser(tag['template'], user, userName)
14689
14696
  trregex = tag.get('trregex', None)
14690
14697
  if trregex is not None:
14691
- try:
14692
- tag['value'] = re.sub(trregex[0], trregex[1], tag['value'])
14693
- except re.error as e:
14694
- systemErrorExit(ACTION_FAILED_RC, Msg.REGEX_REPLACEMENT_ERROR.format(trregex[1], str(e)))
14698
+ tag['value'] = re.sub(trregex[0], trregex[1], tag['value'])
14695
14699
 
14696
14700
  RTL_PATTERN = re.compile(r'(?s){RTL}.*?{/RTL}')
14697
14701
  RT_PATTERN = re.compile(r'(?s){RT}.*?{/RT}')
@@ -38560,7 +38564,7 @@ def _getCalendarEventAttribute(myarg, body, parameters, function):
38560
38564
  elif myarg == 'description':
38561
38565
  body['description'] = getStringWithCRsNLs()
38562
38566
  elif function == 'update' and myarg == 'replacedescription':
38563
- parameters['replaceDescription'].append((getREPattern(re.IGNORECASE), getString(Cmd.OB_STRING, minLen=0)))
38567
+ parameters['replaceDescription'].append(getREPatternReplacement(re.IGNORECASE))
38564
38568
  elif myarg == 'location':
38565
38569
  body['location'] = getString(Cmd.OB_STRING, minLen=0)
38566
38570
  elif myarg == 'source':
@@ -39109,10 +39113,7 @@ def _updateCalendarEvents(origUser, user, origCal, calIds, count, calendarEventE
39109
39113
  if 'description' in updateFieldList and 'description' in event:
39110
39114
  body['description'] = event['description']
39111
39115
  for replacement in parameters['replaceDescription']:
39112
- try:
39113
- body['description'] = re.sub(replacement[0], replacement[1], body['description'])
39114
- except re.error as e:
39115
- systemErrorExit(ACTION_FAILED_RC, Msg.REGEX_REPLACEMENT_ERROR.format(replacement[1], str(e)))
39116
+ body['description'] = re.sub(replacement[0], replacement[1], body['description'])
39116
39117
  if 'attendees' in updateFieldList:
39117
39118
  if not parameters['clearAttendees']:
39118
39119
  if 'attendees' in event:
@@ -52835,7 +52836,7 @@ def getDriveFileAttribute(myarg, body, parameters, updateCmd):
52835
52836
  elif myarg =='stripnameprefix':
52836
52837
  parameters[DFA_STRIPNAMEPREFIX] = getString(Cmd.OB_STRING, minLen=0)
52837
52838
  elif myarg == 'replacefilename':
52838
- parameters[DFA_REPLACEFILENAME].append((getREPattern(re.IGNORECASE), getString(Cmd.OB_STRING, minLen=0)))
52839
+ parameters[DFA_REPLACEFILENAME].append(getREPatternReplacement(re.IGNORECASE))
52839
52840
  elif myarg in {'convert', 'ocr'}:
52840
52841
  deprecatedArgument(myarg)
52841
52842
  stderrWarningMsg(Msg.USE_MIMETYPE_TO_SPECIFY_GOOGLE_FORMAT)
@@ -57380,10 +57381,7 @@ def writeReturnIdLink(returnIdLink, mimeType, result):
57380
57381
 
57381
57382
  def processFilenameReplacements(name, replacements):
57382
57383
  for replacement in replacements:
57383
- try:
57384
- name = re.sub(replacement[0], replacement[1], name)
57385
- except re.error as e:
57386
- systemErrorExit(ACTION_FAILED_RC, Msg.REGEX_REPLACEMENT_ERROR.format(replacement[1], str(e)))
57384
+ name = re.sub(replacement[0], replacement[1], name)
57387
57385
  return name
57388
57386
 
57389
57387
  def addTimestampToFilename(parameters, body):
@@ -58395,7 +58393,7 @@ def getCopyMoveOptions(myarg, copyMoveOptions):
58395
58393
  elif myarg =='stripnameprefix':
58396
58394
  copyMoveOptions['stripNamePrefix'] = getString(Cmd.OB_STRING, minLen=0)
58397
58395
  elif myarg == 'replacefilename':
58398
- copyMoveOptions['replaceFilename'].append((getREPattern(re.IGNORECASE), getString(Cmd.OB_STRING, minLen=0)))
58396
+ copyMoveOptions['replaceFilename'].append(getREPatternReplacement(re.IGNORECASE))
58399
58397
  elif myarg == 'showpermissionmessages':
58400
58398
  copyMoveOptions['showPermissionMessages'] = getBoolean()
58401
58399
  elif myarg == 'sendemailifrequired':
@@ -991,6 +991,7 @@ class GamCLArgs():
991
991
  OB_RESOURCE_ENTITY = 'ResourceEntity'
992
992
  OB_RESOURCE_ID = 'ResourceID'
993
993
  OB_RE_PATTERN = 'REPattern'
994
+ OB_RE_REPLACEMENT = 'REReplacement'
994
995
  OB_ROLE_ASSIGNMENT_ID = 'RoleAssignmentID'
995
996
  OB_ROLE_ITEM = 'RoleItem'
996
997
  OB_ROLE_LIST = 'RoleList'
@@ -465,7 +465,6 @@ REASON_ONLY_VALID_WITH_CONTENTRESTRICTIONS_READONLY_TRUE = 'reason only valid wi
465
465
  REAUTHENTICATION_IS_NEEDED = 'Reauthentication is needed, please run\n\ngam oauth create'
466
466
  RECOMMEND_RUNNING_GAM_ROTATE_SAKEY = 'Recommend running "gam rotate sakey" to get a new key\n'
467
467
  REFUSING_TO_DEPROVISION_DEVICES = 'Refusing to deprovision {0} devices because acknowledge_device_touch_requirement not specified.\nDeprovisioning a device means the device will have to be physically wiped and re-enrolled to be managed by your domain again.\nThis requires physical access to the device and is very time consuming to perform for each device.\nPlease add "acknowledge_device_touch_requirement" to the GAM command if you understand this and wish to proceed with the deprovision.\nPlease also be aware that deprovisioning can have an effect on your device license count.\nSee https://support.google.com/chrome/a/answer/3523633 for full details.'
468
- REGEX_REPLACEMENT_ERROR = 'Regular expression replacement string "{0}" error: {1}'
469
468
  REPLY_TO_CUSTOM_REQUIRES_EMAIL_ADDRESS = 'replyto REPLY_TO_CUSTOM requires customReplyTo <EmailAddress>'
470
469
  REQUEST_COMPLETED_NO_FILES = 'Request completed but no results/files were returned, try requesting again'
471
470
  REQUEST_NOT_COMPLETE = 'Request needs to be completed before downloading, current status is: {0}'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes