1
0
mirror of https://github.com/altlinux/gpupdate.git synced 2025-03-22 02:50:32 +03:00

Added check for file existence and log for application warnings.

This commit is contained in:
Данила Скачедубов 2023-11-27 18:31:43 +04:00 committed by Valery Sinelnikov
parent b8dc00443f
commit 9fb411c2e2
3 changed files with 11 additions and 1 deletions

View File

@ -141,6 +141,11 @@ def apply(all_kde_settings, locks_dict, username = None):
file.write('\n')
else:
for file_name, sections in all_kde_settings.items():
path = f'{get_homedir(username)}/.config/{file_name}'
if not os.path.exists(path):
open(path, 'a').close()
else:
pass
for section, keys in sections.items():
for key, value in keys.items():
lock = f"{file_name}.{section}.{key}"
@ -167,7 +172,7 @@ def apply(all_kde_settings, locks_dict, username = None):
subprocess.run(command, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
except:
logdata['command'] = command
log('E68', logdata)
log('W22', logdata)
new_content = []
file_path = f'{get_homedir(username)}/.config/{file_name}'
try:

View File

@ -904,6 +904,9 @@ msgstr "Ошибка при подключении к серверу"
msgid "Wallpaper configuration file not found"
msgstr "Конфигурационный файл для обоев не найден"
msgid "The user setting was not installed, conflict with computer setting."
msgstr "Пользовательская настройка не была установлена, конфликт с настройкой компьютера."
# Fatal
msgid "Unable to refresh GPO list"
msgstr "Невозможно обновить список объектов групповых политик"

View File

@ -341,6 +341,8 @@ def warning_code(code):
warning_ids[19] = 'Failed to change KDE configuration file'
warning_ids[20] = 'Error connecting to server'
warning_ids[21] = 'Wallpaper configuration file not found'
warning_ids[22] = 'The user setting was not installed, conflict with computer setting.'
return warning_ids.get(code, 'Unknown warning code')