mirror of
https://github.com/GAM-team/GAM.git
synced 2026-07-03 20:31:35 +00:00
Updated gam <UserTypeEntity> print|show messages|threads ... query <QueryGmail>
Some checks failed
Build and test GAM / build (false, build, 1, Build Intel Ubuntu Jammy, ubuntu-22.04) (push) Has been cancelled
Build and test GAM / build (false, build, 10, Build x86_64 macOS 15, macos-15-intel) (push) Has been cancelled
Build and test GAM / build (false, build, 11, Build Arm MacOS 26, macos-26) (push) Has been cancelled
Build and test GAM / build (false, build, 12, Build Intel Windows, windows-2025) (push) Has been cancelled
Build and test GAM / build (false, build, 13, Build Arm Windows, windows-11-arm) (push) Has been cancelled
Build and test GAM / build (false, build, 2, Build Intel Ubuntu Noble, ubuntu-24.04) (push) Has been cancelled
Build and test GAM / build (false, build, 3, Build Arm Ubuntu Noble, ubuntu-24.04-arm) (push) Has been cancelled
Build and test GAM / build (false, build, 4, Build Arm Ubuntu Jammy, ubuntu-22.04-arm) (push) Has been cancelled
Build and test GAM / build (false, build, 5, Build Intel StaticX Legacy, ubuntu-22.04, yes) (push) Has been cancelled
Build and test GAM / build (false, build, 6, Build Arm StaticX Legacy, ubuntu-22.04-arm, yes) (push) Has been cancelled
Build and test GAM / build (false, build, 8, Build Arm MacOS 14, macos-14) (push) Has been cancelled
Build and test GAM / build (false, build, 9, Build Arm MacOS 15, macos-15) (push) Has been cancelled
Build and test GAM / build (false, test, 14, Test Python 3.10, ubuntu-24.04, 3.10) (push) Has been cancelled
Build and test GAM / build (false, test, 15, Test Python 3.11, ubuntu-24.04, 3.11) (push) Has been cancelled
Build and test GAM / build (false, test, 16, Test Python 3.12, ubuntu-24.04, 3.12) (push) Has been cancelled
Build and test GAM / build (false, test, 17, Test Python 3.15-dev, ubuntu-24.04, 3.15-dev) (push) Has been cancelled
Build and test GAM / build (true, test, 18, Test Python 3.14 freethread, ubuntu-24.04, 3.14) (push) Has been cancelled
Build and test GAM / merge (push) Has been cancelled
Build and test GAM / publish (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Check for Google Root CA Updates / check-certs (push) Has been cancelled
Some checks failed
Build and test GAM / build (false, build, 1, Build Intel Ubuntu Jammy, ubuntu-22.04) (push) Has been cancelled
Build and test GAM / build (false, build, 10, Build x86_64 macOS 15, macos-15-intel) (push) Has been cancelled
Build and test GAM / build (false, build, 11, Build Arm MacOS 26, macos-26) (push) Has been cancelled
Build and test GAM / build (false, build, 12, Build Intel Windows, windows-2025) (push) Has been cancelled
Build and test GAM / build (false, build, 13, Build Arm Windows, windows-11-arm) (push) Has been cancelled
Build and test GAM / build (false, build, 2, Build Intel Ubuntu Noble, ubuntu-24.04) (push) Has been cancelled
Build and test GAM / build (false, build, 3, Build Arm Ubuntu Noble, ubuntu-24.04-arm) (push) Has been cancelled
Build and test GAM / build (false, build, 4, Build Arm Ubuntu Jammy, ubuntu-22.04-arm) (push) Has been cancelled
Build and test GAM / build (false, build, 5, Build Intel StaticX Legacy, ubuntu-22.04, yes) (push) Has been cancelled
Build and test GAM / build (false, build, 6, Build Arm StaticX Legacy, ubuntu-22.04-arm, yes) (push) Has been cancelled
Build and test GAM / build (false, build, 8, Build Arm MacOS 14, macos-14) (push) Has been cancelled
Build and test GAM / build (false, build, 9, Build Arm MacOS 15, macos-15) (push) Has been cancelled
Build and test GAM / build (false, test, 14, Test Python 3.10, ubuntu-24.04, 3.10) (push) Has been cancelled
Build and test GAM / build (false, test, 15, Test Python 3.11, ubuntu-24.04, 3.11) (push) Has been cancelled
Build and test GAM / build (false, test, 16, Test Python 3.12, ubuntu-24.04, 3.12) (push) Has been cancelled
Build and test GAM / build (false, test, 17, Test Python 3.15-dev, ubuntu-24.04, 3.15-dev) (push) Has been cancelled
Build and test GAM / build (true, test, 18, Test Python 3.14 freethread, ubuntu-24.04, 3.14) (push) Has been cancelled
Build and test GAM / merge (push) Has been cancelled
Build and test GAM / publish (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Check for Google Root CA Updates / check-certs (push) Has been cancelled
This commit is contained in:
@@ -1,3 +1,7 @@
|
|||||||
|
7.31.04
|
||||||
|
|
||||||
|
Updated `gam <UserTypeEntity> print|show messages|threads ... query <QueryGmail>` to display the query.
|
||||||
|
|
||||||
7.31.03
|
7.31.03
|
||||||
|
|
||||||
Due to the following Calendar API update, the `gam <UserTypeEntity> transfer calendars` command has been removed.
|
Due to the following Calendar API update, the `gam <UserTypeEntity> transfer calendars` command has been removed.
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
|
||||||
__version__ = '7.31.03'
|
__version__ = '7.31.04'
|
||||||
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
|
||||||
|
|
||||||
#pylint: disable=wrong-import-position
|
#pylint: disable=wrong-import-position
|
||||||
@@ -72632,6 +72632,11 @@ LABEL_QUERY_REPLACEMENT_CHARACTERS = ' &()"|{}/'
|
|||||||
|
|
||||||
def _getMessageSelectParameters(myarg, parameters):
|
def _getMessageSelectParameters(myarg, parameters):
|
||||||
if myarg == 'query':
|
if myarg == 'query':
|
||||||
|
if parameters['query']:
|
||||||
|
if parameters['labelGroupOpen']:
|
||||||
|
parameters['query'] += ')'
|
||||||
|
parameters['labelGroupOpen'] = False
|
||||||
|
parameters['query'] += ' '
|
||||||
parameters['query'] += f'({getString(Cmd.OB_QUERY)})'
|
parameters['query'] += f'({getString(Cmd.OB_QUERY)})'
|
||||||
elif myarg.startswith('querytime'):
|
elif myarg.startswith('querytime'):
|
||||||
parameters['queryTimes'][myarg] = getDateOrDeltaFromNow().replace('-', '/')
|
parameters['queryTimes'][myarg] = getDateOrDeltaFromNow().replace('-', '/')
|
||||||
@@ -72641,8 +72646,12 @@ def _getMessageSelectParameters(myarg, parameters):
|
|||||||
for c in labelTemp:
|
for c in labelTemp:
|
||||||
labelName += c if c not in LABEL_QUERY_REPLACEMENT_CHARACTERS else '-'
|
labelName += c if c not in LABEL_QUERY_REPLACEMENT_CHARACTERS else '-'
|
||||||
if not parameters['labelGroupOpen']:
|
if not parameters['labelGroupOpen']:
|
||||||
|
if parameters['query']:
|
||||||
|
parameters['query'] += ' '
|
||||||
parameters['query'] += '('
|
parameters['query'] += '('
|
||||||
parameters['labelGroupOpen'] = True
|
parameters['labelGroupOpen'] = True
|
||||||
|
else:
|
||||||
|
parameters['query'] += ' '
|
||||||
parameters['query'] += f'label:{labelName}'
|
parameters['query'] += f'label:{labelName}'
|
||||||
elif myarg in {'or', 'and'}:
|
elif myarg in {'or', 'and'}:
|
||||||
parameters['prevLabelOp'] = parameters['currLabelOp']
|
parameters['prevLabelOp'] = parameters['currLabelOp']
|
||||||
@@ -72650,7 +72659,7 @@ def _getMessageSelectParameters(myarg, parameters):
|
|||||||
if parameters['labelGroupOpen'] and parameters['currLabelOp'] != parameters['prevLabelOp']:
|
if parameters['labelGroupOpen'] and parameters['currLabelOp'] != parameters['prevLabelOp']:
|
||||||
parameters['query'] += ')'
|
parameters['query'] += ')'
|
||||||
parameters['labelGroupOpen'] = False
|
parameters['labelGroupOpen'] = False
|
||||||
if parameters['currLabelOp'] == 'or':
|
if parameters['currLabelOp'] == 'or' and parameters['query']:
|
||||||
parameters['query'] += ' OR'
|
parameters['query'] += ' OR'
|
||||||
elif myarg == 'labelmatchpattern':
|
elif myarg == 'labelmatchpattern':
|
||||||
parameters['labelMatchPattern'] = getREPattern(re.IGNORECASE)
|
parameters['labelMatchPattern'] = getREPattern(re.IGNORECASE)
|
||||||
@@ -72755,7 +72764,7 @@ def archiveMessages(users):
|
|||||||
service = gmail.users().messages()
|
service = gmail.users().messages()
|
||||||
try:
|
try:
|
||||||
if parameters['messageEntity'] is None:
|
if parameters['messageEntity'] is None:
|
||||||
printGettingAllEntityItemsForWhom(entityType, user, i, count)
|
printGettingAllEntityItemsForWhom(entityType, user, i, count, query=parameters['query'])
|
||||||
listResult = callGAPIpages(service, 'list', parameters['listType'],
|
listResult = callGAPIpages(service, 'list', parameters['listType'],
|
||||||
pageMessage=getPageMessageForWhom(), maxItems=parameters['maxItems'],
|
pageMessage=getPageMessageForWhom(), maxItems=parameters['maxItems'],
|
||||||
throwReasons=GAPI.GMAIL_THROW_REASONS+GAPI.GMAIL_LIST_THROW_REASONS,
|
throwReasons=GAPI.GMAIL_THROW_REASONS+GAPI.GMAIL_LIST_THROW_REASONS,
|
||||||
@@ -72948,7 +72957,7 @@ def _processMessagesThreads(users, entityType):
|
|||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
if parameters['messageEntity'] is None:
|
if parameters['messageEntity'] is None:
|
||||||
printGettingAllEntityItemsForWhom(Ent.MESSAGE, user, i, count)
|
printGettingAllEntityItemsForWhom(Ent.MESSAGE, user, i, count, query=parameters['query'])
|
||||||
listResult = callGAPIpages(service, 'list', parameters['listType'],
|
listResult = callGAPIpages(service, 'list', parameters['listType'],
|
||||||
pageMessage=getPageMessageForWhom(), maxItems=parameters['maxItems'],
|
pageMessage=getPageMessageForWhom(), maxItems=parameters['maxItems'],
|
||||||
throwReasons=GAPI.GMAIL_THROW_REASONS+GAPI.GMAIL_LIST_THROW_REASONS,
|
throwReasons=GAPI.GMAIL_THROW_REASONS+GAPI.GMAIL_LIST_THROW_REASONS,
|
||||||
@@ -73087,7 +73096,7 @@ def exportMessagesThreads(users, entityType):
|
|||||||
service = gmail.users().messages() if entityType == Ent.MESSAGE else gmail.users().threads()
|
service = gmail.users().messages() if entityType == Ent.MESSAGE else gmail.users().threads()
|
||||||
try:
|
try:
|
||||||
if parameters['messageEntity'] is None:
|
if parameters['messageEntity'] is None:
|
||||||
printGettingAllEntityItemsForWhom(entityType, user, i, count)
|
printGettingAllEntityItemsForWhom(entityType, user, i, count, query=parameters['query'])
|
||||||
listResult = callGAPIpages(service, 'list', parameters['listType'],
|
listResult = callGAPIpages(service, 'list', parameters['listType'],
|
||||||
pageMessage=getPageMessageForWhom(), maxItems=parameters['maxItems'],
|
pageMessage=getPageMessageForWhom(), maxItems=parameters['maxItems'],
|
||||||
throwReasons=GAPI.GMAIL_THROW_REASONS+GAPI.GMAIL_LIST_THROW_REASONS,
|
throwReasons=GAPI.GMAIL_THROW_REASONS+GAPI.GMAIL_LIST_THROW_REASONS,
|
||||||
@@ -73223,7 +73232,7 @@ def forwardMessagesThreads(users, entityType):
|
|||||||
service = gmail.users().messages() if entityType == Ent.MESSAGE else gmail.users().threads()
|
service = gmail.users().messages() if entityType == Ent.MESSAGE else gmail.users().threads()
|
||||||
if parameters['messageEntity'] is None:
|
if parameters['messageEntity'] is None:
|
||||||
try:
|
try:
|
||||||
printGettingAllEntityItemsForWhom(entityType, user, i, count)
|
printGettingAllEntityItemsForWhom(entityType, user, i, count, query=parameters['query'])
|
||||||
listResult = callGAPIpages(service, 'list', parameters['listType'],
|
listResult = callGAPIpages(service, 'list', parameters['listType'],
|
||||||
pageMessage=getPageMessageForWhom(), maxItems=parameters['maxItems'],
|
pageMessage=getPageMessageForWhom(), maxItems=parameters['maxItems'],
|
||||||
throwReasons=GAPI.GMAIL_THROW_REASONS+GAPI.GMAIL_LIST_THROW_REASONS,
|
throwReasons=GAPI.GMAIL_THROW_REASONS+GAPI.GMAIL_LIST_THROW_REASONS,
|
||||||
@@ -74331,7 +74340,7 @@ def printShowMessagesThreads(users, entityType):
|
|||||||
os.makedirs(targetFolder)
|
os.makedirs(targetFolder)
|
||||||
try:
|
try:
|
||||||
if parameters['messageEntity'] is None:
|
if parameters['messageEntity'] is None:
|
||||||
printGettingAllEntityItemsForWhom(entityType, user, i, count)
|
printGettingAllEntityItemsForWhom(entityType, user, i, count, query=parameters['query'])
|
||||||
listResult = callGAPIpages(service, 'list', parameters['listType'],
|
listResult = callGAPIpages(service, 'list', parameters['listType'],
|
||||||
pageMessage=getPageMessageForWhom(), maxItems=parameters['maxItems'],
|
pageMessage=getPageMessageForWhom(), maxItems=parameters['maxItems'],
|
||||||
throwReasons=GAPI.GMAIL_THROW_REASONS+GAPI.GMAIL_LIST_THROW_REASONS,
|
throwReasons=GAPI.GMAIL_THROW_REASONS+GAPI.GMAIL_LIST_THROW_REASONS,
|
||||||
|
|||||||
Reference in New Issue
Block a user