fix init .gam config dir

This commit is contained in:
Jay Lee
2026-07-03 08:45:29 -04:00
parent 8a89a91414
commit 5ad28c053b
10 changed files with 14 additions and 13 deletions

BIN
src/.DS_Store vendored

Binary file not shown.

View File

@@ -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:

View File

@@ -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', []):

View File

@@ -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)

View File

@@ -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)

View File

@@ -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:

View File

@@ -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

View File

@@ -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':

View File

@@ -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