diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 00000000..697640df Binary files /dev/null and b/.DS_Store differ diff --git a/src/.DS_Store b/src/.DS_Store index b4eac817..36a97f44 100644 Binary files a/src/.DS_Store and b/src/.DS_Store differ diff --git a/src/gam/cmd/chromepolicies.py b/src/gam/cmd/chromepolicies.py index 3cf9ab2a..20499490 100644 --- a/src/gam/cmd/chromepolicies.py +++ b/src/gam/cmd/chromepolicies.py @@ -646,7 +646,7 @@ def doUpdateChromePolicy(): elif vtype == 'TYPE_LIST': value = value.split(',') if value else [] elif vtype == 'TYPE_STRING' and convertCRsNLs: - value = _getMain().unescapeCRsNLs(value) + value = _getMain().un_getMain().escapeCRsNLs(value) if myarg == 'chrome.users.chromebrowserupdates' and casedField == 'targetVersionPrefixSetting': mg = CHROME_TARGET_VERSION_CHANNEL_MINUS_PATTERN.match(value) if mg: diff --git a/src/gam/cmd/cros.py b/src/gam/cmd/cros.py index 186a1840..097b36b4 100644 --- a/src/gam/cmd/cros.py +++ b/src/gam/cmd/cros.py @@ -1103,7 +1103,7 @@ def doPrintCrOSDevices(entityList=None): csvPF.WriteRowNoFilter(row) return if 'notes' in cros: - cros['notes'] = escapeCRsNLs(cros['notes']) + cros['notes'] = _getMain().escapeCRsNLs(cros['notes']) if addCSVData: cros.update(addCSVData) for cpuStatusReport in cros.get('cpuStatusReports', []): diff --git a/src/gam/cmd/gmail/messages.py b/src/gam/cmd/gmail/messages.py index d3c4d430..5f244d94 100644 --- a/src/gam/cmd/gmail/messages.py +++ b/src/gam/cmd/gmail/messages.py @@ -1419,7 +1419,7 @@ def printShowMessagesThreads(users, entityType): if not convertCRNL: row['Body'] = _getMessageBody(result['payload']) else: - row['Body'] = escapeCRsNLs(_getMessageBody(result['payload'])) + row['Body'] = _getMain().escapeCRsNLs(_getMessageBody(result['payload'])) if show_attachments: attachments = [] _getAttachments(result['id'], result['payload'], attachmentNamePattern, attachments) diff --git a/src/gam/cmd/gmail/settings.py b/src/gam/cmd/gmail/settings.py index 93bd6c9c..b0e71800 100644 --- a/src/gam/cmd/gmail/settings.py +++ b/src/gam/cmd/gmail/settings.py @@ -465,7 +465,7 @@ SMTPMSA_DISPLAY_FIELDS = ['host', 'port', 'securityMode'] def _showSendAs(result, j, jcount, sigReplyFormat, verifyOnly=False): if sigReplyFormat == SIG_REPLY_TEMPLATE: - _getMain().writeStdout(f"{escapeCRsNLs(result.get('signature', 'None'))}\n") + _getMain().writeStdout(f"{_getMain().escapeCRsNLs(result.get('signature', 'None'))}\n") return if result['displayName']: _getMain().printEntity([Ent.SENDAS_ADDRESS, f'{result["displayName"]} <{result["sendAsEmail"]}>'], j, jcount) diff --git a/src/gam/cmd/gmail/signature.py b/src/gam/cmd/gmail/signature.py index 13c5c287..b1d460e0 100644 --- a/src/gam/cmd/gmail/signature.py +++ b/src/gam/cmd/gmail/signature.py @@ -116,9 +116,9 @@ def _showVacation(user, i, count, result, showDisabled, sigReplyFormat): Ind.Decrement() else: # SIG_REPLY_COMPACT if result.get('responseBodyPlainText'): - _getMain().printKeyValueList(['Message', escapeCRsNLs(result['responseBodyPlainText'])]) + _getMain().printKeyValueList(['Message', _getMain().escapeCRsNLs(result['responseBodyPlainText'])]) elif result.get('responseBodyHtml'): - _getMain().printKeyValueList(['Message', escapeCRsNLs(result['responseBodyHtml'])]) + _getMain().printKeyValueList(['Message', _getMain().escapeCRsNLs(result['responseBodyHtml'])]) else: _getMain().printKeyValueList(['Message', 'None']) Ind.Decrement() @@ -222,11 +222,11 @@ def printShowVacation(users): row['subject'] = result.get('responseSubject', 'None') if result.get('responseBodyPlainText'): row['html'] = False - row['message'] = escapeCRsNLs(result['responseBodyPlainText']) + row['message'] = _getMain().escapeCRsNLs(result['responseBodyPlainText']) elif result.get('responseBodyHtml'): row['html'] = True if sigReplyFormat == SIG_REPLY_HTML: - row['message'] = escapeCRsNLs(result['responseBodyHtml']) + row['message'] = _getMain().escapeCRsNLs(result['responseBodyHtml']) else: row['message'] = result['responseBodyHtml'].replace('\r', '').replace('\n', '') else: diff --git a/src/gam/cmd/notes.py b/src/gam/cmd/notes.py index ba8b4edf..fefa5924 100644 --- a/src/gam/cmd/notes.py +++ b/src/gam/cmd/notes.py @@ -139,7 +139,7 @@ def _showNote(note, j=0, jcount=0, FJQC=None, compact=False): _getMain().printKeyValueList([Ind.MultiLineText(body['text']['text'])]) Ind.Decrement() else: - _getMain().printKeyValueList(['text', escapeCRsNLs(body['text']['text'])]) + _getMain().printKeyValueList(['text', _getMain().escapeCRsNLs(body['text']['text'])]) elif 'list' in body and 'listItems' in body['list']: _showNoteListItems(body['list']['listItems']) Ind.Decrement() @@ -153,7 +153,7 @@ def createNote(users): def fixTextItem(item): if 'text' in item: if item['text']: - item['text'] = unescapeCRsNLs(item['text']) + item['text'] = un_getMain().escapeCRsNLs(item['text']) return if missingTextValue: item['text'] = missingTextValue diff --git a/src/gam/cmd/reports.py b/src/gam/cmd/reports.py index c54ae127..b56babfd 100644 --- a/src/gam/cmd/reports.py +++ b/src/gam/cmd/reports.py @@ -778,7 +778,7 @@ def doReport(): if noAuthorizedApps: continue for app in item['msgValue']: - appName = f'App: {escapeCRsNLs(app["client_name"])}' + appName = f'App: {_getMain().escapeCRsNLs(app["client_name"])}' for key in ['num_users', 'client_id']: title = f'{appName}{GC.Values[GC.CSV_OUTPUT_SUBFIELD_DELIMITER]}{key}' csvPF.AddTitles(title) @@ -851,7 +851,7 @@ def doReport(): app.update(addCSVData) for an_item in subitem: if an_item == 'client_name': - app['name'] = f'App: {escapeCRsNLs(subitem[an_item])}' + app['name'] = f'App: {_getMain().escapeCRsNLs(subitem[an_item])}' elif an_item == 'num_users': app['value'] = f'{subitem[an_item]} users' elif an_item == 'client_id': diff --git a/src/gam/util/config.py b/src/gam/util/config.py index ec72053b..cdccbe78 100644 --- a/src/gam/util/config.py +++ b/src/gam/util/config.py @@ -19,7 +19,8 @@ import time import httplib2 import arrow -from gamlib import glaction as Act +from gamlib import glaction +Act = glaction.GamAction() from gamlib import glapi as API from gamlib import glcfg as GC from gamlib import glentity as Ent