1
0
mirror of https://github.com/altlinux/gpupdate.git synced 2025-03-21 18:50:38 +03:00

Added logs with translation for cups_applier

This commit is contained in:
Valery Sinelnikov 2021-10-06 16:34:12 +04:00
parent 382a3e2bd2
commit cab3811627
3 changed files with 30 additions and 9 deletions

View File

@ -28,7 +28,7 @@ from .applier_frontend import (
)
from gpt.printers import json2printer
from util.rpm import is_rpm_installed
from util.logging import slogm
from util.logging import slogm, log
def storage_get_printers(storage, sid):
'''
@ -79,7 +79,7 @@ class cups_applier(applier_frontend):
def run(self):
if not is_rpm_installed('cups'):
logging.warning(slogm('CUPS is not installed: no printer settings will be deployed'))
log('W9')
return
self.cups_connection = cups.Connection()
@ -94,10 +94,10 @@ class cups_applier(applier_frontend):
Perform configuration of printer which is assigned to computer.
'''
if self.__module_enabled:
logging.debug(slogm('Running CUPS applier for machine'))
log('D113')
self.run()
else:
logging.debug(slogm('CUPS applier for machine will not be started'))
log('D114')
class cups_applier_user(applier_frontend):
__module_name = 'CUPSApplierUser'
@ -123,7 +123,7 @@ class cups_applier_user(applier_frontend):
def run(self):
if not is_rpm_installed('cups'):
logging.warning(slogm('CUPS is not installed: no printer settings will be deployed'))
log('W9')
return
self.cups_connection = cups.Connection()
@ -138,8 +138,8 @@ class cups_applier_user(applier_frontend):
Perform printer configuration assigned for user.
'''
if self.__module_enabled:
logging.debug(slogm('Running CUPS applier for user in administrator context'))
log('D115')
self.run()
else:
logging.debug(slogm('CUPS applier for user in administrator context will not be started'))
log('D116')

View File

@ -436,7 +436,7 @@ msgid "GSettings applier for user in user context will not be started"
msgstr "GSettings в контексте пользователя не запускается"
msgid "Applying machine setting"
msgstr "Применение настройки машины"
msgstr "Применение настроек машины"
msgid "Path not resolved as UNC URI"
msgstr "Путь не разрешен"
@ -510,6 +510,18 @@ msgstr "Запуск применение папок в контексте по
msgid "Folder applier for user in user context will not be started"
msgstr "Применение папок в контексте пользователя не запускается"
msgid "Running CUPS applier for machine"
msgstr "Запуск применение настроек CUPS для машины"
msgid "CUPS applier for machine will not be started"
msgstr "Применение настроек CUPS для машины не запускается"
msgid "Running CUPS applier for user in administrator context"
msgstr "Запуск применение настроек CUPS в контексте пользователя"
msgid "CUPS applier for user in administrator context will not be started"
msgstr "Применение настроек CUPS в контексте пользователя не запускается"
# Debug_end
# Warning
@ -541,6 +553,9 @@ msgstr "Для пользователя не существует домашне
msgid "User's shortcut not placed to home directory"
msgstr "Ярлык пользователя не помещен в домашний каталог"
msgid "CUPS is not installed: no printer settings will be deployed"
msgstr "CUPS не установлен: настройки принтера не будут развернуты"
# Fatal
msgid "Unable to refresh GPO list"
msgstr "Невозможно обновить список объектов групповых политик"

View File

@ -205,7 +205,11 @@ def debug_code(code):
debug_ids[109] = 'Running Folder applier for user in administrator context'
debug_ids[110] = 'Folder applier for user in administrator context will not be started'
debug_ids[111] = 'Running Folder applier for user in user context'
debug_ids[112] = 'Folder applier for user administrator context will not be started'
debug_ids[112] = 'Folder applier for user in user context will not be started'
debug_ids[113] = 'Running CUPS applier for machine'
debug_ids[114] = 'CUPS applier for machine will not be started'
debug_ids[115] = 'Running CUPS applier for user in administrator context'
debug_ids[116] = 'CUPS applier for user in administrator context will not be started'
return debug_ids.get(code, 'Unknown debug code')
@ -225,6 +229,8 @@ def warning_code(code):
warning_ids[6] = 'Unable to resolve GSettings parameter'
warning_ids[7] = 'No home directory exists for user'
warning_ids[8] = 'User\'s shortcut not placed to home directory'
warning_ids[9] = 'CUPS is not installed: no printer settings will be deployed'
return warning_ids.get(code, 'Unknown warning code')