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

Added logs for the get_key_value method

This commit is contained in:
Данила Скачедубов 2024-01-16 19:06:14 +04:00 committed by Valery Sinelnikov
parent a225c9aa7f
commit 9c544adc94
3 changed files with 12 additions and 2 deletions

View File

@ -243,6 +243,9 @@ msgstr "Ошибка выполнения команды kwriteconfig5"
msgid "Error getting list of keys"
msgstr "Ошибка получения списка ключей"
msgid "Error getting key value"
msgstr "Ошибка при получении значения ключей"
# Error_end
# Debug
@ -843,6 +846,9 @@ msgstr "Команда для виджетов выполнена успешно
msgid "Getting a list of keys"
msgstr "Получение списка ключей"
msgid "Getting the key value"
msgstr "Получение значения ключа"
# Debug_end
# Warning

View File

@ -104,6 +104,7 @@ def error_code(code):
error_ids[67] = 'Error creating environment variables'
error_ids[68] = 'Error running kwriteconfig5 command'
error_ids[69] = 'Error getting list of keys'
error_ids[70] = 'Error getting key value'
return error_ids.get(code, 'Unknown error code')
def debug_code(code):
@ -312,6 +313,7 @@ def debug_code(code):
debug_ids[202] = 'Changing the configuration file'
debug_ids[203] = 'Widget command completed successfully'
debug_ids[204] = 'Getting a list of keys'
debug_ids[205] = 'Getting the key value'
return debug_ids.get(code, 'Unknown debug code')
def warning_code(code):

View File

@ -125,13 +125,15 @@ class Dconf_registry():
try:
process = subprocess.Popen(['dconf', 'read', key],
stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
logdata['key'] = key
log('D205', logdata)
output, error = process.communicate()
if not error:
key = string_to_literal_eval(string_to_literal_eval(output))
except Exception as exc:
#log
...
logdata['exc'] = exc
log('E70', logdata)
return key
@staticmethod