
    xZi                        S r SSKJr  SSKrSSKJr  SSKJrJrJ	r	J
r
JrJrJrJrJrJrJrJrJrJrJrJrJr  SSK7  Sr\	\\\\\\\\
\0rSr\SS	 rS
r\\\\\\\\S.r/ SQrS r SS jr! " S S\"5      r# " S S\\#5      r$S r%S r& " S S\\#5      r'0 SS_SS_SS_SS_SS_SS _S!S"_S#S$_S%S&_S'S(_S)S*_S+S,_S-S._S/S0_S1S2_S3S4_S	S5_0 S6S7_S8S9_S:S;_S<S=_S>S?_S@SA_SBSC_SDSE_SFSG_SHSI_SJSK_SLSM_SNSO_SPSQ_SRSS_STSU_SVSW_ESXSYSZ.Er(SS\4SS/\	4S1S@\4S[S\\4SBSP\	4SRSV\4S]S]\	4S^S^\
4S_S`\4SaSb\	4ScSd\	4SeSf\4/r)0 r*\) H  u  r+r,r-\." \+\,S-   5       H  r/\-\*\/'   M
     M!     C+C,C-C/\0" Sg5      r10 r2\1\1Rg                  5       -    H  r4S\2\4'   M
     C4C10 r5\0" Sh5       H  r4S\5\4'   M
     \0" S5      S\0" Si5      S\0" Sj5      S0r6\0" S,5      S\0" SX5      S\0" S5      S\0" Sk5      S\0" Sl5      S\0" SY5      S0r7\Rp                  " Sm5      Rr                  r:Sn r;\4So jr<Sp r=Sq r>Sr r?Ss r@St rASu rBSv rCSw rD " Sx Sy\\#5      rE " Sz S{\\#5      rF " S| S}\\#5      rG " S~ S\\#5      rH " S S\5      rIg)z$
Module for formatting information.
    )print_functionN)unpack   )FDTFGEFNUFTXFUNXL_CELL_DATEXL_CELL_NUMBERXL_CELL_TEXT	XL_FORMAT
XL_FORMAT2
BaseObject	XLRDErrorfprintfunpack_stringunpack_unicodeupkbitsupkbitsL)*)8r   r   r      r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r      r   r   r   r"   r   r   r   r"   r"   r"   r   r"   r   r"   r   r"   r"      r)   r)   r"   r"   r"      r,   r   r,   3   f   r   r      r1   r   r   r/   r   r/   r   r"   r"   r   r/   r1   r1   r1   r   r$   r   r   r    r&   r!   r'   r   r   r1   r   r2   r1   r   r1   r   r   r,   r,   r1   r   r   r,   r1   r1   r,   r   )   r=   r=   r.   r/   r   r.   r1   r1   r,   r1   r   r   r1   r   r   r,   r   r   r/   r   r/   r/   r,      rF   rF   r   r.   r/   r.   r,   r/   r   r.   r   r.   r.   r   r,   r.   r   r-   r.   r.   r,   r.   r.   r.      )8r   r   r   r   r   r   r   r    r!   r#   r$   r%   r&   r'   r(   r*   r+   r-   r0   r2   r3   r4   r5   r6   r$   r   r   r    r&   r!   r'   r   r7   r2   r8   r9   r:   r;   r<   )r   r1   r,   r>   r?   r@   rA   rB   rC   rD   rE   rG   rH   rI   rJ   rK   r-   rL   rM   )P   F   2   -   (            )
Normal	RowLevel_	ColLevel_CommaCurrencyPercentz	Comma [0]zCurrency [0]	HyperlinkzFollowed Hyperlinkc                    0 U l         0 U l        U R                  (       d  g [        S5       H  n[        U   U R                   U'   M     [
        U R                     n[        U5      n[        U5       H  nX!   U R                   US-   '   M     S U R                   US-   '   S U R                   US-   S-   '   S U R                   S'   S U R                   S'   g )N   r   Q     )
colour_mapcolour_indexes_usedformatting_infoxrangeexcel_default_palette_b8default_palettebiff_versionlen)bookidpalndpals       i/var/www/eduai.edurigo.com/question_generate/ques_gen_env/lib/python3.13/site-packages/xlrd/formatting.pyinitialise_colour_mapro   i   s    DO!DAY5a8  4,,-DIEE]#w!   $DOOE!G!%DOOE!GAI DOOD"DOOF    c                     SnSnU R                  5        H?  u  pVUc  M
  Sn[        X5       H  u  pXxU	-
  X-
  -  -  nM     Xs:  d  M3  UnUnUS:X  d  M?    O    U$ )z
General purpose function. Uses Euclidean distance.
So far used only for pre-BIFF8 ``WINDOW2`` record.
Doesn't have to be fast.
Doesn't have to be fancy.
i   r   )itemszipprint)
rb   rgbdebugbest_metricbest_colourxcolourxcand_rgbmetricv1v2s
             rn   nearest_colour_indexr~      s}      KL'--/#(FBBw27++F ) K"L{ 0 	 rp   c                   $    \ rS rSrSrS rS rSrg)	EqNeAttrs   z
This mixin class exists solely so that :class:`Format`, :class:`Font`, and
:class:`XF` objects can be compared by value of their attributes.
c                 4    U R                   UR                   :H  $ N__dict__selfothers     rn   __eq__EqNeAttrs.__eq__       }}..rp   c                 4    U R                   UR                   :g  $ r   r   r   s     rn   __ne__EqNeAttrs.__ne__   r   rp    N)__name__
__module____qualname____firstlineno____doc__r   r   __static_attributes__r   rp   rn   r   r      s    
//rp   r   c                   `    \ rS rSrSrSrSrSrSrSr	Sr
SrSr\" S5      rSrSrSrSrSrSrSrg)Font   z
An Excel "font" contains the details of not only what is normally
considered a font, but also several other display attributes.
Items correspond to those in the Excel UI's Format -> Cells -> Font tab.

.. versionadded:: 0.6.1
r      r   N)r   r   r   r   r   boldcharacter_setcolour_index
escapementfamily
font_indexheightitalicUNICODE_LITERALname
struck_outunderline_type
underlinedweightoutlineshadowr   r   rp   rn   r   r      su     D. M L J F J F F 2D J N J F G Frp   r   c                 j    U R                   (       d  g [        SU5      S   U R                  S   l        g )N<Hr   )rd   r   	font_listr   )rj   datas     rn   handle_efontr      s+    &,T4&8&;DNN2#rp   c           	         U R                   (       d  g U R                  (       d  U R                  5         [        =(       d    U R                  S:  nU R
                  n[        U R                  5      nUS:X  a@  [        5       n[        S5      Ul
        XEl        U R                  R                  U5        US-  n[        5       nXEl        U R                  R                  U5        US:  a  [        SUSS 5      u  Ul        oel        Ul        Ul        Ul        Ul        Ul        US-  Ul        US-  S-	  Ul        US-  S-	  Ul        US	-  S
-	  Ul        US-  S-	  Ul        US-  S-	  Ul        US:  a  [7        USSS9Ul
        GO[9        USU R                  SS9Ul
        GOyUS:  a  [        SUSS 5      u  Ul        oel        US-  Ul        US-  S-	  Ul        US-  S-	  Ul        US	-  S
-	  Ul        US-  S-	  Ul        US-  S-	  Ul        [9        USU R                  SS9Ul
        SS/UR*                     Ul        SUl        UR.                  Ul        SUl        SUl        O[        SUSS 5      u  Ul        nSUl        US-  Ul        US-  S-	  Ul        US-  S-	  Ul        US	-  S
-	  Ul        SUl        SUl        [9        USU R                  SS9Ul
        SS/UR*                     Ul        SUl        UR.                  Ul        SUl        SUl        U(       a)  UR;                  U R<                  SUR                  -  SS9  g g )N      z
Dummy Fontr   rQ   z	<HHHHHBBBr      r_      rN          rO      lenlenrT   z<HHH   r   i  z<HHra   z--- handle_font: font[%d] ---z-------------------headerfooter)rd   encodingderive_encodingDEBUG	verbosityrh   ri   r   r   r   r   r   appendr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   dumplogfile)rj   r   blahbvkfoption_flagss          rn   handle_fontr     s&   =='DNNa'D			BDNNAAvF .a 	QALNN!	Rx
 ;Qr
+		
HlNAHL!*AHO! 1$*$q(Q.$q(Q.!B&1,	 2%!+8#D"Q7AF"4T]]1EAF	r17Qq	1J.,! 1$*$q(Q.$q(Q.!B&1,	 2%!+tQa@:aff%<<!'tAay!9,! 1$*$q(Q.$q(Q.	tQa@:aff%<<	LL2Q\\A( 	 	
 rp   c                   6    \ rS rSrSrSr\r\" S5      r	S r
Srg)FormatiL  zP
"Number format" information from a ``FORMAT`` record.

.. versionadded:: 0.6.1
r   r   c                 (    Xl         X l        X0l        g r   )
format_keytype
format_str)r   r   tyr   s       rn   __init__Format.__init__d  s    $	$rp   )r   r   r   N)r   r   r   r   r   r   r
   r   r   r   r   r   r   rp   rn   r   r   L  s&     J D !$J%rp   r   General0r   z0.00r   z#,##0r   z#,##0.00r   z$#,##0_);($#,##0)r   z$#,##0_);[Red]($#,##0)   z$#,##0.00_);($#,##0.00)r_   z$#,##0.00_);[Red]($#,##0.00)	   z0%
   z0.00%   z0.00E+00   z# ?/?r   z# ??/??r   zm/d/yy   zd-mmm-yyzd-mmm   zmmm-yy   z
h:mm AM/PM   zh:mm:ss AM/PMrV   zh:mmrU   zh:mm:ss   zm/d/yy h:mm%   z#,##0_);(#,##0)&   z#,##0_);[Red](#,##0)'   z#,##0.00_);(#,##0.00)rS   z#,##0.00_);[Red](#,##0.00))   z'_(* #,##0_);_(* (#,##0);_(* "-"_);_(@_)*   z*_($* #,##0_);_($* (#,##0);_($* "-"_);_(@_)+   z/_(* #,##0.00_);_(* (#,##0.00);_(* "-"??_);_(@_),   z2_($* #,##0.00_);_($* (#,##0.00);_($* "-"??_);_(@_)rR   zmm:ss.   z	[h]:mm:ss/   zmm:ss.0z##0.0E+0@)0   1      $   r   r   rQ   :   ;   >   C   rP   G   r`   ymdhsz$-+/(): #?GENERALgeneralz	\[[^]]*\]c                 "   SnSnU Ho  nUS:X  a4  U[        S5      :X  a  SnOBU[        S5      ;   a  SnO0U[        ;   a  O%X4-  nO US:X  a  U[        S5      :X  a  SnOUS:X  a  SnSUs=::  a	  S::  a  Ml   e   e   U R                  S:  a   [        S[	        U5      -  U R
                  S	9  [        SU5      nU[        ;   a  g
SnSnSnS=pxU H<  nU[        ;   a  U[        U   -  nM  U[        ;   a  U[        U   -  nM3  XE:X  d  M:  SnM>     U(       a  U(       d  gU(       a  U(       d  g
U(       a-  U R                  (       a  [        U R
                  SXxU5        Xx:  $ U(       d(  U R                  (       a  [        U R
                  SU5        Xx:  $ )Nr   r   "r   z\_*r   r   z+is_date_format_string: reduced format is %sfileF;Tz7WARNING *** is_date_format: ambiguous d=%d n=%d fmt=%r
z/WARNING *** format %r produces constant result
)r   skip_char_dictr   rt   REPRr   fmt_bracketed_subnon_date_formatsdate_char_dictnum_char_dictr   )	rj   fmtstatesc	separatorgot_sep
date_count	num_counts	            rn   is_date_format_stringr    s    E
AA:OC((of--n$aZOC((aZEEQ! " ~~;d1gEDLLY"a AEIGJ.++J-q))I^G  )>>DLLJs, !! >>DLLB !!rp   c                    SnU R                   nU[        :X  a  [        US5      nU R                  (       d  U R	                  5         SnUS:  a  [        SUSS 5      S   nOU R                  nUS::  a  SnU =R                  S-  sl        US:  a  [        US5      nO[        XU R                  SS9nU=(       d    U R                  S	:  nU(       a#  [        U R                  S
U R                  XfU5        U R                  U5      n	[        [        /U	   n
US:  dl  US:  df  [        R!                  U["        5      nU[        :H  nU R                  (       a2  SUs=:  a  S:  a%  O  O"X-  (       a  Sn[        U R                  SXg5        US:X  a  [        U R                  SU
WX5        [%        XjU5      nU(       a+  UR'                  U R                  SU R                  S-
  4-  S9  XR(                  U'   U R*                  R-                  U5        g )Nr   rT   r   rQ   r   r   rO   r   r   z)FORMAT: count=%d fmtkey=0x%04x (%d) s=%r
   zHWARNING *** Conflict between std format key %d and its format string %r
z2ty: %d; is_date_c: %r; is_date_s: %r; fmt_strg: %rz--- handle_format [%d] ---)r   )rh   r   minr   r   r   actualfmtcountr   r   r   r   r   r  r   r   std_format_code_typesgetr
   r   r   
format_mapformat_listr   )r   r   rectyper   r   strposfmtkeyunistrgr   	is_date_sr   std_ty	is_date_cfmtobjs                 rn   handle_formatr  
  s   E			B*R[==F	Rxd1Qi(+$$8F1	Rx q)dmmAF'DNNa'D8	: **73I
sI	BC<27 '**637cM	>>a&o2o93HEDLL?! z@	9	/ F(FDLL/43F3Fq3H2KK 	 	M$OOFF#rp   c                 4   U R                   (       d  g [        =(       d    U R                  S:  n[        SUS S 5      u  nSU R                  S:     n[        (       d  U R                  S:  a  X4:w  a  [        U R                  SXC5        OU(       a  [        U R                  SU5        SU-  nS	U-  S-   n[        U5      nS	nXgs=::  a  Xh-   ::  d  O  [        S
Xg4-  5      e[        XQS U 5      n	U R                  / :X  d   e[        U5       H  n
X   nUS-  nUS-	  S-  nUS-	  S-  nU R                  SU
-      nXU4nU R                  R                  U5        UU R                  SU
-   '   U(       d  Mh  UU:w  d  Mp  [        SXU4-  U R                  S9  M     g )Nr   r   )rN   8   rQ   r   z9NOTE *** Expected %d colours in PALETTE record, found %d
zPALETTE record with %d colours
z<xx%dir   z0PALETTE record: expected size %d, actual size %dr   r_   rN   z%2d: %r -> %rr   )rd   r   r   r   rh   r   r   ri   r   palette_recordre   rb   r   rt   )rj   r   r   	n_coloursexpected_n_coloursr  expected_sizeactual_size	tolerancecoloursrk   r  redgreenblueold_rgbnew_rgbs                    rn   handle_paletter,  >  s   'DNNa'Dd2Ah'JI!$"3"3r"9:1$)*IH	+ 
.		;
Y
C	MA%Md)KID=+DDJmMiijjS~./G"$$$ IJDqD bD //!A#&t$""7+&!4'!oW(==DLLQ rp   c                    U R                    H  nUR                  S:X  a  M  UR                  nUS:X  a  M)  X R                  ;   a  SU R                  U'   MI  U R
                  (       d  M\  [        S[        U R                  5      U R                  S9  [        U R                  SUR                  UR                  U5        M     U R
                  S:  a;  [        U R                  R                  5       5      n[        SU-  U R                  S9  g g )Nr   ra   r   zSize of colour table:r   z2*** Font #%d (%r): colour index 0x%04x is unknown
z
Colour indexes used:
%r
)r   r   r   rb   rc   r   rt   ri   r   r   r   sortedkeys)rj   fontcxuseds       rn   palette_epiloguer3  b  s     ??a< +,D$$R(^^^)3t+?dllSDLL"WB0  ~~d..3356,t3$,,G rp   c           	         U R                   (       d  g [        =(       d    U R                  S:  nU R                  n[	        SUS S 5      u  pEnUS-  nUS:X  a  SU R
                  ;  a  SnSnSnSn	S	nOUS
-  (       a-  Sn[        U   n	SUs=::  a  S::  a  O  OcU	[        US-   5      -  n	OQSnSnSnUS:  a   [        USSS9n	O[        USU R                  SS9n	U(       a  U	(       d  [        SU R                  S9  X4U R
                  U	'   U(       a  [        U R                  SXXVU	5        g g ! [         a<    [        SXXV4-  U R                  S9  [        S[        USS  5      U R                  S9  e f = f)Nr   z<HBBr     s       rW   r   r   r   i   rO   r   z6STYLE: built_in=%d xf_index=%d built_in_id=%d level=%dr   z
raw bytes:z7WARNING *** A user-defined style has a zero-length namez?STYLE: built_in=%d xf_index=%d built_in_id=%d level=%d name=%r
)rd   r   r   rh   r   style_name_mapbuilt_in_style_namesstrr   UnicodeDecodeErrorrt   r   reprr   r   r   )
rj   r   r   r   flag_and_xfxbuilt_in_idlevelxf_indexbuilt_inr   s
             rn   handle_styler@  v  s   'DNNa'D			B'-fd2Ah'?$Luf$H{xt/B/BB 		#K0 q C	N"D 8%dAa8 !q$--BDKRVR^R^_!) 4D`D	:  & N;>?EI\\SlDabNF	s   7D- -AE3c                 j   [        UR                  R                  5       5      nU H  u  pE[        US5      (       a  [	        XU5        M$  UR                  S5      S:  d  M;  XPR                  ;   a  SU R                  U'   M[  UR                  R                  n[        SX&XE4-  U R                  S9  M     g )Nr   r   r   r   z&*** xf #%d : %s.%s =  0x%04x (unknown)r   )r.  r   rr   hasattrcheck_colour_indexes_in_objfindrb   rc   	__class__r   rt   r   )rj   obj
orig_indexalistattrnobjonames          rn   rC  rC    s    3<<%%'(E
4  'J?YY~&!+&12((.MM**E:d128<F rp   c                     [         R                  5        HL  nXR                  ;  d  M  [         U   n[        R	                  U5      n[        XU5      nX@R                  U'   MN     g r   )r  r/  r  std_format_stringsr  r   )rj   xr   fmt_strr  s        rn   fill_in_standard_formatsrP    sS    "'')OO#&q)B ),,Q/GA7+F!'OOA *rp   c                    [         =(       d    U R                  S:  nU R                  n[        5       n[	        5       Ul        SUR
                  l        SUR
                  l        SUR
                  l        [        5       Ul
        SUR                  l        SUR                  l        SUR                  l        SUR                  l        [        5       Ul        [#        5       Ul        US:  a  U R&                  (       d  [)        U 5        US:  Ga  Sn[+        XQSS 5      u
  Ul        Ul        notR
                  l        npp[3        UR$                  US5        [3        XFS5        [3        UR
                  US	5        [3        UR
                  US
5        U	S-	  n/ SQnU H   nSU-   S-   n[5        UUUS-  5        US-  nM"     [7        UR                  U
S5        [3        UR                  US5        [7        UR                   US5        [3        UR                   US5        GOUS:  a  Sn[+        XQSS 5      u  Ul        Ul        nnnp[3        UR$                  US5        [3        XFS5        [3        UR
                  US	5        US-  n/ SQU   UR
                  l        US-	  n/ SQnU H   nSU-   S-   n[5        UUUS-  5        US-  nM"     [7        UR                   U
S5        [7        UR                  U
S5        [3        UR                  US5        GOUS:  a  Sn[+        XQSS 5      u  Ul        Ul        nnn	nn[3        UR$                  US5        [3        XFS5        [3        UR
                  US5        US-  S-	  n/ SQU   UR
                  l        U	S-	  n/ SQnU H   nSU-   S-   n[5        UUUS-  5        US-  nM"     [3        UR                   US 5        [7        UR                  US!5        GO'US":X  a  S#n[+        XQSS 5      u  Ul        Ul        nn	nnn[3        UR$                  US5        [3        UUS$5        [3        UR
                  US%5        [3        UUS&5        U	S-	  n/ SQnU H   nSU-   S-   n[5        UUUS-  5        US-  nM"     [3        UR                   US 5        [7        UR                  US!5        SUR
                  l        SUR
                  l        GO6US':X  Ga!  [+        S(U5      u  Ul        nnUS)-  Ul        [3        UR$                  US*5        [3        UR
                  US+5        S, HO  u  nnUU-  (       a  S-u  nnOS.u  nn[5        UR                  US/-   U5        [5        UR                  US0-   U5        MQ     UR                   nUS1-  (       a  S2Ul        OSUl        S3Ul        S4Ul        SUl         SUR
                  l        SUR
                  l        / SQnU H  nSU-   S-   n[5        UUS5        M     O[C        S5U-  5      e[E        U RF                  5      Ul$        U RF                  RK                  U5        U =R&                  S-  sl        U(       a(  URM                  U RN                  S6URH                  -  S7S89   U RP                  UR.                     n[R        URT                     n U U RZ                  URH                  '   U R\                  (       av  U R                  (       aO  UR^                  (       a>  UR@                  S9:w  a.  S:n![a        U RN                  U!URH                  UR@                  5        [c        XURH                  5        UR.                  U RP                  ;  aR  S;n!U R                  (       a7  [a        U RN                  U!URH                  UR.                  UR.                  5        SUl        g g ! [V         a
    [X        n  GN f = f)<Nr   r   rQ   rO   z<HHHBBBBIiHrV   ))r   r   cell_locked)r   r   formula_hidden)r   r   is_styler   r_   lotus_123_prefixr   i  parent_style_index)r   r   	hor_alignr   r_   text_wrapped)r   p   
vert_align))r   r   indent_level)r   rN   shrink_to_fit)r   r)   text_directionr   )formatr0  	alignmentborder
background
protection__flagr   ))r   r   left_line_style)r      right_line_style)r_   i   top_line_style)r   i   bottom_line_stylerN   i   left_colour_index   i  ?right_colour_index)rT   i   @	diag_down)   l        diag_up))r      top_colour_index)r   ?  bottom_colour_index)r   i  diag_colour_index)rU   i  diag_line_style))   l      x fill_pattern)r   rw  pattern_colour_indexr   ry  background_colour_indexz<HHHBBIirN   )r   r   Z      )r  r  )rN   i  ? r~  ))r   i  rn  )   l      | rz  )r   r   rm  )r   r  rj  )r   i  rl  )r   i   rx  ro  rq  rS   z<BBHBBHIr   )rZ  r\  )r   r   r_  r)   r   ))r   ?   r~  )r   i  r  )r      r  )r  )r      rx  )r_   i   rj  )r   r  rp  )rN   i   rn  )r   i   rz  )   i   rl  )r   l      p rs  rT   z<BBBBHHI)rT  rV  )rZ  r\  )rX  rU   z<BxBBr  ))r   @   rR  )r   r"   rS  )rZ  ))r_   left)rN   right)r   top)r  bottom)r_   r   )r   r   _colour_index_line_styler"   r   r   r_   zprogrammer stuff-up: bv=%dz--- handle_xf: xf[%d] --- r   r5  zNWARNING *** XF[%d] is a style XF but parent_style_index is 0x%04x, not 0x0fff
z9WARNING *** XF[%d] unknown (raw) format key (%d, 0x%04x)
)2r   r   rh   XFXFAlignmentrd  r`  ra  rb  XFBorderre  rv  rt  r{  r|  XFBackgroundrf  XFProtectionrg  xfcountrP  r   r   r   rotationr   setattrr   r_  r~  r  r  rY  r   ri   xf_listr>  r   r   r   r  _cellty_from_fmttyr   KeyErrorr   _xf_index_to_xl_type_maprd   rU  r   rC  )"r   r   r   r   xf
unpack_fmtpkd_type_par
pkd_align1
pkd_align2pkd_usedpkd_brdbkg1pkd_brdbkg2pkd_brdbkg3reg
attr_stems	attr_stemrI  pkd_orient_usedorientationpkd_align_orient
pkd_bkg_34
pkd_brd_34pkd_type_protpkd_align_par
format_etc
halign_etcmasksider   
line_stylebgr  celltymsgs"                                     rn   	handle_xfr    s    'DNNa'D			B	B=BL !BLL!"BLL"#BLL
BIBIIBII"#BII !BII NBM NBM	Rx &	Rx"

 :Abz*		
M2=,-z;| .
 	 	 #
 	 	j +
 	
 	j +
 	
 !m

 $I?W,DBcAg&AIC $ 	K 	*
 		 			; )
 	 	 .
 	 	{ -
 	 
r

 :Abz*		
M2=,| .
 	 	 #
 	
 	j +
 	
 &, 1+ >"

 $I?W,DBcAg&AIC $ 	 .
 	
 	K *
 	 			; )
 	 
r

 :Abz*		
M2=,h
| .
 	 	 #
 	
 	. 1
 	
 ($.14 1+ >!m

 $I?W,DBcAg&AIC $ 	z ,
 	
 	J 	)
 		 
r

 :Abz*		
M2=-m
} /
 	 	M $
 	 	m .
 	 	M $
 	 !m

 $I?W,DBcAg&AIC $ 	z ,
 	
 	J 	)
 		 #$ !	r
 39$2G/
J"T)z ,
 	 	j +
 	 ]JD$D +/(j+/(jBIIto5|DBIItm3Z@ ] ]] BOBO%&""# !"# !

 $I?W,DBa  $ 4r9::dll#BKLLLLAL
LL.< 	 	

 oobmm,#CHH- 28D!!"++. >>bkkb.C.Cv.McCDLL#r{{B4I4IJ#Dbkk:	}}DOO+J>>DLL#R]]BMM; ,    s   ,_	 	__c                 r	   SU l         [        U R                  5      n[        =(       d    U R                  S:  n[        =(       d    U R                  S:  nU(       a  [        U R                  S5        S n[        U5       GH  nU R                  U   n U R                  UR                     n[        UR                     nXR                  UR                  '   U R                   (       d  Mk  UR"                  (       a  M~  SUR$                  s=::  a  U:  dG  O  U(       a7  [        U R                  SUR                  UR"                  UR$                  5        SUl        U R&                  S:  d  M  U(       a  UR$                  UR                  :X  a-  [        U R                  SUR                  UR$                  5        OTU R                  UR$                     R"                  (       d,  [        U R                  S	UR                  UR$                  5        U(       aF  UR$                  UR                  :  a,  [        U R                  S
UR                  UR$                  5        U R                  UR$                     n	UR(                  (       d"  U	R(                  (       d  U(       a
  U" XU	S5        UR*                  (       d"  U	R*                  (       d  U(       a
  U" XU	S5        UR,                  (       d"  U	R,                  (       d  U(       a
  U" XU	S5        UR.                  (       d"  U	R.                  (       d  U(       a
  U" XU	S5        UR0                  (       d  U	R0                  (       d  U(       a  UR                  U	R                  :w  a  [        U R                  SUR                  UR                  U	R                  U	R                  U R                  UR                     R2                  U R                  U	R                     R2                  5        UR4                  (       a  GM  U	R4                  (       a  GM  U(       d  GM  UR6                  U	R6                  :w  d  GM  [        U R                  SUR                  UR6                  U	R                  U	R6                  5        GM     g ! [         a
    [        n GNf = f)Nr   r   zxf_epilogue called ...
c                     [        X5      [        X#5      :w  a.  [        U R                  SUR                  UR                  U5        g g )Nz(NOTE !!! XF[%d] parent[%d] %s different
)getattrr   r   r>  )book_argxf_arg
parent_argrI  s       rn   
check_samexf_epilogue.<locals>.check_same  s=    6 GJ$==H$$;!4!4d< >rp   r   z:WARNING *** XF[%d]: is_style=%d but parent_style_index=%d
rT   z/NOTE !!! XF[%d]: parent_style_index is also %d
z>NOTE !!! XF[%d]: parent_style_index is %d; style flag not set
z9NOTE !!! XF[%d]: parent_style_index is %d; out of order?
rd  rf  re  rg  z4NOTE !!! XF[%d] fmtk=%d, parent[%d] fmtk=%r
%r / %r
z.NOTE !!! XF[%d] fontx=%d, parent[%d] fontx=%r
)_xf_epilogue_doneri   r  r   r   r   r   re   r  r   r  r   r  r   r  r>  rd   rU  rY  rh   _alignment_flag_background_flag_border_flag_protection_flag_format_flagr   
_font_flagr   )
r   num_xfsr   blah1r  xfxr  r  r  parents
             rn   xf_epiloguer    s:   D$,,G'DNNa'D(T^^q(E89< g\\#	"//"--0C'1F 6<%%bkk2##;;B))3G3QKKb.C.CE %&B!"((BKK7DLLJR%:%:< b&;&;<EEDLLYR%:%:< ..<PKK!6!68 \\""7"78F%%f.D.D*Tv{C&&v/F/F*Tv|D??6+>+>*Tvx@&&v/F/F*Tv|D??6+>+>R]]f.?.??DLLPR]]FOOVEVEV6AA(9(9:EE	G
 ===):):):5R]]f.?.??DLLIR]]FOOVEVEVXk   	"!F	"s   ,R""R65R6c           	          [        U 5        SU l        [        [        [        [
        [        [        [        [        [        4	nU H$  n[        U R                  UR                  U5        M&     g )Nr   )ro   r  r   r   r  r  r,  r3  r@  r  r  r  rE  r   )rj   methodsmethods      rn   initialise_bookr  >  sT    $D
G 8 rp   c                   H    \ rS rSrSrSrSrSrSrSr	Sr
SrSrSrSrSrSrSrg)r  iO  a  
A collection of the border-related attributes of an ``XF`` record.
Items correspond to those in the Excel UI's Format -> Cells -> Border tab.

An explanations of "colour index" is given in :ref:`palette`.

There are five line style attributes; possible values and the
associated meanings are::

  0 = No line,
  1 = Thin,
  2 = Medium,
  3 = Dashed,
  4 = Dotted,
  5 = Thick,
  6 = Double,
  7 = Hair,
  8 = Medium dashed,
  9 = Thin dash-dotted,
  10 = Medium dash-dotted,
  11 = Thin dash-dot-dotted,
  12 = Medium dash-dot-dotted,
  13 = Slanted medium dash-dotted.

The line styles 8 to 13 appear in BIFF8 files (Excel 97 and later) only.
For pictures of the line styles, refer to OOo docs s3.10 (p22)
"Line Styles for Cell Borders (BIFF3-BIFF8)".</p>

.. versionadded:: 0.6.1
r   r   N)r   r   r   r   r   rx  rz  rp  rs  r{  rm  rn  rj  rl  r|  rt  rv  r   r   rp   rn   r  r  O  sa    @     N  O  O I Grp   r  c                   $    \ rS rSrSrSrSrSrSrg)r  i  z
A collection of the background-related attributes of an ``XF`` record.
Items correspond to those in the Excel UI's Format -> Cells -> Patterns tab.

An explanations of "colour index" is given in :ref:`palette`.

.. versionadded:: 0.6.1
r   r   N)	r   r   r   r   r   r~  r  r  r   r   rp   rn   r  r    s     L   rp   r  c                   4    \ rS rSrSrSrSrSrSrSr	Sr
SrSrg)r  i  z
A collection of the alignment and similar attributes of an ``XF`` record.
Items correspond to those in the Excel UI's Format -> Cells -> Alignment tab.

.. versionadded:: 0.6.1
r   r   N)r   r   r   r   r   r[  r_  r  r]  r`  ra  rb  r   r   rp   rn   r  r    s8     I J H L L M Nrp   r  c                        \ rS rSrSrSrSrSrg)r  i  aH  
A collection of the protection-related attributes of an ``XF`` record.
Items correspond to those in the Excel UI's Format -> Cells -> Protection tab.
Note the OOo docs include the "cell or style" bit in this bundle of
attributes. This is incorrect; the bit is used in determining which bundles
to use.

.. versionadded:: 0.6.1
r   r   N)r   r   r   r   r   rR  rS  r   r   rp   rn   r  r    s     K Nrp   r  c                   T    \ rS rSrSrSrSrSrSrSr	Sr
SrSrSrSrSrSrSrSrSrSrg)r  i  a  
eXtended Formatting information for cells, rows, columns and styles.

Each of the 6 flags below describes the validity of
a specific group of attributes.

In cell XFs:

- ``flag==0`` means the attributes of the parent style ``XF`` are
  used, (but only if the attributes are valid there);

- ``flag==1`` means the attributes of this ``XF`` are used.

In style XFs:

- ``flag==0`` means the attribute setting is valid;
- ``flag==1`` means the attribute should be ignored.

.. note::
  the API provides both "raw" XFs and "computed" XFs. In the latter case,
  cell XFs have had the above inheritance mechanism applied.

.. versionadded:: 0.6.1
r   Nr   )r   r   r   r   r   rU  rY  r  r  r  r  r  r  r>  r   r   rg  rf  rd  re  r   r   rp   rn   r  r    sq    4 H
  L J O L  H J J J J I Frp   r  )r   )Jr   
__future__r   restructr   biffhr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   timemachiner   r  excel_default_palette_b5excel_default_palette_b2rf   rg   r7  ro   r~   objectr   r   r   r   r   rM  fmt_code_rangesr  lohir   re   rN  r   
date_charsr  upper_cr   r  r  compilesubr   r  r  r,  r3  r@  rC  rP  r  r  r  r  r  r  r  r  r   rp   rn   <module>r     s   & 	     
 	   " 4CR8  $ 	!       	* #02
/ 
/V:y Vp<
E
R%Z %:( 	)	(
 	#( 	&( 	'( 	*( 	
( 	
"( 	
#( 	
(( 	$( 	'( 	*(  	'!(" 	)#($ 	(%(& 	*'(( 	')(* 	(+(, 	,-(. 	//(0 	&1(2 	)3(4 	-5(6 	
7(8 	
 9(: 	
!;(< 	
&=(> 	
5?(@ 	
8A(B 	
=C(D 	
@E(F 	'G(H 	+I(J 	)K(L 
O( Z !SMSMSMSMSMSMSMSMSMSMSMSM$  !JBBB1#%a   " BW%

z'')
)BN2 *

*
%BN2 & C!C!C! JJIIIC  JJ|,00 ="~ '0 0$h"RHH():VF	(zx	GXR9"Az9 AF:y ( *i  D:y &N Nrp   