l#gA@ddlZddlmZddlmZGddZdS)N)Optional)atomic_rewritecreZdZdZdxZxZZdZd dZde e fdZ de e fdZ de e fd Z dS) KWConfigz Basic class for working with key-value configuration files Subclasses must define SEARCH_PATTERN and WRITE_PATTERN attributes TNc|jsJtj|j|tj|_|p|j|_||_dSN) SEARCH_PATTERNrecompileformat MULTILINE_patternDEFAULT_FILENAME _filename_name)selfnamefilenames S/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/utils/kwconfig.py__init__zKWConfig.__init__sX""""   & &t , ,bl   ":T%: returnc|jsJt|j5}|}dddn #1swxYwY||}|*|d|j|j|zdzz }n9|j|j|j||}t|j||j |S)N )allow_empty_content) WRITE_PATTERNopenrread_parser rrsubrALLOW_EMPTY_CONFIG)rvaluefcontent old_values rsetz KWConfig.sets)!!!! $. ! ! QffhhG               KK((   t)00UCCCdJ GGm''"))$*e<r7sd 0000002(2(2(2(2(2(2(2(2(2(r