VULN_CHECK_I913V6 /i|dZddlmZddlmZejrddlmZGddZdZdZd Z d Z d Z d Z y )ai Classes and functions for the output of reference policy modules. This module takes a refpolicy.Module object and formats it for output using the ModuleWriter object. By separating the output in this way the other parts of Madison can focus solely on generating policy. This keeps the semantic / syntactic issues cleanly separated from the formatting issues. ) refpolicy)util)cmpceZdZdZdZdZy) ModuleWritercJd|_d|_d|_d|_d|_y)NTF)fdmodulesortrequiresgen_cil)selfs 4/usr/lib/python3.12/site-packages/sepolgen/output.py__init__zModuleWriter.__init__&s%    c||_|jrt|jtj|jdD]=\}}|j |j |jdt|z?y)NT) showdepthz%s ) r r sort_filterrwalktree set_gen_cilr writestr)rr r nodedepths rrzModuleWriter.write-se 99  $%--dkkTJKD%   T\\ * HHVc$i' (Krc||_yN)r )rr s rrzModuleWriter.set_gen_cil8s  rN)__name__ __module__ __qualname__rrrrrrr%s )rrcJtj|}|jtj|}|jt|t|k7rt |d|dSt ||D]!}|d|dk7st |d|dcSy)Nr)r set_to_listr lenrzip)xyxlylvs r id_set_cmpr+Bs  ! BGGI  ! BGGI 2w#b'2a5"Q%  R[ Q41Q4<qtQqT? " rct|j|j}|dk7r|St|j|j}|dk7r|St|j|j}|dk7r|SyNr")r+ src_types tgt_types obj_classes)abrets r avrule_cmpr4Psg Q[[!++ .C ax Q[[!++ .C ax Q]]AMM 2C ax  rc|jd|jdk7r&t|jd|jdSt|j|jSr-)argsrifnamer1r2s r ifcall_cmpr9_sLvvayAFF1I166!9affQi(( qxx ""rct|tjrJt|tjr t||St |j dg|j St|tjst|tjr t||St |j |j dgSr-) isinstancer InterfaceCallr9r+r6r.AVRule AVExtRuler4r8s rrule_cmpr?es!Y,,- a00 1a# #qvvayk1;;7 7 a)) *jI.sort_nodews ++-C HHSM HHY&&( ). }}G HHW ' ""$%  T\\^$ T__&' T))+, tx0 1 D$ 7 78IIaLJJt~~.ax$$Y%6%6%89#++- $$%F%LM  )   T "  4??$% T__]34 s8'')G MM !E F HHW   ]]EA~# rN)nodes)r r\rs rrrts!;z $rN) __doc__rrPY3rrr+r4r9r?rBrr rrrasE(88:    # 8Ar