gI dZddlZddlmZddlmZddlmZddlm Z ddl m Z dd l m Z mZmZd Zdaed ZdS) a, Config for wizard is not like all other our configs, it can be read and modified in multiple processes at the same time, so we should handle that situations correctly. Thus, we must set up exclusive locks for reading and writing and use contextmanager to load config on start and save right after leaving scope and in case of any errors. You can use config like this: with config.acquire_config_access() as config: options = config.get_options(module) or with config.acquire_config_access() as config: options = config.set_state(module, 'failed') N)contextmanager)Optional)Config)MODULES_STATUS_FILE_LOCK)UnableAcquireLockError)BaseConfigError NoSuchModuleMalformedConfigError)r r r acquire_config_accessc#Kt tVdS ttdd}n7#ttf$r#}t t ||d}~wwxYwtj|tj  tatV tdupt datj|tj dS#datj|tj wxYw# tdupt datj|tj w#datj|tj wxYwxYw)Nwzutf-8)encoding) error_message) _configopenrIOErrorOSErrorrstrfcntlflockLOCK_EXrsaveLOCK_UN) lock_filees O/opt/cloudlinux/venv/lib64/python3.11/site-packages/clwizard/config/__init__.pyr r Fs^ B13III W BBB$3q66:::AB K 5=))) 2((  2 tO -w||~~G K 5= 1 1 1 1 1G K 5= 1 1 1 1  2 tO -w||~~G K 5= 1 1 1 1G K 5= 1 1 1 1sD.A"AA"D"C""#DE4 "E,"E4#E11E4)__doc__r contextlibrtypingrclwizard.config.configrclwizard.constantsrclwizard.config.exceptionsr exceptionsr r r __all__rr rr(s  %%%%%%))))))777777======  8 22222r'