§
    £”j¯%  ã                   ó
  — d Z dZd                     ¦   «         Zg d¢ZdZd„ Zd„ Zd„ Zd„ Z	d	„ Z
eeee	e
d
œZ G d„ d¦  «        Z G d„ d¦  «        Z	 dad„ Zd„ Zd„ ZddlmZ  ee¦  «         [d„ Zedk    r e¦   «          dS dS )z3.3.0zHA Sequencer class counts things. It aids numbering and formatting lists.z#Sequencer getSequencer setSequencer)
é    é   é	   éI   é
   é   é   é‰   iI  é   ÚIVXLCDMc                 óê   — | dk     s| dk    rt          d¦  «        ‚d}d}| rQt          | d¦  «        \  } }t          |         }|r(t          |d¦  «        \  }}t          ||z            |z   }|°(|dz  }| °Q|S )	Nr   iŸ  zillegal valueÚ éÿÿÿÿr   é   r   )Ú
ValueErrorÚdivmodÚ_RN_TEMPLATESÚ_RN_LETTERS)ÚvalueÚstrÚbaseÚindexÚtmps        úf/var/www/finuniver-perm.ru/html/portfolio/venv/lib/python3.11/site-packages/reportlab/lib/sequencer.pyÚ	_format_Ir      s¢   € Øˆq‚y€y�E˜D’L�LÝ˜Ñ)Ô)Ð)Ø
€CØ€DØ
ð Ý˜e RÑ(Ô(‰ˆˆuÝ˜EÔ"ˆØð 	0Ý  Q™œ‰JˆC�Ý˜e D™jÔ)¨CÑ/ˆCð ð 	0ð 	�‰	ˆð ð ð €Jó    c                 óD   — t          | ¦  «                             ¦   «         S ©N)r   Úlower©Únums    r   Ú	_format_ir!      s   € Ý�S‰>Œ>×ÒÑ!Ô!Ð!r   c                 ó    — t          | ¦  «        S )zThe simplest formatter)r   r   s    r   Ú_format_123r#   "   s   € åˆs‰8Œ8€Or   c                 ó6   — | dz
  dz  }t          |dz   ¦  «        S )zUppercase.  Wraps around at 26.r   é   éA   ©Úchr©r    Úns     r   Ú_format_ABCr+   &   ó   € à	ˆa‰�2‰€AÝˆq�‰t‰9Œ9Ðr   c                 ó6   — | dz
  dz  }t          |dz   ¦  «        S )zLowercase.  Wraps around at 26.r   r%   éa   r'   r)   s     r   Ú_format_abcr/   +   r,   r   )ÚIÚiÚ1ÚAÚac                   óH   — e Zd ZdZd„ Zd„ Zdd„Zd„ ZeZd„ Z	d„ Z
d	„ Zd
„ ZdS )Ú_Countera  Private class used by Sequencer.  Each counter
    knows its format, and the IDs of anything it
    resets, as well as its value. Starts at zero
    and increments just before you get the new value,
    so that it is still 'Chapter 5' and not 'Chapter 6'
    when you print 'Figure 5.1'c                 óR   — d| _         | j         | _        t          | _        g | _        d S ©Nr   )Ú_baseÚ_valuer#   Ú
_formatterÚ_resets©Úselfs    r   Ú__init__z_Counter.__init__@   s$   € ØˆŒ
Ø”jˆŒÝ%ˆŒØˆŒˆˆr   c                 ó   — || _         d S r   )r;   )r>   Ú
formatFuncs     r   ÚsetFormatterz_Counter.setFormatterF   s   € Ø$ˆŒˆˆr   Nc                 ó4   — |r	|| _         d S | j        | _         d S r   )r:   r9   )r>   r   s     r   Úresetz_Counter.resetI   s"   € Øð 	%ØˆDŒKˆKˆKàœ*ˆDŒKˆKˆKr   c                 óp   — | xj         dz  c_         | j         }| j        D ]}|                     ¦   «          Œ|S )Nr   )r:   r<   rD   )r>   ÚvÚcounters      r   Únextz_Counter.nextO   s>   € ØˆŒ�qÑˆŒØŒKˆØ”|ð 	ð 	ˆGØ�MŠM‰OŒOˆOˆOØˆr   c                 ó   — | j         S r   )r:   r=   s    r   Ú_thisz_Counter._thisW   s
   € ØŒ{Ðr   c                 óF   — |                       t          | ¦  «        ¦  «        S )zReturns next value formatted)r;   rH   r=   s    r   Únextfz_Counter.nextfZ   s   € à�Š�t D™zœzÑ*Ô*Ð*r   c                 óP   — |                       |                      ¦   «         ¦  «        S r   )r;   rJ   r=   s    r   Úthisfz_Counter.thisf^   s   € Ø�Š˜tŸzšz™|œ|Ñ,Ô,Ð,r   c                 óP   — || j         vr| j                              |¦  «         d S d S r   )r<   Úappend)r>   ÚotherCounters     r   Úchainz_Counter.chaina   s3   € Ø˜tœ|Ð+Ð+ØŒL×Ò Ñ-Ô-Ð-Ð-Ð-ð ,Ð+r   r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r?   rB   rD   rH   Ú__next__rJ   rL   rN   rR   © r   r   r6   r6   8   s¢   € € € € € ð#ð #ðð ð ð%ð %ð %ð%ð %ð %ð %ðð ð ð €Hðð ð ð+ð +ð +ð-ð -ð -ð.ð .ð .ð .ð .r   r6   c                   ó€   — e Zd ZdZd„ Zd„ Zdd„Zdd„Zd„ Zdd„Z	dd	„Z
dd
„Zdd„Zd„ Zd„ Zdd„Zd„ Zd„ Zd„ Zd„ ZdS )Ú	Sequenceran  Something to make it easy to number paragraphs, sections,
    images and anything else.  The features include registering
    new string formats for sequences, and 'chains' whereby
    some counters are reset when their parents.
    It keeps track of a number of
    'counters', which are created on request:
    Usage::
    
        >>> seq = layout.Sequencer()
        >>> seq.next('Bullets')
        1
        >>> seq.next('Bullets')
        2
        >>> seq.next('Bullets')
        3
        >>> seq.reset('Bullets')
        >>> seq.next('Bullets')
        1
        >>> seq.next('Figures')
        1
        >>>
    c                 óJ   — i | _         i | _        |                      ¦   «          d S r   )Ú	_countersÚ_formattersÚ_resetr=   s    r   r?   zSequencer.__init__}   s"   € ØˆŒØˆÔØ�Š‰Œˆˆˆr   c                 ó†  — | j                              ¦   «          | j                             ¦   «          | j                             t          t
          t          t          t          dœ¦  «         t          | j         | j        ¬¦  «        }| j
                             ¦   «          | j
                             |¦  «         d | _        d S )N)r2   r3   r4   r0   r1   )r\   r]   )r\   Úclearr]   Úupdater#   r+   r/   r   r!   ÚdictÚ__dict__Ú_defaultCounter)r>   Úds     r   r^   zSequencer._reset‚   s°   € ØŒ×ÒÑÔÐØÔ×ÒÑ Ô Ð ØÔ×ÒåÝÝÝÝð!ð !ñ 	ô 	ð 	õ ˜4œ>°dÔ6FÐGÑGÔGˆØŒ×ÒÑÔÐØŒ×Ò˜QÑÔÐØ#ˆÔÐÐr   Nc                 ór   — 	 | j         |         S # t          $ r t          ¦   «         }|| j         |<   |cY S w xY w)zCreates one if not present)r\   ÚKeyErrorr6   )r>   rG   Úcnts      r   Ú_getCounterzSequencer._getCounter’   sM   € ð	Ø”> 'Ô*Ð*øÝð 	ð 	ð 	Ý‘*”*ˆCØ&)ˆDŒN˜7Ñ#ØˆJˆJˆJð	øøøs   ‚ �$6µ6c                 ób   — |s| j         }|                      |¦  «                             ¦   «         S )z_Retrieves counter value but does not increment. For
        new counters, sets base value to 1.)rd   ri   rJ   ©r>   rG   s     r   rJ   zSequencer._this›   ó4   € ð ð 	+ØÔ*ˆGØ×Ò Ñ(Ô(×.Ò.Ñ0Ô0Ð0r   c                 óP   — t          |                      | j        ¦  «        ¦  «        S ©zqRetrieves the numeric value for the given counter, then
        increments it by one.  New counters start at one.)rH   ri   rd   r=   s    r   rW   zSequencer.__next__¢   s#   € õ �D×$Ò$ TÔ%9Ñ:Ô:Ñ;Ô;Ð;r   c                 ó†   — |st          | ¦  «        S | j        }	 || _        t          | ¦  «        || _        S # || _        w xY wr   )rH   rd   )r>   rG   Údcs      r   rH   zSequencer.next§   sS   € Øð 	*Ý˜‘:”:ÐàÔ%ˆBð*Ø'.�Ô$Ý˜D‘z”zà')�Ô$Ð$ø r�Ô$Ð)Ð)Ð)Ð)s	   š7 ·	A c                 ób   — |s| j         }|                      |¦  «                             ¦   «         S r   )rd   ri   rN   rk   s     r   rN   zSequencer.thisf²   s2   € Øð 	+ØÔ*ˆGØ×Ò Ñ(Ô(×.Ò.Ñ0Ô0Ð0r   c                 ób   — |s| j         }|                      |¦  «                             ¦   «         S rn   )rd   ri   rL   rk   s     r   rL   zSequencer.nextf·   rl   r   c                 ó   — || _         dS )z$Changes the key used for the defaultN)rd   )r>   Údefaults     r   ÚsetDefaultCounterzSequencer.setDefaultCounter¾   s   € à&ˆÔÐÐr   c                 ó   — || j         |<   dS )z§Registers a new formatting function.  The funtion
        must take a number as argument and return a string;
        fmt is a short menmonic string used to access it.N)r]   )r>   ÚformatÚfuncs      r   ÚregisterFormatzSequencer.registerFormatÂ   s   € ð $(ˆÔ˜Ñ Ð Ð r   c                 óp   — | j         |         }|                      |¦  «                             |¦  «         dS )zPSpecifies that the given counter should use
        the given format henceforth.N)r]   ri   rB   )r>   rG   rw   rx   s       r   Ú	setFormatzSequencer.setFormatÈ   s9   € ð Ô Ô'ˆØ×Ò˜Ñ!Ô!×.Ò.¨tÑ4Ô4Ð4Ð4Ð4r   r   c                 óL   — |s| j         }||                      |¦  «        _        d S r   )rd   ri   r:   )r>   rG   r   s      r   rD   zSequencer.resetÎ   s.   € Øð 	+ØÔ*ˆGØ+/ˆ×Ò˜Ñ!Ô!Ô(Ð(Ð(r   c                 ó„   — |                       |¦  «        }|                       |¦  «        }|                     |¦  «         d S r   )ri   rR   )r>   ÚparentÚchildÚpÚcs        r   rR   zSequencer.chainÓ   s;   € Ø×Ò˜VÑ$Ô$ˆØ×Ò˜UÑ#Ô#ˆØ	�Š�‰
Œ
ˆ
ˆ
ˆ
r   c                 ó†   — |dd…         dk    r|dd…         }|                       |¦  «        S |                      |¦  «        S )zrAllows compact notation to support the format function.
        s['key'] gets current value, s['key+'] increments.r   Nú+)rL   rN   )r>   ÚkeyrG   s      r   Ú__getitem__zSequencer.__getitem__Ø   sD   € ð ˆrˆsˆsŒ8�sŠ?ˆ?Ø˜#˜2˜#”hˆGØ—:’:˜gÑ&Ô&Ð&à—:’:˜c‘?”?Ð"r   c                 ó   — || z  S )z0The crowning jewels - formats multi-level lists.rX   )r>   Útemplates     r   rw   zSequencer.formatá   s   € à˜$‰Ðr   c           	      ó&  — t          | j                             ¦   «         ¦  «        }|                     ¦   «          t	          d¦  «         |D ]D\  }}t	          d||                     ¦   «         |j        |                     ¦   «         fz  ¦  «         ŒEdS )z-Write current state to stdout for diagnosticszSequencer dump:z2    %s: value = %d, base = %d, format example = %sN)Úlistr\   ÚitemsÚsortÚprintrJ   r9   rN   )r>   Úcountersr„   rG   s       r   ÚdumpzSequencer.dumpå   s    € å˜œ×,Ò,Ñ.Ô.Ñ/Ô/ˆØ�Š‰ŒˆÝÐÑ Ô Ð Ø&ð 	Gð 	G‰NˆS�'ÝÐFØ�W—]’]‘_”_ g¤m°W·]²]±_´_ðJFñ Fñ Gô Gð Gð Gð	Gð 	Gr   r   r8   )rS   rT   rU   rV   r?   r^   ri   rJ   rW   rH   rN   rL   ru   ry   r{   rD   rR   r…   rw   rŽ   rX   r   r   rZ   rZ   e   s6  € € € € € ðð ð.ð ð ð
$ð $ð $ð ð ð ð ð1ð 1ð 1ð 1ð<ð <ð <ð
	*ð 	*ð 	*ð 	*ð1ð 1ð 1ð 1ð
1ð 1ð 1ð 1ð'ð 'ð 'ð 'ð(ð (ð (ð5ð 5ð 5ð0ð 0ð 0ð 0ð
ð ð ð
#ð #ð #ðð ð ðGð Gð Gð Gð Gr   rZ   Nc                  ó:   — t           €t          ¦   «         a t           S r   )Ú
_sequencerrZ   rX   r   r   ÚgetSequencerr‘   ñ   s   € åÐÝ‘[”[ˆ
ÝÐr   c                 ó   — t           }| a |S r   )r�   )ÚseqÚss     r   ÚsetSequencerr•   ÷   s   € å€AØ€JØ€Hr   c                  óJ   — t           rt                                ¦   «          d S d S r   )r�   r^   rX   r   r   r^   r^   ý   s,   € åð Ý×ÒÑÔÐÐÐðð r   r   )Úregister_resetc            
      óJ	  ‡— t          ¦   «         Št          dt          ‰¦  «        t          ‰¦  «        t          ‰¦  «        fz  ¦  «         t          d‰                     d¦  «        ‰                     d¦  «        ‰                     d¦  «        fz  ¦  «         t          dt          ‰¦  «        z  ¦  «         ‰                     d¦  «         t          dt          ‰¦  «        t          ‰¦  «        t          ‰¦  «        fz  ¦  «         ‰                     ¦   «          t          dt          ‰¦  «        t          ‰¦  «        t          ‰¦  «        fz  ¦  «         t          ¦   «          t          d¦  «         ‰                     d	d
¦  «         t          d‰                     d	¦  «        ›d‰                     d	¦  «        ›d‰                     d	¦  «        ›�¦  «         d„ } t          ¦   «          t          d¦  «         ‰                     d| ¦  «         ‰                     dd¦  «         t          dd                     ˆfd„t          dd¦  «        D ¦   «         ¦  «        z   ¦  «         t          ¦   «          t          d¦  «         ‰ 	                    dd¦  «         t          d‰                     d¦  «        z  ¦  «         t          d‰                     d¦  «        z  ¦  «         t          d‰                     d¦  «        z  ¦  «         t          d‰                     d¦  «        z  ¦  «         t          d‰                     d¦  «        z  ¦  «         t          d‰                     d¦  «        z  ¦  «         t          d‰                     d¦  «        z  ¦  «         t          d‰                     d¦  «        z  ¦  «         t          ¦   «          t          d¦  «         t          d‰d	         z  ¦  «         t          d‰d         z  ¦  «         t          d‰d         z  ¦  «         t          d‰d	         z  ¦  «         t          ¦   «          t          d¦  «         t          d ¦  «         t          d!‰z  ¦  «         t          d!‰z  ¦  «         t          d!‰z  ¦  «         d S )"Nz)Counting using default sequence: %d %d %dz1Counting Figures: Figure %d, Figure %d, Figure %dÚfigurezBack to default again: %dÚlist1zSet default to list1: %d %d %dz#Set default to None again: %d %d %dz0Creating Appendix counter with format A, B, C...ÚAppendixr3   z    Appendix z, Appendix c                 ó   — d| dz
  dz           S )N)ÚunÚdeuxÚtroisÚquatreÚcinqr   é   rX   r   s    r   Úformat_frenchztest.<locals>.format_french  s   € Ø4°c¸!±e¸Q±YÔ?Ð?r   z+Defining a custom format with french words:ÚfrenchÚ
FrenchListz   ú c              3   ó\   •K  — | ]&}t          ‰                     d ¦  «        ¦  «        V — Œ'dS )r¥   N)r   rL   )Ú.0r1   r”   s     €r   ú	<genexpr>ztest.<locals>.<genexpr>  s7   øè è € ÐJÐJ¸!�3˜qŸwšw |Ñ4Ô4Ñ5Ô5ÐJÐJÐJÐJÐJÐJr   r   é   z:Chaining H1 and H2 - H2 goes back to one when H1 increasesÚH1ÚH2z    H1 = %dz      H2 = %dz-GetItem notation - append a plus to incrementz    seq["Appendix"] = %sz    seq["Appendix+"] = %sz	Appendix+z8Finally, string format notation for nested lists.  Cool!z>The expression ("Figure %(Chapter)s.%(Figure+)s" % seq) gives:z"    Figure %(Chapter)s.%(Figure+)s)
rZ   rŒ   rH   ru   r{   rL   ry   ÚjoinÚrangerR   )r£   r”   s    @r   Útestr¯     s&  ø€ Ý‰Œ€AÝ	Ð
5½¸a¹¼ÅÀaÁÄÍ$ÈqÉ'Ì'Ð8RÑ
RÑSÔSÐSÝ	Ð
=Ø	�ŠˆxÑÔ˜!Ÿ&š& Ñ*Ô*¨A¯FªF°8Ñ,<Ô,<ðA>ñ >ñ ?ô ?ð ?å	Ð
%­¨Q©¬Ñ
/Ñ0Ô0Ð0Ø×Ò˜Ñ Ô Ð Ý	Ð
*­d°1©g¬gµd¸1±g´g½tÀA¹w¼wÐ-GÑ
GÑHÔHÐHØ×ÒÑÔÐÝ	Ð
/µ4¸±7´7½4À¹7¼7ÅDÈÁGÄGÐ2LÑ
LÑMÔMÐMÝ	�G„G€GÝ	Ð
<Ñ=Ô=Ð=Ø‡K‚K�
˜CÑ Ô Ð Ý	€EØ	�Š�
ÑÔÐÐ §¢¨
Ñ 3Ô 3Ð 3Ð 3°A·G²G¸JÑ4GÔ4GÐ4GðIñ Jô Jð Jð@ð @ð @å	�G„G€GÝ	Ð
7Ñ8Ô8Ð8Ø×Ò�X˜}Ñ-Ô-Ð-Ø‡K‚K�˜hÑ'Ô'Ð'Ý	ˆ%�#—(’(ÐJÐJÐJÐJ½uÀQÀq¹z¼zÐJÑJÔJÑJÔJÑ
KÑLÔLÐLÝ	�G„G€GÝ	Ð
FÑGÔGÐGØ‡G‚GˆD�ÑÔÐÝ	ˆ-˜!Ÿ&š& ™,œ,Ñ
&Ñ'Ô'Ð'Ý	ˆ/˜AŸFšF 4™LœLÑ
(Ñ)Ô)Ð)Ý	ˆ/˜AŸFšF 4™LœLÑ
(Ñ)Ô)Ð)Ý	ˆ/˜AŸFšF 4™LœLÑ
(Ñ)Ô)Ð)Ý	ˆ-˜!Ÿ&š& ™,œ,Ñ
&Ñ'Ô'Ð'Ý	ˆ/˜AŸFšF 4™LœLÑ
(Ñ)Ô)Ð)Ý	ˆ/˜AŸFšF 4™LœLÑ
(Ñ)Ô)Ð)Ý	ˆ/˜AŸFšF 4™LœLÑ
(Ñ)Ô)Ð)Ý	�G„G€GÝ	Ð
9Ñ:Ô:Ð:Ý	Ð
$ q¨¤}Ñ
4Ñ5Ô5Ð5Ý	Ð
%¨¨+¬Ñ
6Ñ7Ô7Ð7Ý	Ð
%¨¨+¬Ñ
6Ñ7Ô7Ð7Ý	Ð
$ q¨¤}Ñ
4Ñ5Ô5Ð5Ý	�G„G€GÝ	Ð
DÑEÔEÐEÝ	Ð
JÑKÔKÐKÝ	Ð
.°Ñ
2Ñ3Ô3Ð3Ý	Ð
.°Ñ
2Ñ3Ô3Ð3Ý	Ð
.°Ñ
2Ñ3Ô3Ð3Ð3Ð3r   Ú__main__)Ú__version__rV   ÚsplitÚ__all__r   r   r   r!   r#   r+   r/   Ú_type2formatterr6   rZ   r�   r‘   r•   r^   Úreportlab.rl_configr—   r¯   rS   rX   r   r   ú<module>r¶      s‘  ðð €ØV€Ø1×7Ò7Ñ9Ô9€ð NÐMÐM€Ø€ðð ð ð"ð "ð "ðð ð ðð ð ð
ð ð ð ØØØØð
ð 
€ð+.ð +.ð +.ð +.ð +.ñ +.ô +.ð +.ðZGGð GGð GGð GGð GGñ GGô GGð GGðR .Ø€
ðð ð ðð ð ðð ð ð
 /Ð .Ð .Ð .Ð .Ð .Ø €ˆvÑ Ô Ð Øð-4ð -4ð -4ð` ˆZÒÐØ€D�F„F€F€F€Fð Ðr   