
    ciK                         d Z ddlZddlmZ g dZh dZdZedd	ej                  e   d
e	ddfdZ
 G d dej                        Zy)z'Rendering formatter parameter handling.    N   )base)
FORMATTERSverify_formatter	Formatter>   gdcorexlibcairogdwbmpgdiplusF)required	formatterr   returnc                    | |rt        d      y | j                         t        vrt        d| dt        t               d      y )Nzmissing formatterzunknown formatter: z (must be None or one of ))
ValueErrorlowerr   sorted)r   r   s     E/tmp/pip-target-z3e9_cxr/lib/python/graphviz/parameters/formatters.pyr   r      s[    011 		*	,.ym4VJ5G4HK L 	L 
-    c                        e Zd ZdZdZ ee      Zdddej                  e
   ddf fdZ fdZedej                  e
   fd       Zej                  dej                  e
   ddfd	       Z xZS )
r   z(Rendering engine parameter (no default).N)r   r   r   c                2    t        |   di | || _        y )N )super__init__r   )selfr   kwargs	__class__s      r   r   zFormatter.__init__$   s    "6""r   c                 R    | j                  d      }|||d<   t        |   di |S )z3Return the kwargs to create a copy of the instance.
_formatterr   r   )_getattr_from_dictr   _copy_kwargs)r   r   r   r   s      r   r#   zFormatter._copy_kwargs)   s6    ++L9	 "+F;w#-f--r   c                     | j                   S )zQThe output formatter used for rendering
            (``'cairo'``, ``'gd'``, ...).)r!   )r   s    r   r   zFormatter.formatter0   s     r   c                     || j                   j                  dd        y |j                         }| j                  |       || _        y )Nr!   )__dict__popr   _verify_formatterr!   )r   r   s     r   r   zFormatter.formatter6   s=    MMlD1!)I""9-'DOr   )__name__
__module____qualname____doc__r!   staticmethodr   r(   typingOptionalstrr   r#   propertyr   setter__classcell__)r   s   @r   r   r      s    2J$%56<@ #V__S%9 #t #
. 6??3/  
 (6??3#7 (D ( (r   r   )r,   r.    r   __all__r   REQUIREDr/   r0   boolr   ParameterBaser   r   r   r   <module>r9      sa    -  
9
  '/L 4 L#L37L (""  (r   