ó
4®Þ]c           @   sI   d  d l  Z  d  d l Z e  j Z e  j Z d „  Z d „  Z d „  Z d S(   iÿÿÿÿNc         C   s<   |  j  ƒ  t j j d | ƒ t j j ƒ  t j d ƒ d  S(   Ns   
%s
i   (   t
   print_helpt   syst   stderrt   writet   flusht   exit(   t   parsert   msg(    (    s:   /usr/lib64/python2.7/site-packages/sepolicy/communicate.pyt   usage   s    
c         C   s8   y t  t j |  ƒ d d SWn t k
 r3 |  g SXd  S(   Ni    t   types(   t   infot   sepolicyt	   ATTRIBUTEt   RuntimeError(   t	   attribute(    (    s:   /usr/lib64/python2.7/site-packages/sepolicy/communicate.pyt   expand_attribute%   s    c         C   sÏ   t  t j g i |  t j 6| t j 6| t j 6ƒ } | s[ t d |  d j | ƒ f ƒ ‚ n  g  } xg g  g  | D]( } t | ƒ j	 | t j ƒ rn | ^ qn D] } | t j
 ^ qš D] } | t | ƒ } q± W| S(   Ns*   The %s type is not allowed to %s any typest   ,(   t   searchR   t   ALLOWt   SOURCEt   CLASSt   PERMSt
   ValueErrort   joint   sett   issubsett   TARGETR   (   t   srct   tclasst   permt   allowst   tlistt   xt   yt   l(    (    s:   /usr/lib64/python2.7/site-packages/sepolicy/communicate.pyt	   get_types,   s    3"V(   R   R   R   R
   R   R   R#   (    (    (    s:   /usr/lib64/python2.7/site-packages/sepolicy/communicate.pyt   <module>   s   				