1
0
mirror of https://github.com/altlinux/gpupdate.git synced 2025-01-27 10:03:46 +03:00

Filled the class implementation for inifiles.xml

This commit is contained in:
Valery Sinelnikov 2022-08-09 14:59:28 +04:00
parent 549315fe48
commit e50c5d7883

View File

@ -1,7 +1,7 @@
# #
# GPOA - GPO Applier for Linux # GPOA - GPO Applier for Linux
# #
# Copyright (C) 2019-2020 BaseALT Ltd. # Copyright (C) 2019-2022 BaseALT Ltd.
# #
# This program is free software: you can redistribute it and/or modify # This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -21,18 +21,32 @@ from util.xml import get_xml_root
def read_inifiles(inifiles_file): def read_inifiles(inifiles_file):
inifiles = list() inifiles = list()
for inifile in get_xml_root(inifiles_file): for ini in get_xml_root(inifiles_file):
ini_obj = inifile() prors = ini.find('Properties')
ini_obj = inifile(prors.get('path'))
ini_obj.set_section(prors.get('section', default=None))
ini_obj.set_property(prors.get('property', default=None))
ini_obj.set_value(prors.get('value', default=None))
ini_obj.set_action(prors.get('action'))
inifiles.append(ini_obj) inifiles.append(ini_obj)
return inifiles return inifiles
def merge_inifiles(storage, sid, inifile_objects, policy_name): def merge_inifiles(storage, sid, inifile_objects, policy_name):
for inifile in inifile_objects: for iniobj in inifile_objects:
pass storage.add_ini(sid, iniobj, policy_name)
def inifile(): class inifile:
def __init__(self): def __init__(self, path):
pass self.path = path
def set_section(self, section):
self.section = section
def set_property(self, property):
self.property = property
def set_value(self, value):
self.value = value
def set_action(self, action):
self.action = action