+
    bIiĬ                        R t Rt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RIt^ RI	H
t
 ^ RIHtHt ^ RIHt ^ RIHt ^ RIHtHt ^RIHtHtHtHt ^ R	IHt  ! R
 R4      t]! 4       t ^ RIt]P>                  ! 4       R8H  t R t! ! R R4      t"]#! ]"PH                  4      3R lt%A"R t&]'](33R lt)R t*]#! R4      t+],]-3t.R t/RR lt0RR lt1RR lt2RR lt3R t4R t5R t6R t7R t8R t9R  t:RR! lt;R" t<R# t=R$ t>R% t?^ RI@t@]A! ]@R&4      tBA@R' tCRR( ltDR) tERR* ltFRR+ ltG ! R, R-]H4      tI]P                  R.8X  d-   ^ RIKtK^ RILtLR/RR0RR1RR2RR3RR4RR5RR6RR7RR8RR9RR:RR;RR<R/tMRR= ltNMRR> ltN^ RIOtO]P                  P                  ]OP                  4      tS]P                  P                  ]S4      ;'       d    ]S;'       g    ]P                  P                  ]S4      tVAO ]R ^ RIXtX^ RIYtY ]Zt[]['       * t\]F! ][R?7      '       g   ]]! R@][,          4      h]P                  P                  ]P                  P                  ][P                  4      4      ta]a]P                  ,           tc]P                  P                  ]a4      td]d]P                  ,           te]f! ]c4      tg]f! ]e4      th]c]e]a]d]P                  P                  ]P                  P                  ]P                  ]P                  ]f! ]P                  4      3	RA ltjRB tk]XP                  ]YP                  ]V]P                  P                  3RC ltmAXAY]\;'       dC    ]P                  P                  ]P                  P                  ]R4      ^ ,          RF,           4      tpRG tqRH trRI tsRJ tt]A! ]RKRL 4      tuRRM ltv]RJtw ! RN RO4      txRP tyRRQ ltzRR t{RRS lt|^ RTI}H~t~Ht ^ RUIHtHt RRV ltRRW ltRRX ltRRY lt]P                  P                  3RZ lt]P                  EP                  ]P                  P                  3R[ lt]P                  EP                  ]P                  P                  ]EP                  3R\ lt]P                  P                  ]P                  P                  ]P                  EP                  ]EP                  3R] lt^ R^IHt R_ tR` tRa t ! Rb Rc4      t ! Rd Re]4      tRf t ! Rg Rh4      tRi tRj tRRk lt ! Rl Rm4      t ! Rn Ro4      tRp tRq tRr tRs t^ RItRt tRu tRv tRRw ltRRx ltRy t ! Rz R{],4      t ! R| R}],4      tR~ t ! R R]EPV                  4      t ! R R4      tRR ltR tR tR tR t ! R R4      tR#    Rt  EL; i   ]P                  ^ ,          tR EL; i   ]P                  P                  ]R4      t\Rt[RD tk]XP                  3RE ltm EL; i)z3.5.34z6Gazillions of miscellaneous internal utility functionsN)literal_eval)decodebytesencodebytes)BytesIO)md5)get_rl_tempfileget_rl_tempdir)rl_safe_execrl_safe_evalsafer_globalsrl_extended_literal_eval)Imagec                   D   a  ] tR t^t o ]R 4       t]R 4       t]tRtV t	R# )	__UNSET__c                     R # )F r       |C:\Users\petid\OneDrive\Desktop\Maestro\MAESTRO CLAUDE\MAESTRO\maestro-backend\venv\Lib\site-packages\reportlab/lib/utils.py__bool____UNSET__.__bool__   s    r   c                     R # )r   r   r   r   r   __str____UNSET__.__str__   s    r   r   N)
__name__
__module____qualname____firstlineno__staticmethodr   r   __repr____static_attributes____classdictcell____classdict__s   @r   r   r      s.       Hr   r   PyPyFc                 8    \        V 4      \        \        4      8H  # N)type
isFunctionvs   &r   r'   r'   !   s    7d:&&&r   c                   &   a  ] tR t^$t o R tRtV tR# )cc                    R # r%   r   selfs   &r   mc.m%   s    r   r   N)r   r   r   r   r/   r   r    r!   s   @r   r+   r+   $   s     r   r+   c                     \        V 4      V8H  # r%   )r&   )r)   mts   &&r   isMethodr3   '   s    7b=r   c                 8    \        V 4      \        \        4      8H  # r%   )r&   sysr(   s   &r   isModuler6   +   s    7d3ir   c                     \        W4      # r%   )
isinstance)r)   _sts   &&r   isSeqr:   .   s    ar   c                 "    \        V \        4      # r%   r8   strr(   s   &r   isNativer>   1       ar   c                 |    \        \        V 4      '       d   T MV P                  R 4      RR7      P                  4       # )utf8F)usedforsecurity)r   isBytesencode	hexdigestss   &r   	_digesterrH   9   s+    GAJJqAHHV$4UKUUWWr   c           	          \        V \        4      '       d   V #  V P                  V4      #    \        R \	        T 4      : R\	        T4      : R24        R# ; i)zasBytes(,enc=	) error: N)r8   bytesrD   annotateExceptionasciir)   encs   &&r   asBytesrQ   <   sD    !E1HPxx}P%(5:NO	   + (Ac           	          \        V \        4      '       d   V #  V P                  V4      #    \        R \	        T 4      : R\	        T4      : R24        R# ; i)z
asUnicode(rJ   rK   N)r8   r=   decoderM   rN   rO   s   &&r   	asUnicoderU   C   sD    !C(Rxx}RE!HU3ZPQrR   c           	          \        V \        4      '       d   V #  \        V \        4      '       d   V P                  V4      # \        V 4      #    \	        R \        T 4      : R\        T4      : R24        R# ; i)zasUnicodeEx(rJ   rK   N)r8   r=   rL   rT   rM   rN   rO   s   &&r   asUnicodeExrW   J   sY    !C(T *1U 3 3qxx}?Q?TeAhuSzRSs   &A 
A (A7c                     \        WR 7      # ))rP   )rU   rO   s   &&r   asNativerY   Q   s    Qr   c                     \        V .4      # r%   )rL   )is   &r   int2Byter\   T   s    !:r   c                 .    \        V \        \        34      # r%   )r8   r=   rL   r(   s   &r   isStrr^   W   s    a#e%%r   c                 "    \        V \        4      # r%   )r8   rL   r(   s   &r   rC   rC   Z   s    ar   c                 "    \        V \        4      # r%   r<   r(   s   &r   	isUnicodera   ]   r?   r   c                 "    \        V \        4      # r%   r8   r&   r(   s   &r   isClassrd   `   s    ar   c                 @   \        V \        \        \        \        \
        \        \        \        \        \        \        \        \        P                  \        P                  \        P                   \        P"                  \        P$                  \        P&                  \        P(                  \        P*                  \        P,                  \        P.                  \        P0                  \        P2                  \        P4                  \        P6                  34      '       * # r%   )r8   floatintr&   tuplelistdictr=   rL   complexboolslice_rl_NoneTypetypesFunctionType
LambdaTypeCodeTypeMappingProxyTypeSimpleNamespaceGeneratorType
MethodTypeBuiltinFunctionTypeBuiltinMethodType
ModuleTypeTracebackType	FrameTypeGetSetDescriptorTypeMemberDescriptorType)xs   &r   isNonPrimitiveInstancer   c   s    !U3tE$tCgdSXYe5++ENNu44E,,U-F-F 0 01D1D2253M3MO P P Pr   c                 ,    \        V \        4      '       * # r%   rc   r(   s   &r   instantiatedr   k   s    !D!!!r   c                     \        V \        4      '       d   V P                  V4      # \        V \        4      '       d   V # \        V 4      P                  V4      # r%   )r8   r=   rD   rL   )r~   rP   s   &&r   bytestrr   n   sB    !Cxx}	Ae		1v}}S!!r   c                     \        \        V 4      P                  R 4      4      P                  4       P	                  R 4      # rN   )base64_encodebytesrN   rD   striprT   )argss   &r   encode_labelr   v   s0    eDk009:@@BII'RRr   c                 f    \        \        V P                  R 4      4      P                  R 4      4      # r   )r   base64_decodebytesrD   rT   )labels   &r   decode_labelr   y   s'    *5<<+@AHHQRRr   c                T    \        V \        4      '       g   V P                  R4      # T # zconverts first 256 unicodes 1-1latin1)r8   r=   rT   rF   s   &r   
rawUnicoder   |   s"    %/#%6%6188H=A=r   c                T    \        V \        4      '       d   V P                  R4      # T # r   )r8   r=   rD   rF   s   &r   rawBytesr      s"    !+Ac!2!2188H99r   execc                     \        V \        4      '       d   V # \        \        V \        4      '       d   T MV P	                  R 4      4      # )r   )r8   rg   ordr=   rT   rF   s   &r   char2intr      s6    Ac""A[Ac1B1BAQYHZ([[r   c                 H    VP                   VJd   VP                  V4      hVhr%   )__traceback__with_traceback)tr)   bs   &&&r   
rl_reraiser      s$    aq!!
Gr   c                  X    ^ RI pV P                  4        F  w  r#\        WV4       K  	  R#     N)builtinsitemssetattr)kwdr   kr)   s   ,   r   rl_add_builtinsr      s!    yy{1 r   c                      V '       g(   \         P                  ! ^4      P                  R,          p ^ RIHp \        W4      '       d   \        V P                  4      '       d   V # R#     R# ; i)   
__loader__)zipimporterN)r5   	_getframe	f_globals	zipimportr   r8   len_files)ldrr   s   & r   zipImportedr      sQ    --",,\:C) 11c#**oosO4Os   A' AA' %A' 'A,c                 P   ^ RI HpHpHp ^ RIHp VP                  4       p. pVP                  pV  Fq  pV! V4      '       g   K  V! V4       FR  p	V! W4      p	V! V	4      '       g   K  V'       d(   V	P                  4       P                  V4      '       g   KJ  V! V	4       KT  	  Ks  	  V# )r   )isfileisdirjoin)listdir)	os.pathr   r   r   osr   lowerappendendswith)
dirListextr   r   	path_joinr   RADfns
   &&        r   
_findFilesr      s~    88
))+C
A	AQxx!*B1Bbzz3"((**=*=c*B*BQrU  
 Hr   c                   Z   a  ] tR t^t o R tR tR tR tR tRR lt	R t
R	 tR
 tRtV tR# )CIDictc                Z    V F  q0P                  V4       K  	  V P                  V4       R # r%   )update)r.   r   kwdsas   &*, r   __init__CIDict.__init__   s    A{{1~Dr   c                @    VP                  4        F	  w  r#W0V&   K  	  R # r%   )r   )r.   r   r   r)   s   &&  r   r   CIDict.update   s    779CA1g9r   c                b     VP                  4       p\        P                  YT4       R #     L; ir%   )r   rj   __setitem__r.   r   r)   s   &&&r   r   CIDict.__setitem__   s.    		A 	"	s   * .c                \     VP                  4       p\        P                  Y4      #     L; ir%   )r   rj   __getitem__r.   r   s   &&r   r   CIDict.__getitem__   /    		A ''	   ' +c                \     VP                  4       p\        P                  Y4      #     L; ir%   )r   rj   __delitem__r   s   &&r   r   CIDict.__delitem__   r   r   Nc                :     W,          #   \          d    Tu # i ; ir%   )KeyError)r.   r   dvs   &&&r   get
CIDict.get   s"    	7N 	I	s   
 c                (     W,           R #     R# ; iTFr   r   s   &&r   __contains__CIDict.__contains__   s    	G	s    c                j     VP                  4       p\        P                  ! Y3T,           !  #     L ; ir%   )r   rj   popr.   r   r   s   &&*r   r   
CIDict.pop   s3    		A xx4(1*&&	   . 2c                j     VP                  4       p\        P                  ! Y3T,           !  #     L ; ir%   )r   rj   
setdefaultr   s   &&*r   r   CIDict.setdefault   s3    		A $!--	r   r   r%   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    r!   s   @r   r   r      s7     *#(('. .r   r   macBMPEPSEPSFGIFJPGJPEGPCTPICTPNGPPMTIFTIFFPDFHTMLc                      Ve	   Vf#   Ve    \         VP                  4       ,          w  r\        P                  ! V 4      P	                  W4       \
        P                  ! V 4       R #     R # ; i    R # ; ir%   )_KNOWN_MAC_EXTuppermacfsFSSpecSetCreatorType
macostoolstouched)filenamecreatorcodefiletyper   s   &&&&r   markfilenamer     sh    		"h&63?,:399;,G)K LL"11+Gx(	s'   A1 A) ;A1 )A.+A1 .A1 1A6c                     R # r%   r   )r  r  r  s   &&&r   r  r     s    r   )r   z#can't handle compact distro type %rc
                   V! V P                  RV4      4      p V! V 4      p
WV39   d   R# V
P                  V4      '       d   ^V \        R 3# V
P                  V4      '       d   ^V \        R 3# V! V! 4       4      p\	        V4      pV
P                  V4      '       d9   WR P                  V4      '       d   ^WV	,           R 3# V\	        V 4      8X  d   R# \
        P                  P                  V 4      '       * V 3# )z3if the name starts with a known prefix strip it off/N)r    )replace
startswith_archivepfxlen_archivedirpfxlenr   r   pathisabs)r   _archivepfx_archivedirpfx_archive_archivediros_path_normpathos_path_normcase	os_getcwdos_sep
os_sep_lennfncwdns   &&&&&&&&&&   r   __startswith_rlr    s     bjjV45r"x((+>>+&&qNO1D/D(D>>.))!B7H7I4J2J+Jy{+H>>#"v  ((B|}4E1E*E#b'z$;77==$$R''r   c                 &    \        V 4      ^,          # )r   )r  r   s   &r   _startswith_rlr   3  s    r"1%%r   c                    \        V 4      w  rVV! V4      pV'       g   V. 8X  db   V\        \        \        V3R  l\        \	        Wb3R l\        \
        P                  P                  4       4      4      4      4      4      ,          pV# )c                     V! \         V 4      # r%   )r  )r~   r   pjoins   &&&r   <lambda>rl_glob.<locals>.<lambda>:  s    eKPQ>Rr   c                     V! W4      # r%   r   )r~   pfnfnmatchs   &&&r   r$  r%  :  s      BI  JK  BPr   )r  ri   mapr  filter__rl_loader__r   keys)patternglobr(  _RL_DIRr#  r+   r'  rs   &&&&&   r   rl_globr1  6  s     )I2c[uRSWX^lo  `P  QU  Vc  Vj  Vj  Vo  Vo  Vq  Qr  Ys  Tt  u  v  vAr   c                     V # r%   r   r  s   &r   r   r   ?  s    	r   c                     V! V 4      # r%   r   )r-  r.  s   &&r   r1  r1  A  s    G}r   .pyc                     \         # )z*return truth if a file system distribution_isFSDr   r   r   isFileSystemDistror8  F  s    Mr   c                     \         '       * # )z.return truth if not a file system distributionr6  r   r   r   isCompactDistror:  J  s
    :r   c                     \         # )z1return truth if a source file system distribution)_isFSSDr   r   r   isSourceDistror=  N  s    Nr   c                     \         P                  P                  \         P                  P                  \         P                  P	                  V 4      4      4      # r%   )r   r  normcaseabspathnormpath)ps   &r   normalize_pathrC  R  s3    77BGGOOBGG,<,<Q,?@AAr   invalidate_cachesc                      R # r%   r   r   r   r   r$  r$  U  s    Tr   c                R   \         P                   Uu. uF  p\        V4      NK  	  ppV'       dX   \        V\        \
        34      '       d   TMV3 F2  pV'       g   K  \        V4      pWE9  g   K   VP                  ^ V4       K4  	  V'       dJ   RR\        R4      3 F6  pWE9   g   K  V'       d   \        RV,          4       VP                  V4       K5  	  M-\        P                  ! 4       pWE9  d   VP                  ^ V4       \         P                  p V\         n        \        4        V'       d   \        4        \        R4       \        R\        V 4      ,          4       \        R\        \        P                  ! 4       4      ,          4       \        R\        \         P                  4      ,          4       \        R\        RV ,          4      : R	\        \        P                  P                  RV ,          4      4      : 24       \        R
\        V4      ,          4       \        R4       \        P                  ! V 4      V\         n        \        4        V'       d   \        R\!        V4      ,          4       # # u upi   \"         d<    \%        RT : R\         P                  : R\        P                  ! 4       : 24        Me \%        R\'        \         P(                  ! 4       ^,          4      : RT : R\         P                  : R\        P                  ! 4       : 24        M; iT\         n        \        4        T'       d   \        R\!        T4      ,          4       R# R#   T\         n        \        4        T'       d   \        R\!        T4      ,          4       i i ; i)zEDynamically imports possible packagized module, or raises ImportErrorr
  .zremoved "%s" from pathz+++++ modulename=%sz+++++ cwd=%sz+++++ sys.path=%sz+++++ os.paths.isfile(z./%s.pyz)=z+++++ opath=%sz===== restore sys.path=%szCould not import z
using sys.path z in cwd=z
Exception z while importing Nz++++++++++++++++++++z--------------------)r5   r  rC  r8   ri   rh   insertprintremover   getcwd_importlib_invalidate_cachesrN   r   	importlibimport_modulereprImportErrorrM   r=   exc_info)
modulenamebaseDirnoCWDdebugrB  r  opaths   &&&&   r   recursiveImportrW  W  so   '*xx0x!N1xD0&wU|<<7*LAq"1%=$++a"2 M S,-A)% 81 <=A .
 IIK=KK! HHE=$&G&M'%
*;;<.5#556%chh78E)J:N4OQVWYW^W^WeWefopzfzW{Q|}~"U5\12&M&&z2 $&-U;< S 1>  388BIIK1 	JCLLN1%&
388BIIKI 	J $&-U;<  $&-U;< s,   J D/J AL,M+ 
A L,*M+ +;N&c                   *   a  ] tR tRt o RtR tRtV tR# )ArgvDictValuei  zGA type to allow clients of getArgvDict to specify a conversion functionc                    Wn         W n        R # r%   )valuefunc)r.   r[  r\  s   &&&r   r   ArgvDictValue.__init__  s    
	r   )r\  r[  N)r   r   r   r   __doc__r   r   r    r!   s   @r   rY  rY    s     Q r   rY  c                    R p\         P                  R,          p/ pV P                  4        F  w  rE\        V\        4      '       d   VP
                  VP                  reMRp^ pVR,           pV FH  p	V	P                  V4      '       g   K  V	\        V4      R p
VP                  V	4       V! WZV4      W4&   ^p M	  V'       d   K  V! WUV4      W4&   K  	  V# )zBuilds a dictionary from its keyword arguments with overrides from sys.argv.
Attempts to be smart about conversions, but the value can be an instance
of ArgDictValue to allow specifying a conversion function.
c                    V'       d   V! V4      p V # \        V 4      '       d   Tp V # \        V \        4      '       d   \        V4      p V # \        V \        4      '       d   \        V4      p V # \        V \        4      '       d   \	        \        V4      / 4      p V # \        V \        4      '       d   \        \        V4      / 4      p V # \        R V: R\        V 4      : 24      h)zCan't convert string z to )	r^   r8   rf   rg   ri   r   rh   	TypeErrorr&   )r)   avr\  s   &&&r   handleValue getArgvDict.<locals>.handleValue  s    RA  Qxx  Ae$$"I  Ac""G  Ad##b)"-
 	 Ae$$,r*2.   2d1g NOOr   r   NNN=)
r5   argvr   r8   rY  r[  r\  r  r   rJ  )kwrc  r   r   r   r)   r\  handledker   rb  s   ,          r   getArgvDictrk    s    
$ 	A
A
a&&ggqvvtDsUA||Bs2wx["1-  w{1t4 " Hr   c                      ^ RI Hp V fB   \        P                  P	                  \        P                  P                  \        4      R4      p V! V 4      #   \         d   p\        T4      R8w  d   h  Rp?R# Rp?ii ; i)r   )HyphenNzhyphen.mashedzNo module named pyHnj)	reportlab.lib.pyHnjrm  r   r  r   dirname__file__rP  r=   )hDictrm  errMsgs   &  r   getHyphenaterrs    s[    .=RWW__X-F W%e} v;//s   AA A< A77A<c                     V P                   P                  pVP                  R4      pV^ 8  d   W^,           R # V#   \         d    \	        T 4      u # i ; i)zReturn a shortened class namerG  N)	__class__r   rfindAttributeErrorr=   )r.   namer[   s   &  r   
_classNamery    sU    ~~&&
**S/a4qST
" 4ys   8= = AAc                 T   R V9  d
   R V,           p \        W4      #   \         d    \        '       g	   \        f   h \	        T 4      p \        P                  T 4      pRT9  d6   \        P                  R8w  d!   TP                  \        P                  R4      p\        T4      u # i ; i)r0  r   
)
openIOErrorr7  r+  r   get_datar   linesepr  r   )rx  moderG   s   && r   open_for_read_by_namer    s    
$s4x	D 6]*E d#""4(d?rzz4/QYYrzz$5Oqzs   
 B'A0B'&B')unquoteurlparse)urlopenRequestc                 ~    VR 8X  d   / pVP                  RR4       \        \        WR7      4      P                  4       # )Nz
User-AgentReportLabAgent)headers)r   r  r  read)rx  r  s   &&r   	rlUrlReadr    s7    }g|$4574016688r   c                   aaaa \         3R  lo^ RIHoHo S'       dK   ^ RIp^ RIoV3R lpVP                  RP                  RRP                  \        VS4      4      R34      4      oR
VVV3R llpV\        4       R	&   V! W4      # )c                V    V P                  R^4      w  r#T'       g   RpTP                  R4      pT^ 8  d   RY$R 9  d   Y$^,           R pTRT pMRpTR	8X  d   \	        TP                  R
4      4      pT# T! T4      P                  R4      pT#   \         d    \        RR4      hi ; i)zUse "data" URL.,z
data errorzbad data URLztext/plain;charset=US-ASCII;rf  Nr
  base64rN   zlatin-1)split
ValueErrorr}  rv  r   rD   )urlr  typdatasemiencodings   &&    r   
datareader!open_for_read.<locals>.datareader  s    	8		#q)IC /Cyy~19CJ.67|Het*CHx%dkk'&:;D  4=''	2D  	8,77	8s   B B()trustedHoststrustedSchemesNc                 j   < SP                   ! V 4      p V P                  R 4      '       d   V ^R # V RR # )z(?s:Ni)	translater  )rG   r(  s   &r   xreopen_for_read.<locals>.xre  s8    !!!$All6221Qr7>#2>r   r
  z^(?:|z)\Zc                  < \        V R4      '       d   V #  \        W4      #     Se`   \        T 4      pT^ ,          '       dF   T^ ,          R9   g   SP                  T^,          4      '       d   T^ ,          S9   g   \	        R4      h\        T R,          P                  4       R8X  d   SM\        ! T 4      4      u #    \        RT ,          4      h; i; i)z)attempt to open a file or URL for readingr  zAttempted untrusted host access:N   Nzdata:zCannot open resource "%s")r  file)	hasattrr  r  matchr  r   r   r  r}  )rx  r  purlr  r  r  s   && r   open_for_read$open_for_read.<locals>.open_for_read	  s    4
	B(33	BB+#D>DAwwaO)C|GYGYZ^_`ZaGbGbimnoip  uC  jC()JKKd2hnn.>.G
Y VX\]^^B9D@AAs(   
" CA	B=/AB=:C=CCr  r   )
r  reportlab.rl_configr  r  rer(  compiler   r)  globals)	rx  r  r  r  r  r  r(  r  r  s	   &&   @@@@r   r  r    s{    
 !( 6 A	? zz"''6 #S)> ? &+( #) *B B "/GIo##r   c                     \        W4      pWJd8   \        VR 4      '       d&   V;_uu_ 4        VP                  4       uuRRR4       # VP                  4       #   + '       g   i     R# ; i)__exit__N)r  r  r  )rx  r  fs   && r   open_and_readr    sI    d A}:..Q668 Q vvx QQs   AA)	c                 6    \        W4      P                  R 4      # )r{  )r  r  )rx  r  s   &&r   open_and_readlinesr  "  s    #))$//r   c                     \        V R 4      '       d   R# V! V 4      '       d   R# \        '       g	   \        f   R# \        V 4      p V \	        \        P
                  P                  4       4      9   # )r  TF)r  r7  r+  r   ri   r   r,  )r   os_path_isfiles   &&r   	rl_isfiler  %  sS    r&$b$v&u		Bm**//1222r   c                 |   V! V 4      '       d   R # \         '       g	   \        f   R# \        V! V 4      4      p V P                  \        P
                  4      '       g   V \        P
                  ,          p \        \        \        V 3R l\        \        P                  P                  4       4      4      4      4      ^ 8  # )TFc                 $    V P                  V4      # r%   )r  )r~   pns   &&r   r$  rl_isdir.<locals>.<lambda>1  s    1<<+;r   )r7  r+  r   r   r   sepr   ri   r*  r   r,  )r  os_path_isdirr  s   &&&r   rl_isdirr  ,  s~    Rv&u	(,	-B;;rvvbfftFr;DAUAUAZAZA\<]^_`abbbr   c                    V! V 4      '       g   \         '       g	   \        f	   V! V 4      # \        V! V 4      4      p V P                  \        P
                  4      '       g   V \        P
                  ,          p \        P                  P                  4        Uu. uF)  qDP                  V 4      '       g   K  V\        V 4      R  NK+  	  up# u upi r%   )
r7  r+  r   r   r   r  r   r,  r  r   )r  r  r  
os_listdirr~   s   &&&& r   
rl_listdirr  3  s    RFFm&;JrN=R	(,	-B;;rvvbff!.!5!5!:!:!<Q!<AR@PKAc"ghK!<QQQs   C
5C
c                    V! V 4      '       g   \         '       g	   \        f	   V! V 4      # \        V! V 4      4      p \        P                  V,          pT^,          pT^,          pT! T^	,	          ^,          R,           T^,	          ^,          T^,          T^,	          ^,          T^,	          ^?,          T^,          ^,          ^ ^ ^ 3	4      #   \         d    T! T 4      u # i ; i)Ni  )r7  r+  r   r   r   )	r  r  r  os_path_getmtimetime_mktimerB  erG   ds	   &&&&&    r   rl_getmtimer  9  s    bVV}'<EUVXEY>Y'+,A$  # 	
!A	!A!Q$d*AqD#:afaeT\1a4QU+WXY]W]`aVabcdefghii	  $##$s   C C! C!)utilc                 $   R F  p\         P                  P                  WV,           4      p\         P                  P                  V4      '       g   KP  \        P
                  ! W4      pVP                  P                  4       u # 	  \        R4      h)r4  zno suitable file found)r4  z.pywz.pyoz.pycz.pyd)	r   r  r   r   importlib_utilspec_from_file_locationloaderload_modulerP  )rx  dirr   r  specs   &&   r   __rl_get_module__r  E  sf    2ww||CS)77>>$!99$DD;;**,,	 3
 .
//r   c                    V \         P                  9   d*   \         P                  V ,          p\         P                  V  MR p  \        W4      V'       d   V\         P                  V &   # #    \        4       '       d   ^ R Ip\        T4      pTR8H  ;'       g    T'       * ;'       d    \        ;'       gC    \        P                  P                  \        TP                  R\        P                  4      4      pTP                  T4      pTP                  T 4      u T'       d   T\         P                  T &   # # \        T : RT: R24      h; i  T'       d   T\         P                  T &   i i ; i)NrG  r	  [])r5   modulesr  r:  r   r   r  r   r  r   r  r  r   r  rP  )rx  r  omr   zis   &&   r   rl_get_moduler  M  s   s{{[[KK&
	5$T. 2s{{4 2	5   $S)Cx**s788jjBGGLLRUR]R]^abdbhbhRi<j**3/~~d++ 2s{{4 2 $s3442s{{4 2s7   
A* *,E
E
&E
4A%E
E 7E

E E+c                 \     \        V \        P                  4      #   \         d     ^ # i ; ir   )r8   r   rw  )ims   &r   _isPILImager  b  s*    "U[[)) s    ++c                      a  ] tR tRt o Rt/ tRtRR ltR tR t	]
R 4       t]
RR l4       tR	 tR
 tR tR tR tR tRtV tR# )ImageReaderih  z%Wraps up PIL to get data from bitmapsNc                   \        V\        4      '       d   VP                  V n        R # W n        Wn        R V n        R V n        R V n        R V n        R V n	        \        V4      '       d7   Wn        \        VRR 4      V n         V P
                  P                  V n        R #  ^ RIHp V^ 8w  d   \#        R4      h\%        VR4      p\        V\&        4      '       g,   T\'        VP)                  4       4      rEVP+                  4        ?W@n        V P-                  V P                  4      V n        \        V\.        4      '       d   TM
\1        V4      V P
                  n        V P3                  V P
                  4       \        V P
                  RR 4      R8X  d   V P4                  V n        R # R #   \         d    R\        T 4      ,          T n         R # i ; i   \9        RT: R	T P;                  4       : 24        R # ; i)
NfpzPILIMAGE_%d)imageReaderFlagszYimageReaderFlags values other than 0 are no longer supported; all images are interned nowr   formatr   z

fileName=z
 identity=)r8   r  __dict___identfileName_image_width_height_transparent_datar  getattrr  rw  idr  r  r  r  r   r  close_read_imager=   rO  check_pil_image_size_jpeg_fhjpeg_fhrM   identity)r.   r  identr  r  tfps   &&&   r   r   ImageReader.__init__l  s   h{++$--DM ! 
x  "KhtD1DG9 $ 4 4Z@#q($  &A  B  B"8C0!"g.. '"'')"4IIK"..tww73=hs3K3KxQUV^Q_$))$++64;;x5v=#'==DL >! " 9 -4 89$Z!x"XYs   F* !DG *"GG#G9c                ^   V P                   p\        V4      '       g   \        \        V RR4      RR4      pV P                  pRV P                  P
                  : R\        \        V 4      4      : T;'       d    RV,          ;'       g    R: T;'       d    RV,          ;'       g    R: R	2# )
z9try to return information that will identify the instancer  Nrx  r  @z	 ident=%rr
  z filename=%rr  )r  r^   r  r  ru  r   hexr  )r.   r   r  s   &  r   r  ImageReader.identity  s    ]]Ryyd40=B $ 7 7BtHeFeFeQ\_dQdFkFkikFkln  mI  mI  uC  FH  uH  mO  mO  MO  mO  P  	Pr   c                .    \         P                  ! V4      # r%   )r   r|  r.   r  s   &&r   r  ImageReader._read_image  s    zz"~r   c                   V P                   pVf   R # VP                  w  r4VP                  p\        ^VR8X  d   ^M^\	        V4      ,          V,          V,          ^,	          4      pWb8  d!   \        RV: RV: RV: RV: RV: R24      hR # )N1zPIL  z x z image would use z > z bytes)_max_image_sizesizer  maxr   MemoryError)clsr  max_image_sizewhr/   r  s   &&     r   r   ImageReader.check_pil_image_size  s    ,,!6wwGG1AsFq#a&!3A59:./!DI J J r   c                N    Wn         Ve   ^ RIHp V! V P                  4       R # R # )N)register_reset)r  r  r  set_max_image_size)r  r  r  s   && r   r	  ImageReader.set_max_image_size  s$    ,%:3112 &r   c                @    V P                   pVP                  ^ 4       V# r  )r  seekr  s   & r   r  ImageReader._jpeg_fh  s    WW

	r   c                    R # r%   r   r-   s   &r   r  ImageReader.jpeg_fh  s    r   c                    V P                   e   V P                  f$   V P                  P                  w  V n         V n        V P                   V P                  3# r%   )r  r  r  r  r-   s   &r   getSizeImageReader.getSize  s@    KK4<<#7(,(8(8%DKT\\**r   c                    V P                   Ef|   RV n        V P                  pVP                  ;q n        VR9   d   \	        \
        RR4      P                  R4      '       d   VP                  4        \        VP                  4       VR8X  d   ^M^,          4      V n        VRR pVP                  V4      pW0n        MVR9  d   VP                  R8X  dk   VP                  R8X  dZ   R	VP                  9   dI   VP                  R4      p\        VP                  4       ^,          4      V n        VP                  R4      pMVP                  R4      pRV n        \        VR
4      '       d   VP                  MVP                  ! 4       V n         V P                   #    \!        RT P#                  4       ,          4        R# ; i)z'Return byte array of RGB data as stringNRGBAVERSIONr
  z1.1.7RGBr   Ptransparencytobytesz
identity=%s)LAr  )Lr  CMYK)r  _dataAr  r  r  r   r  loadr  r  convertr  infor  r  tostringrM   r  )r.   r  r  nms   &   r   
getRGBDataImageReader.getRGBData  sO   	?zz!"[[#%77*y=(uYr2==gFF	"-bhhjdFlPQ.R"SDKcrBBB "I!33yy%'BGGSL^rww=VZZ/&1"((*Q-&@ZZ.ZZ. %DI,3B	,B,BbjjSV
::	?odmmo=>s   FF "F=c                J    V P                  4       w  rWV P                  4       3# r%   )r  r$  )r.   widthheights   &  r   getImageDataImageReader.getImageData  s!    doo///r   c                   R V P                   P                  9   dS   V P                   P                  R ,          ^,          pV P                   P                  p VP                  pY!T^,            # R#     TP                  p L     R# ; i; i)r  N)r  r!  paletter  )r.   r  r,  s   &  r   getTransparentImageReader.getTransparent  s|    T[[---;;++N;a?Lkk))G !// Q77  %llG s$   A0 0B
3BBB
B
)r  r  r  r  r  r  r  r  r  r  r  r  r%   )r   r   r   r   r^  _cacher  r   r  r  classmethodr  r	  r  r  r  r$  r)  r-  r   r    r!   s   @r   r  r  h  sq     +FO%ZNP J J 3 3
+
?60 r   r  c                       ] tR tRtRtR# )LazyImageReaderi  r   N)r   r   r   r   r   r   r   r   r2  r2    s    r   r2  c                x     V P                  4       #   \         d    \        T 4      P                  4       u # i ; i)z<Get width, height and RGB pixels from image file.  Wraps PIL)r)  rw  r  )imageFileNames   &r   r)  r)    s9    9))++ 9=)66889s    $99c                      a  ] tR tRt o RtRR ltR tR tR tR t	R	 t
R
 tR tR tR tR tR tR tR tR tR tR tR]R]R]R]/tR tR tR tR tR tRtV tR# ) 	DebugMemoi  au  Intended as a simple report back encapsulator

Typical usages:
    
1. To record error data::
    
    dbg = DebugMemo(fn='dbgmemo.dbg',myVar=value)
    dbg.add(anotherPayload='aaaa',andagain='bbb')
    dbg.dump()

2. To show the recorded info::
    
    dbg = DebugMemo(fn='dbgmemo.dbg',mode='r')
    dbg.load()
    dbg.show()

3. To re-use recorded information::
    
    dbg = DebugMemo(fn='dbgmemo.dbg',mode='r')
        dbg.load()
    myTestFunc(dbg.payload('myVar'),dbg.payload('andagain'))

In addition to the payload variables the dump records many useful bits
of information which are also printed in the show() method.
Nc                x   ^ RI pWn        V'       g   \        P                  V n        M*\	        VR4      '       d   W`n        M\        VR4      V n        VR8w  d   R# / ;V n        p	V'       dN   \        P                  ! 4       R/8w  d4   ^ RIp
\        4       pV
P                  RV4       VP                  4       V	R&   \        P                  ! 4       p\        P                  ! V4      p\        P                  P!                  V4      pT;'       d    \        P                  ! V4      ;'       g    Rp\        P                  P#                  \        P                  P!                  \        P$                  ^ ,          4      4      pRpRp ^ RIpVP)                  \*        P-                  R4      4      pVR,          p\        P.                  p\1        TP3                  4       4      pTP5                  4        T	P7                  / R\8        P:                  ! \8        P<                  ! \8        P8                  ! 4       4      4      bR	\        P>                  bR
\        P@                  bR\C        \        PD                  4      bR\        PF                  bR\        PH                  bR\        PJ                  bR\        P                  bR\        P$                  bRTbRTPM                  4       bRTbRTbR\        PN                  bR\Q        \        RR4      bR\Q        \        RR4      bR\Q        \        RR4      bR\Q        \        RR4      RRPS                  R.T Uu. uF  pT: RTT,          : 2NK  	  up,           4      R \U        \*        4      R!TRT/C4       \        R03\        R133 F8  w  ppT F,  p\	        TT4      '       g   K   \Q        TT4      ! 4       T	T&   K.  	  K:  	  TT8w  d+    T	P7                  R"TR#\        P                  ! T4      /4       T'       dz   \        P                  P#                  \        P$                  ^ ,          4      p\        P                  PW                  T4      '       d!    T\        TR$4      PY                  4       3T	R%&   / p\        PZ                  P]                  4        F  w  ppTR&8X  g&   TR'8X  g   TR(,          R)8X  g   TR*,          R+8X  g   K2  R2 Uu. uF  p\Q        TTR4      NK  	  ppT Uu. uF  pT'       g   K  TNK  	  up'       g   Kr  T^ ,          .TR,,           Uu. uF  pT'       g   K  TNK  	  up,           p\_        T4      TT&   K  	  TT	R-&   / T P                  R.&   T Pa                  T4       R#     EL; iu upi     EK  ; i    EL; i    EL ; iu upi u upi u upi )3r   Nwriter  __tracebackz???zmeta_data.marproject_versiongmtplatformversion
hexversion
executableexec_prefixprefixr  rg  r  hostnamelcwdlpcwd	byteordermaxint
maxunicodez????api_versionversion_infowinverenvironmentz
			r
  rf  r+  project_meta_dataexedlexedr0  __script	reportlabrlextra:N
   Nz
reportlab.:N   Nzrlextra.re  __module_versions	__payload)NNN)getwindowsversiongetfilesystemencoding)unamectermidgetgidgetuidgetegidgeteuidgetlogin	getgroupsgetpgrpgetpidgetppid)__version____path__rp  )1socketr   r5   stdoutr  r|  storerQ  	tracebackr   	print_excgetvaluer   rK  r   r  ro  r@  rg  marshalloadsr+  r~  environri   r,  sortr   timeasctimegmtimer<  r=  r  r>  r?  r@  rA  gethostnamerE  r  r   rO  r   r  r  r   rh   _add) r.   r   r  	getScriptr  capture_tracebackrf  rh  re  rg  rh  rG   r  rC  pcwdrD  rM  r:  mdrk  envKr   Mr   r   module_versionsr  r/   r~   r)   _fs    &&&&&&&,                        r   r   DebugMemo.__init__  s   **DKvg&&$"6#.9f
U3C!C	AQ'#$::<E- IIKzz#wws#))D)22Uwwrwwsxx{;<	}}]33ODEB01O jj
sxxz
	 t||DKK		,DE "CLL!3;; %c#..&9 %cnn	
 &s !#**   s #F$6$6$8    $S]] !'#l6"B &ws='H  'N6(J!" !'#hv">%zt[\<][\VW#a&=Q[\<]7]'^'m)<+R)?+ 	0 BC  CAa 1Q<<#*1Q<>a  9fdGRZZ5EGH !-Bww~~b!!)+DCL,=,=,?(@E*% ;;$$&CAa+~I31E2PZIZ0UV0U1WQq&0UV!")2bBB))1qu!;u""u!;;A).qOA& ' &5!""$

;		"{	, =^ W)!;sT   1V V<V )V +V%  V-<
V2V20
V7?V7VVV"%V*c                f    V P                   R ,          pVP                  4        F	  w  r4WBV&   K  	  R# rU  N)rg  r   )r.   r   payloadr   r)   s   &&   r   rs  DebugMemo._addi  s)    **[)GGIDAAJ r   c                (    V P                  V4       R # r%   )rs  )r.   rh  s   &,r   addDebugMemo.addn  s    		"r   c                    VP                  4       p\        P                  ! V P                  V4       R#    T P                  P	                  4       p\        4       pTP                  4        F1  w  rV \        P                  ! YV/T4       K      R T,          Y5&    K0  ; i	  TP                  X^ 4       \        P                  ! Y14        R# ; i)z<unpicklable object %r>N)tellpickledumprg  copyr   r   r  )r.   r  posSffr   r)   s   &&     r   _dumpDebugMemo._dumpq  s    	CKK

1%		jjooAyBwwy9KKb)94q8AD	 !
 FF3qMKKs!   15 ;C1B	CB0Cc                    \        V P                  R 4      p V P                  V4       VP                  4        R#   TP                  4        i ; i)wbN)r|  r   r  r  r.   r  s   & r   r  DebugMemo.dump  5    	JJqMGGIAGGI	   ; Ac                X    \        4       pV P                  V4       VP                  4       # r%   )r   r  rj  r  s   & r   dumpsDebugMemo.dumps  s     I

1zz|r   c                <    \         P                  ! V4      V n        R # r%   )r  r  rg  r  s   &&r   _loadDebugMemo._load  s    [[^
r   c                    \        V P                  R 4      p V P                  V4       VP                  4        R#   TP                  4        i ; i)rbN)r|  r   r  r  r  s   & r   r  DebugMemo.load  r  r  c                :    V P                  \        V4      4       R # r%   )r  r   )r.   rG   s   &&r   rl  DebugMemo.loads  s    

71:r   c           
        V P                  VR ,          4       \        VP                  4       4      pVP                  4        V F  pW!,          ;rE\	        V\
        4      '       d
   V^ ,          p \        V4       \        P                  V,          p\        VRR4      V8H  ;'       d    R;'       g    RpT P                  RT: RT: RT: R	24       K  	  R#    RpRp L,; i)
   NNrc  NSAME	DIFFERENTz??????unknown??????z   = z ())
_writelnri   r,  rn  r8   rh   
__import__r5   r  r  )r.   r   r)   ry  vkvk0r/   r  s   &&&     r   _show_module_versionsDebugMemo._show_module_versions  s    aeN	AtOB"U##2a5S*1KKNAmD136AA6PP[ MMa156 *)s   08C)	C3CC"c                H    V P                  R V: RVR,          : R24       R# )z###################r  r  z##################N)r  )r.   r   whats   &&&r   _bannerDebugMemo._banner  s    d1R55QRr   c                *    V P                  VR 4       R# )zStart  Nr  r   s   &&r   _startDebugMemo._start      Qy!r   c                *    V P                  VR 4       R# )zFinish Nr  r   s   &&r   _finishDebugMemo._finish  r  r   c                l    V P                  V4       V P                  V4       V P                  V4       R # r%   )r  r  r  r   s   &&&r   _show_linesDebugMemo._show_lines  s$    AaQr   c                    V: R \         P                  P                  V^ ,          4      : 2pV P                  W^,          4       R# )r  N)r   r  basenamer  r   s   &&&r   
_show_fileDebugMemo._show_file  s1    ))!A$/0Q4 r   c                    V'       dD   ^ RI pV P                  V4       VP                  W P                  4       V P                  V4       R# R# r   )pprintr  rf  r  )r.   r   r)   r  s   &&& r   _show_payloadDebugMemo._show_payload  s3    KKNMM!KK(LLO	 r   c           
        R F  p V.P                   p\        V4       \        P                  V,          pV! VP                  4       R F.  p\        W44      '       g   K  V! V: R\        W44      : 24       K0  	  T P                  RRP                  TP                  4      ,           4       K  	  R#    X! R4        LC; i)	_rl_accelrf  z	not foundr  N)r  	_renderPMsgmloppyRXPpyRXPU_imagingr   )rc  r  _versionr=  )
r   r  r5   r  rp  r  r  r  r   __self__)r.   mnr   r/   vns   &    r   _show_extensionsDebugMemo._show_extensions  s    XB	DKK2KKO!**HBq}}R67 I
 MM#chhqzz223 Y+s   AB3 B33
B?rT  rU  r9  rO  c                   \        V P                  P                  4       4      pVP                  4        V FW  pV\        V P                  P                  4       4      9  g   K-  V P                  V:R  RV P                  V,          : 24       KY  	  V FX  pV\        V P                  P                  4       4      9   g   K-  V P                  V,          ! WV P                  V,          4       KZ  	  V P                  4        R# )15r  N)ri   rg  r,  rn  specialsr  r  )r.   ry  r   s   &  r   showDebugMemo.show  s    "#	AT]]//122DMMRSTXT^T^_`TaBb4c AD++-..a0@

ST0V r   c                6    V P                   R ,          V,          # rU  rg  r.   rx  s   &&r   r  DebugMemo.payload      zz+&t,,r   c                0    W P                   R ,          V&   R# r  r  )r.   rx  r[  s   &&&r   r   DebugMemo.__setitem__  s    (-

;%r   c                6    V P                   R ,          V,          # r  r  r  s   &&r   r   DebugMemo.__getitem__  r  r   c                J    V P                   P                  VR ,           4       R# )r{  N)rf  r8  )r.   msgs   &&r   r  DebugMemo._writeln  s    #d(#r   )r   rf  rg  )zrl_dbgmemo.dbgr  r   r   r   N)r   r   r   r   r^  r   rs  r  r  r  r  r  r  rl  r  r  r  r  r  r  r  r  r  r  r  r   r   r  r   r    r!   s   @r   r6  r6    s     2Yv

$7 S""
!4 $%:]{JH
 -.-$ $r   r6  c                 d    V  F)  p\        V4      '       d   \        W!4       K!  V! V4       K+  	  R # r%   )r:   _flatten)r  r   r~   s   && r   r  r    s"    88Xa]d r   c                4    . p\        WP                  4       V# )z'recursively flatten the list or tuple L)r  r   )r  r   s   & r   flattenr    s    
AQxxHr   c                z     V ! \         P                  ! V4      P                  4      pV'       d   V# V^,          pK<  )zPapply func to the locals at each stack frame till func returns a non false value)r5   r   f_locals)r\  depth_s   && r   find_localsr    s.    
u%../Qh
r   c                   ,   a  ] tR tRt o R tR tRtV tR# )_FmtSelfDicti  c                    Wn         W n        R # r%   )obj_overrideArgs)r.   r  overrideArgss   &&&r   r   _FmtSelfDict.__init__  s    )r   c                     V P                   V,          #   \         dK     T P                  P                  T,          u #   \         d    \	        T P                  T4      u u # i ; ii ; ir%   )r  r   r  r  r  r   s   &&r   r   _FmtSelfDict.__getitem__   sa    	+%%a(( 	++xx((++ +txx**+	+s+    A*A A* !A&!A*%A&&A*)r  r  N)r   r   r   r   r   r   r   r    r!   s   @r   r  r    s     *+ +r   r  c                   *   a  ] tR tRt o RtR tRtV tR# )FmtSelfDicti	  z mixin to provide the _fmt methodc                (    \        W4      pW,          # r%   )r  )r.   fmtr  r   s   &&, r   _fmtFmtSelfDict._fmt  s    ,wr   r   N)r   r   r   r   r^  r  r   r    r!   s   @r   r  r  	  s     * r   r  c                 t   . pV! R 4      p. pV) pV P                  4        Fm  pV! V4      pWd,           V,           V8:  g   V. 8X  d#   VP                  V4       Wd,           V,           pKH  VP                  R P                  V4      4       V.pTpKo  	  V. 8w  d!   VP                  R P                  V4      4       V# )r  )r  r   r   )	txtmWSWr  wsOr  r   lts	   &&&      r   _simpleSplitr    s    
A	CB
A	AYY[U47B;!R%HHQKAHHSXXa[!AA  	"uahhsxx{#Hr   c                    a ^ RI Ho \        V 4      P                  R4      pW3V3R llpV'       d)   . pV F  pVP	                  \        WsV4      4       K   	  TpV# )r   )stringWidthr{  c                    < S! WV4      # r%   r   )textfNfSr  s   &&&r   r$  simpleSplit.<locals>.<lambda>#  s    Db0Ir   )reportlab.pdfbase.pdfmetricsr  rU   r  extendr  )	r  fontNamefontSizemaxWidthlinesr  r  lr  s	   &&&&    @r   simpleSplitr     sQ    8dO!!%(E!	IBAHH\!R01 Lr   c                    ^ RI Hp V f   V # \        V 4      '       d   V P                  R4      pV! V 4      p V P	                  RR4      p V P	                  RR4      p V P	                  RR4      p V # )	zEscapes once only)escaperA   	&amp;amp;&amp;&amp;gt;&gt;&amp;lt;&lt;)xml.sax.saxutilsr  rC   rT   r  )r  r  rG   s   &  r   escapeTextOncer  +  sc    '|t}}$++f-a$<D<<X.D<<W-D<<W-DKr   c                     \        V 4      '       d   V # \         F  p V P                  V4      u # 	  \        R V ,          4      h    K0  ; i)z(cannot convert %r to filesystem encoding)ra   fsEncodingsrT   r  )r   rP   s   & r   fileName2FSEncr  7  sJ    }}
Cyy~% 
 ?"D
EEs   AA
c                    \         P                  ! R.V R.4      p\         P                  ! V^4      w  r#p V! V4       V! V4       V! V4       \	        W#V4      #   \         d     Li ; i)a  
Loop over a collection with look-ahead and look-back.

From Thomas Guest, 
http://wordaligned.org/articles/zippy-triples-served-with-python

Seriously useful looping tool (Google "zippy triples")
lets you loop a collection and see the previous and next items,
which get set to None at the ends.

To be used in layout algorithms where one wants a peek at the
next item coming down the pipe.

N)	itertoolschainteeStopIterationzip)r   r  prevthisnexts   &    r   prev_this_nextr(  C  sl      __dVUTF3F }}VQ/DT
T
T
 t4    s   A A('A(c                   \        V 4      '       d   V P                  R4      p \        V 4      ^,
          pV R,          p ^ pR.pW!8:  d   W,          R8X  df   W^,           ,          R8X  d    VR;;,          R,          uu&   V^,          pMMVR,          P                  4       VR&   W!8w  d   VP	                  R4       MVR;;,          W,          ,          uu&   V^,          pK  VR,          P                  4       VR&   V# )a  
Splits the string s at every unescaped comma and returns the result as a list.
To escape a comma, double it. Individual items are stripped.
To avoid the ambiguity of 3 successive commas to denote a comma at the beginning
or end of an item, add a space between the item seperator and the escaped comma.

>>> commasplit(u'a,b,c') == [u'a', u'b', u'c']
True
>>> commasplit('a,, , b , c    ') == [u'a,', u'b', u'c']
True
>>> commasplit(u'a, ,,b, c') == [u'a', u',b', u'c']
rA   r  r
  r  r  )rC   rT   r   r   r   )rG   r  r[   r0  s   &   r   
commasplitr*  ]  s     qzzqxx'1AqAIA	A
eA
$4:1vt|"tQ""4#bEQTME	1bEKKMAbEHr   c           
         RP                  V  Uu. uF,  pR\        V4      P                  RR4      ,           R,           NK.  	  up4      # u upi )am  
Inverse of commasplit, except that whitespace around items is not conserved.
Adds more whitespace than needed for simplicity and performance.

>>> commasplit(commajoin(['a', 'b', 'c'])) == [u'a', u'b', u'c']
True
>>> commasplit((commajoin([u'a,', u' b ', u'c'])) == [u'a,', u'b', u'c']
True
>>> commasplit((commajoin([u'a ', u',b', u'c'])) == [u'a', u',b', u'c'] 
r  r  z,,)r   rU   r  )r  r[   s   & r   	commajoinr,  }  sF     99PQSPQ1til224??$FFPQSTTSs   2A	c                   T;'       d#    \         P                  P                  ;'       g    \         P                  P                  pV! V 4      '       d   V # \         P                  P                  p\         P                  P                  V 4      '       g$   V F  pV! W`4      pV! V4      '       g   K  Vu # 	  V'       d   \        RV : RV: 24      hV # )z*search for relative files in likely placeszcannot locate z with paths=)r   r  r   r   r   r  r  )r   pathsr   failexistsr#  rB  r'  s   &&&&    r   findInPathsr1    s    &&77"''--Fbzz"9GGLLE77==A+Cc{{
  :"UKLLIr   c                    \         P                  ! 4       w  rEp\        WD! VP                  R V \	        V4      V3 4       4      4      V4       R# )z,add msg to the args of an existing exceptionc              3   8   "   T F  q'       g   K  Vx  K  	  R # 5ir%   r   .0r  s   & r   	<genexpr>$annotateException.<locals>.<genexpr>  s     B(<1QQ(<s   	
N)r5   rQ  r   r   r=   )r  rP   postMsgr  r   r)   r   s   &&&&   r   rM   rM     s<    
,,.EAq388BSVG(<BCDQGr   c                &   V P                  RR4      p V P                  RR4      p V P                  RR4      p V P                  RR4      p V P                  RR	4      p V P                  RR4      p V P                  RR4      p V P                  RR4      p V # )
zEnsure XML output is escaped just once, irrespective of input

>>> escapeOnce('A & B')
'A &amp; B'
>>> escapeOnce('C &amp; D')
'C &amp; D'
>>> escapeOnce('E &amp;amp; F')
'E &amp; F'

&r  r  r  r  r  r  z&amp;#z&#)r  )r  s   &r   
escapeOncer;    s     <<W%D
 <<W-D<<
F+D<<
F+D<<$'D <<W-D<<
F+D<<
F+DKr   c                   *   a  ] tR tRt o RtR tRtV tR# )IdentStri  z,useful for identifying things that get splitc                    \        V\        4      '       d6   VP                  pVR ^\        \	        V4      4      ,           )  pV^,          pM^ pVRV,          ,          p\        P                  W4      pW#n        V# )Nz[%d])r8   r=  _IdentStr__incr   r=   __new__)r  r[  incr.   s   &&  r   r@  IdentStr.__new__  sh    eH%%++C-Qs3s8}_-.E1HCC#{{3%
r   )__incNr   r   r   r   r^  r@  r   r    r!   s   @r   r=  r=    s     6
 
r   r=  c                   *   a  ] tR tRt o RtR tRtV tR# )RLStringi  zallows specification of extra properties of a string using a dictionary of extra attributes
eg fontName = RLString('proxima-nova-bold',
                svgAttrs=dict(family='"proxima-nova"',weight='bold'))
c                z    \         P                  W4      pVP                  4        F  w  rA\        W4V4       K  	  V# r%   )r=   r@  r   r   )r  r)   r   r.   r   s   &&,  r   r@  RLString.__new__  s1    {{3!::<CAD1  r   r   NrD  r!   s   @r   rF  rF    s      r   rF  c                J    \        V 4      '       g   V P                  R4      p V # )zEforce filename strings to unicode so python can handle encoding stuffrA   )ra   rT   rF   s   &r   makeFileNamerJ    s    Q<<HHVHr   c                   <   a  ] tR tRt o RtR tR tR tR tRt	V t
R# )	FixedOffsetTZi  z&Fixed offset in minutes east from UTC.c                J    \         P                  ! WR 7      V n        W0n        R# ))hoursminutesN)datetime	timedelta_FixedOffsetTZ__offset_FixedOffsetTZ__name)r.   r  r/   rx  s   &&&&r   r   FixedOffsetTZ.__init__  s     **@r   c                    V P                   # r%   )rR  r.   dts   &&r   	utcoffsetFixedOffsetTZ.utcoffset  s    }}r   c                    V P                   # r%   )rS  rV  s   &&r   tznameFixedOffsetTZ.tzname  s    {{r   c                .    \         P                  ! ^ 4      # r  )rP  rQ  rV  s   &&r   dstFixedOffsetTZ.dst  s    !!!$$r   )__name__offsetN)r   r   r   r   r^  r   rX  r[  r^  r   r    r!   s   @r   rL  rL    s!     0% %r   rL  c                   J   a  ] tR tRt o RR lt]R 4       t]R 4       tRtV t	R# )	TimeStampi  Nc                Z   Vf   ^ RI Hp \        P                  P	                  RR4      P                  4       pV'       g	   V'       d7   V'       d   \        V4      MRp\        P                  ! V4      p^ ;rERV n	        M}\        P                  ! 4       p\        P                  ! V4      p\        V4      p\        VP                  R,          4      pVP                  R,          ^<,          pVP                  V n	        W n        W0n        \        V4      R,          V n        W@n        WPn        R # )	N)	invariantSOURCE_DATE_EPOCHr
  g   6AUTCg      @i  :N   N)r  re  r   rm  r   r   rg   ro  rq  r[  	localtimerh   	tm_gmtofftm_zoner   r  YMDhmsdhhdmm)r.   re  r   r  rm  rn  
local_times   &&     r   r   TimeStamp.__init__  s    5JJNN.r288:AAQBMCDK		A*Jz"Bj**f56C''$."4C$,,DKBimr   c                   V P                   '       dT   \        P                  P                  V P                  \	        V P
                  V P                  V P                   4      4      # \        P                  P                  4       # r%   )r[  rP  fromtimestampr   rL  rm  rn  nowr-   s   &r   rP  TimeStamp.datetime  sX    ;;;$$22466-QUQYQYZ^ZeZe:fgg$$((**r   c                B    \         P                  ! V P                  4      # r%   )ro  rp  r  r-   s   &r   rp  TimeStamp.asctime  s    ||DGG$$r   )rl  rm  rn  r  r   r[  r%   )
r   r   r   r   r   propertyrP  rp  r   r    r!   s   @r   rc  rc    s2     , + + % %r   rc  c                J   \        V4      '       g   \        R\        V 4      : RV: 24      h\        V4      pVP	                  4       pV'       g   \        R\        V 4      ,          4      hV'       d   V^ ,          R9  d   RMRp\        RV: V: 2/ \        V R7      R7      # )	z/Can call down into e.g. object1.object2[4].attrzinvalid recursive access of rG  zempty recursive access of %sz[.(r
  r  )r  )gr  )r^   ra  rO  rY   r   r  r
   rj   )r  rx  ry  dots   &&& r   recursiveGetAttrr{    sw    ;;itTWyY](^__D>D::<Dz"@49"LMM$q'.#BC3t,dsmDDr   c                    VP                  R4      p\        V4      ^8X  d   \        WV4       R# RP                  VRR 4      pVR,          p\	        W4      p\        WeV4       R# )z7Can call down into e.g. object1.object2[4].attr = valuerG  Nr  )r  r   r   r   r{  )r  rx  r[  tokensmostlastparents   &&&    r   recursiveSetAttrr    sX     ZZ_F
6{a5!xxs$bz!#,e$r   c                     VP                  R 4      p\        V4      ^8X  d   \        W4       R# R P                  VRR 4      pVR,          p\	        W4      p\        WT4       R# )rG  Nr  )r  r   delattrr   r{  )r  rx  r}  r~  r  r  s   &&    r   recursiveDelAttrr    sR    ZZ_F
6{axxs$bz!#,r   c              #     "   ^ p\        V 4      pW8  d/    V P                  RV4      pWV x  V^,           pV '       g   R# K4  R#   \         d    YR x   R# i ; i5i)z:yield sublists of L separated by None; the Nones disappearN)r   indexr  )r  r[   r  js   &   r   yieldNoneSplitsr  '  sf     	AAA
#	QAa&L!Ae1   	B%K	s(   A)A  AAAAAc                 P    R P                  R V P                  R 4       4       4      # )r{  c              3   @   "   T F  qP                  4       x  K  	  R # 5ir%   )lstripr4  s   & r   r6  _rl_docdent.<locals>.<genexpr>6  s     8-Qhhjj-s   )r   r  rF   s   &r   _rl_docdentr  5  s    998!''$-899r   c                   F   a  ] tR tRt o R	R ltR tR tR tR
R ltRt	V t
R# )
KlassStorei8  c                     Wn         / V n        R # r%   limrg  )r.   r  s   &&r   r   KlassStore.__init__9  s    
r   c                   \        V\        4      '       d   \        V\        4      '       g:   \        V P                  P
                   R \        V4      \        V4      3 R24      hV P                  pW#V&   \        V4      V P                  8  d3   \        VP                  4       4      RV P                  )   F  pW4 K  	  R# R# )z%.add takes (str,type) arguments not (r  N)r8   r=   r&   r  ru  r   rg  r   r  ri   r,  )r.   r   r)   rg  r  s   &&&  r   r  KlassStore.add=  s    1S!!j4&8&8 7 788]^bcd^efjklfm^m]nnopqq

au:txx%**,'
$((3H 4  r   c                    WP                   9   # r%   r  r   s   &&r   r   KlassStore.__contains__F  s    JJr   c                (    V P                   V,          # r%   r  r   s   &&r   r   KlassStore.__getitem__I  s    zz!}r   Nc                8    V P                   P                  W4      # r%   )rg  r   )r.   r   defaults   &&&r   r   KlassStore.getL  s    zz~~a((r   r  )   r%   )r   r   r   r   r   r  r   r   r   r   r    r!   s   @r   r  r  8  s#     ) )r   r  )rA   r%   )z.ttf)oglezBMP )r  r   )r  GIFf)r  r   )ttxtr   )r  PNGf)r  z.PPM)r  r   )CAROzPDF )MSIETEXT)NNr   )NN)Nr   r   r  )r   r  r   )rA   r
  r  )rc  r^  r   r  r5   ro  ro   rP  rM  astr   r  r   r   r   r   ior   hashlibr   reportlab.lib.rltempfiler   r   r
   r	   r   r   PILr   r   r<  python_implementationisPyPyr'   r+   r&   r/   r3   r6   rh   ri   r:   r>   rn   r=   rL   strTypesrH   rQ   rU   rW   rY   r\   r^   rC   ra   rd   r   r   r   r   r   r   r   r   r  rl_execr   r   r   r   r   rj   r   rx  r   r  r   r  rP  r  ro  rp  __RL_DIRr  r@  r/  rg  r.  r(  r   r+  r7  NotImplementedErrorr?  rA  archiver  r  r  r  r  r   r  r  rK  r  r   r   r1  r   splitextr<  r8  r:  r=  rC  rL  rW  
haveImagesrY  rk  rs  ry  r  urllib.parser  r  urllib.requestr  r  r  r  r  r  r  r   r  r   r  getmtimemktimer  r  r  r  r  r  r  r2  r)  r6  r  r  r  r  r  r  r  r  r  r   r(  r*  r,  r1  rM   r;  r=  rF  rJ  tzinforL  rc  r{  r  r  r  r  r  r   r   r   <module>r     s   D 8 8 8 8  W   D ^ ^   K	++-v5F'  qss)   t  $Z;XPRT & P""SS>: 
(6
"\
6.T 6.p 77e 
N 
 	++	,
h,,HII0I 1MF=))!"G-"WXXww 0 01F1F GHHRVV#K''//(+K 266)N%NN+ +#1% +%'WW%5%5%'WW%5%5 ii66!$RVV(.& "YYwVXV]V]VbVb  	'

I
IRWW^^BGG$4$4X$>q$A5$HIB  'y1D\R ,=\ $
 *X + +9
8$t0 !# 3 !ggmmRWW=M=M c !#rww?O?O[][e[e R #%''.."''BRBRdfdkdkdtdt  BF  BM  BM 	j -0&*@ @D	k 	9t$ t$l
+ + "	
	F !4@UH
6s 	s 	%HOO %  %  %DE
%:) )u(F^xx{HZWW^^H%FM!YY s+   'U; V (V   D,V  ;VV 2W