mirror of
https://github.com/GAM-team/GAM.git
synced 2026-06-28 09:51:36 +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:
@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
|
||||
"""
|
||||
|
||||
__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)'
|
||||
|
||||
#pylint: disable=wrong-import-position
|
||||
@@ -72632,7 +72632,12 @@ LABEL_QUERY_REPLACEMENT_CHARACTERS = ' &()"|{}/'
|
||||
|
||||
def _getMessageSelectParameters(myarg, parameters):
|
||||
if myarg == 'query':
|
||||
parameters['query'] += f' ({getString(Cmd.OB_QUERY)})'
|
||||
if parameters['query']:
|
||||
if parameters['labelGroupOpen']:
|
||||
parameters['query'] += ')'
|
||||
parameters['labelGroupOpen'] = False
|
||||
parameters['query'] += ' '
|
||||
parameters['query'] += f'({getString(Cmd.OB_QUERY)})'
|
||||
elif myarg.startswith('querytime'):
|
||||
parameters['queryTimes'][myarg] = getDateOrDeltaFromNow().replace('-', '/')
|
||||
elif myarg == 'matchlabel':
|
||||
@@ -72641,17 +72646,21 @@ def _getMessageSelectParameters(myarg, parameters):
|
||||
for c in labelTemp:
|
||||
labelName += c if c not in LABEL_QUERY_REPLACEMENT_CHARACTERS else '-'
|
||||
if not parameters['labelGroupOpen']:
|
||||
if parameters['query']:
|
||||
parameters['query'] += ' '
|
||||
parameters['query'] += '('
|
||||
parameters['labelGroupOpen'] = True
|
||||
parameters['query'] += f' label:{labelName}'
|
||||
else:
|
||||
parameters['query'] += ' '
|
||||
parameters['query'] += f'label:{labelName}'
|
||||
elif myarg in {'or', 'and'}:
|
||||
parameters['prevLabelOp'] = parameters['currLabelOp']
|
||||
parameters['currLabelOp'] = myarg
|
||||
if parameters['labelGroupOpen'] and parameters['currLabelOp'] != parameters['prevLabelOp']:
|
||||
parameters['query'] += ')'
|
||||
parameters['labelGroupOpen'] = False
|
||||
if parameters['currLabelOp'] == 'or':
|
||||
parameters['query'] += ' OR '
|
||||
if parameters['currLabelOp'] == 'or' and parameters['query']:
|
||||
parameters['query'] += ' OR'
|
||||
elif myarg == 'labelmatchpattern':
|
||||
parameters['labelMatchPattern'] = getREPattern(re.IGNORECASE)
|
||||
elif myarg == 'sendermatchpattern':
|
||||
@@ -72755,7 +72764,7 @@ def archiveMessages(users):
|
||||
service = gmail.users().messages()
|
||||
try:
|
||||
if parameters['messageEntity'] is None:
|
||||
printGettingAllEntityItemsForWhom(entityType, user, i, count)
|
||||
printGettingAllEntityItemsForWhom(entityType, user, i, count, query=parameters['query'])
|
||||
listResult = callGAPIpages(service, 'list', parameters['listType'],
|
||||
pageMessage=getPageMessageForWhom(), maxItems=parameters['maxItems'],
|
||||
throwReasons=GAPI.GMAIL_THROW_REASONS+GAPI.GMAIL_LIST_THROW_REASONS,
|
||||
@@ -72948,7 +72957,7 @@ def _processMessagesThreads(users, entityType):
|
||||
continue
|
||||
try:
|
||||
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'],
|
||||
pageMessage=getPageMessageForWhom(), maxItems=parameters['maxItems'],
|
||||
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()
|
||||
try:
|
||||
if parameters['messageEntity'] is None:
|
||||
printGettingAllEntityItemsForWhom(entityType, user, i, count)
|
||||
printGettingAllEntityItemsForWhom(entityType, user, i, count, query=parameters['query'])
|
||||
listResult = callGAPIpages(service, 'list', parameters['listType'],
|
||||
pageMessage=getPageMessageForWhom(), maxItems=parameters['maxItems'],
|
||||
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()
|
||||
if parameters['messageEntity'] is None:
|
||||
try:
|
||||
printGettingAllEntityItemsForWhom(entityType, user, i, count)
|
||||
printGettingAllEntityItemsForWhom(entityType, user, i, count, query=parameters['query'])
|
||||
listResult = callGAPIpages(service, 'list', parameters['listType'],
|
||||
pageMessage=getPageMessageForWhom(), maxItems=parameters['maxItems'],
|
||||
throwReasons=GAPI.GMAIL_THROW_REASONS+GAPI.GMAIL_LIST_THROW_REASONS,
|
||||
@@ -74331,7 +74340,7 @@ def printShowMessagesThreads(users, entityType):
|
||||
os.makedirs(targetFolder)
|
||||
try:
|
||||
if parameters['messageEntity'] is None:
|
||||
printGettingAllEntityItemsForWhom(entityType, user, i, count)
|
||||
printGettingAllEntityItemsForWhom(entityType, user, i, count, query=parameters['query'])
|
||||
listResult = callGAPIpages(service, 'list', parameters['listType'],
|
||||
pageMessage=getPageMessageForWhom(), maxItems=parameters['maxItems'],
|
||||
throwReasons=GAPI.GMAIL_THROW_REASONS+GAPI.GMAIL_LIST_THROW_REASONS,
|
||||
|
||||
Reference in New Issue
Block a user