mirror of
https://github.com/altlinux/gpupdate.git
synced 2025-03-21 18:50:38 +03:00
Merge remote-tracking branch 'github/kde_applier'
This commit is contained in:
commit
ed42f3cf6a
@ -138,7 +138,8 @@ def apply(all_kde_settings, locks_dict, username = None):
|
||||
for section, keys in sections.items():
|
||||
file.write(f'[{section}]\n')
|
||||
for key, value in keys.items():
|
||||
if key in locks_dict and locks_dict[key] == '1':
|
||||
lock = f"{file_name};{section};{key}"
|
||||
if lock in locks_dict and locks_dict[lock] == '1':
|
||||
file.write(f'{key}[$i]={value}\n')
|
||||
else:
|
||||
file.write(f'{key}={value}\n')
|
||||
@ -147,7 +148,8 @@ def apply(all_kde_settings, locks_dict, username = None):
|
||||
for file_name, sections in all_kde_settings.items():
|
||||
for section, keys in sections.items():
|
||||
for key, value in keys.items():
|
||||
if key in locks_dict and locks_dict[key] == '1':
|
||||
lock = f"{file_name};{section};{key}"
|
||||
if lock in locks_dict and locks_dict[lock] == '1':
|
||||
command = [
|
||||
'kwriteconfig5',
|
||||
'--file', file_name,
|
||||
@ -170,7 +172,7 @@ def apply(all_kde_settings, locks_dict, username = None):
|
||||
except Exception as exc:
|
||||
clear_locks_settings(username, file_name, key)
|
||||
try:
|
||||
subprocess.run(command, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
subprocess.run(command, check=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
except Exception as exc:
|
||||
logdata = dict()
|
||||
logdata['command'] = command
|
||||
@ -201,7 +203,7 @@ def clear_locks_settings(username, file_name, key):
|
||||
for line in lines:
|
||||
if f'{key}[$i]=' in line:
|
||||
logdata = dict()
|
||||
logdata['line'] = line.strip()
|
||||
logdata['line'] = line.strip()
|
||||
log('I10', logdata)
|
||||
|
||||
def apply_for_widget(value, data):
|
||||
|
Loading…
x
Reference in New Issue
Block a user