mirror of
https://github.com/altlinux/gpupdate.git
synced 2025-03-21 18:50:38 +03:00
Added logs with translation for firefox_applier
This commit is contained in:
parent
17d35b8f4d
commit
431b18e177
@ -34,7 +34,7 @@ from .applier_frontend import (
|
||||
applier_frontend
|
||||
, check_enabled
|
||||
)
|
||||
from util.logging import slogm
|
||||
from util.logging import slogm, log
|
||||
from util.util import is_machine_name
|
||||
|
||||
class firefox_applier(applier_frontend):
|
||||
@ -98,7 +98,10 @@ class firefox_applier(applier_frontend):
|
||||
'''
|
||||
if obj:
|
||||
self.policies[name] = obj
|
||||
logging.info(slogm('Firefox policy \'{}\' set to {}'.format(name, obj)))
|
||||
logdata = dict()
|
||||
logdata['name'] = name
|
||||
logdata['set to'] = obj
|
||||
log('I7', logdata)
|
||||
|
||||
def get_home_page(self):
|
||||
'''
|
||||
@ -136,7 +139,10 @@ class firefox_applier(applier_frontend):
|
||||
obj = self.get_boolean_config(name)
|
||||
if obj is not None:
|
||||
self.policies[name] = obj
|
||||
logging.info(slogm('Firefox policy \'{}\' set to {}'.format(name, obj)))
|
||||
logdata = dict()
|
||||
logdata['name'] = name
|
||||
logdata['set to'] = obj
|
||||
log('I7', logdata)
|
||||
|
||||
def machine_apply(self):
|
||||
'''
|
||||
@ -183,27 +189,34 @@ class firefox_applier(applier_frontend):
|
||||
os.makedirs(self.__firefox_installdir1, exist_ok=True)
|
||||
with open(destfile, 'w') as f:
|
||||
json.dump(self.policies_json, f)
|
||||
logging.debug(slogm('Wrote Firefox preferences to {}'.format(destfile)))
|
||||
logdata = dict()
|
||||
logdata['destfile'] = destfile
|
||||
log('D91', logdata)
|
||||
|
||||
destfile = os.path.join(self.__firefox_installdir2, 'policies.json')
|
||||
os.makedirs(self.__firefox_installdir2, exist_ok=True)
|
||||
with open(destfile, 'w') as f:
|
||||
json.dump(self.policies_json, f)
|
||||
logging.debug(slogm('Wrote Firefox preferences to {}'.format(destfile)))
|
||||
logdata = dict()
|
||||
logdata['destfile'] = destfile
|
||||
log('D91', logdata)
|
||||
|
||||
def user_apply(self):
|
||||
profiles = self.get_profiles()
|
||||
|
||||
profiledir = os.path.join(util.get_homedir(self.username), self.__user_settings_dir)
|
||||
for profile in profiles:
|
||||
logging.debug(slogm('Found Firefox profile in {}/{}'.format(profiledir, profile)))
|
||||
logdata = dict()
|
||||
logdata['profiledir'] = profiledir
|
||||
logdata['profile'] = profile
|
||||
log('D92', logdata)
|
||||
|
||||
def apply(self):
|
||||
if self.__module_enabled:
|
||||
logging.debug(slogm('Running Firefox applier for machine'))
|
||||
log('D93')
|
||||
self.machine_apply()
|
||||
else:
|
||||
logging.debug(slogm('Firefox applier for machine will not be started'))
|
||||
log('D94')
|
||||
#if not self._is_machine_name:
|
||||
# logging.debug('Running user applier for Firefox')
|
||||
# self.user_apply()
|
||||
|
@ -53,6 +53,9 @@ msgstr "Невозможно создать оъект для unit systemd"
|
||||
msgid "Starting systemd unit"
|
||||
msgstr "Запуск unit systemd"
|
||||
|
||||
msgid "Firefox policy"
|
||||
msgstr "Политика Firefox"
|
||||
|
||||
# Error
|
||||
msgid "Insufficient permissions to run gpupdate"
|
||||
msgstr "Недостаточно прав для запуска gpupdate"
|
||||
@ -423,6 +426,17 @@ msgstr "Путь не разрешен"
|
||||
msgid "Getting cached file for URI"
|
||||
msgstr "Получение кешированного файла для URI"
|
||||
|
||||
msgid "Wrote Firefox preferences to"
|
||||
msgstr "Настройки Firefox записаны в"
|
||||
|
||||
msgid "Found Firefox profile in"
|
||||
msgstr "Найден профиль Firefox в"
|
||||
|
||||
msgid "Running Firefox applier for machine"
|
||||
msgstr "Запуск применение настроек Firefox для машины"
|
||||
|
||||
msgid "Firefox applier for machine will not be started"
|
||||
msgstr "Применение настроек Firefox для компьютера не запускается"
|
||||
|
||||
# Debug_end
|
||||
|
||||
|
@ -27,6 +27,7 @@ def info_code(code):
|
||||
info_ids[4] = 'Working with systemd'
|
||||
info_ids[5] = 'Unable to work with systemd unit'
|
||||
info_ids[6] = 'Starting systemd unit'
|
||||
info_ids[7] = 'Firefox policy'
|
||||
|
||||
return info_ids.get(code, 'Unknown info code')
|
||||
|
||||
@ -177,7 +178,11 @@ def debug_code(code):
|
||||
debug_ids[88] = 'GSettings applier for user in user context will not be started'
|
||||
debug_ids[89] = 'Applying machine setting'
|
||||
debug_ids[90] = 'Getting cached file for URI'
|
||||
|
||||
debug_ids[91] = 'Wrote Firefox preferences to'
|
||||
debug_ids[92] = 'Found Firefox profile in'
|
||||
debug_ids[93] = 'Running Firefox applier for machine'
|
||||
debug_ids[94] = 'Firefox applier for machine will not be started'
|
||||
|
||||
return debug_ids.get(code, 'Unknown debug code')
|
||||
|
||||
def warning_code(code):
|
||||
|
Loading…
x
Reference in New Issue
Block a user