+
    Bi-                         R t ^ RIt^ RIt^ RIt^ RIHt ^ RIHt ^RIH	t	H
t
 ^RIHt RRR./t. ROt ! R	 R]4      tR
 t]t]tR# )z
Tkinter GUI progressbar decorator for iterators.

Usage:
>>> from tqdm.tk import trange, tqdm
>>> for i in trange(10):
...     ...
N)warn)TqdmExperimentalWarningTqdmWarning)tqdmzgithub.com/richardsheridan	casperdcltqdm_tkc                      a a ] tR t^t oRtV 3R ltR tR tR tRR lt	RR lt
R tRV 3R	 llt]R
 4       tRtVtV ;t# )r   z
Experimental Tkinter GUI version of tqdm!

Note: Window interactivity suffers if `tqdm_tk` is not running within
a Tkinter mainloop and values are generated infrequently. In this case,
consider calling `tqdm_tk.refresh()` frequently in the Tk thread.
c                  <a  VP                  4       pRVR&   \        VP                  RR4      4      VR&   RV9   S n        VP	                  RR4      pVP	                  RR4      pVP	                  R	R4      S n        \        SS `  ! V/ VB  S P                  '       d   R# VfL    \        P                  pTf   \        P                  ! 4       S n        M6\        P                  ! 4       S n        M\        P                  ! V4      S n        \        R\         ^R7       S P#                  4       S n        S P                  P'                  RS P(                  4       S P                  P+                  S P,                  4       S P                  P/                  R^4       S P                  P1                  ^ V 3R l4       \        P2                  ! S P                  ^ R7      S n        \        P6                  ! S P                  4      S n        \:        P<                  ! S P                  ^R7      pVP?                  4        \:        P@                  ! VS P8                  RRRR7      pVP?                  4        \:        PB                  ! VS P4                  RR7      S n"        S PF                  e(   S PD                  PI                  S PF                  R7       MS PD                  PI                  RR7       S PD                  P?                  4        S P
                  e4   \:        PJ                  ! VRS P(                  R7      pVP?                  4        V'       d   S P                  PM                  4        R# R#   \         d    \        R
4      hi ; i)a  
This class accepts the following parameters *in addition* to
the parameters accepted by `tqdm`.

Parameters
----------
grab  : bool, optional
    Grab the input across all windows of the process.
tk_parent  : `tkinter.Wm`, optional
    Parent Tk window.
cancel_callback  : Callable, optional
    Create a cancel button and set `cancel_callback` to be called
    when the cancel or window close button is clicked.
TguidisableFleavegrab	tk_parentNcancel_callbackz9`tk_parent` required when using `tkinter.NoDefaultRoot()`zGUI is experimental/alpha
stacklevelWM_DELETE_WINDOW-topmostc                  <   < S P                   P                  R ^ 4      # )r   )
_tk_windowwm_attributesselfs   ,/usr/lib/python3.14/site-packages/tqdm/tk.py<lambda>"tqdm_tk.__init__.<locals>.<lambda>P   s    )F)FzST)U    )value)paddingiX  center)textvariable
wraplengthanchorjustifyi  )variablelength)maximumindeterminate)modeCancel)textcommand)'copyboolget_warn_leavepop_cancel_callbacksuper__init__r   tkinter_default_rootAttributeErrorTkr   Toplevelr   r   _tk_dispatching_helper_tk_dispatchingprotocolcancelwm_titledescr   after	DoubleVar	_tk_n_var	StringVar_tk_text_varttkFramepackLabelProgressbar_tk_pbartotal	configureButtongrab_set)	r   argskwargsr   r   
pbar_frame	_tk_label
_tk_button	__class__s	   f*,     r   r4   tqdm_tk.__init__!   s    u Iu!=>y"f,zz&%(JJ{D1	 &

+<d C$)&)<<<Q#11	  ")**,")"2"2"4%..y9DO(*AaP#::<  !3T[[A  +%%j!4a!UV **4??!D#--doo>YYt:
IIjt7H7H),XxQ	=::!MM##DJJ#7MM###9  ,JXt{{SJOOOO$$& E " Q$OQ QQs   $M$ $M;c                  a  S P                   '       d   R # RS n         S P                  4       ;_uu_ 4        S P                  P                  S 4       R R R 4       V 3R lpS P                  P                  RV4       S P                  '       g
   V! 4        R # S P                  '       g.   S P                  '       d   \        R\        ^R7       V! 4        R # R #   + '       g   i     L; i)NTc                     < S P                   P                  R S P                   P                  4       S P                  '       g   S P                   P	                  4        R# R# )idleN)r   r@   destroyr;   updater   s   r   _closetqdm_tk.close.<locals>._closen   sB    OO!!&$//*A*AB'''&&( (r   r   z-leave flag ignored if not in tkinter mainloopr   )r   get_lock
_instancesremover   r<   r   r;   r0   r   r   )r   r[   s   f r   closetqdm_tk.closee   s    <<<]]__OO""4( 	)
 	  !3V< zzzH%%%D Q0H	 & _s   CC'	c                    R # N )r   ___s   &*,r   cleartqdm_tk.clear   s    r   c                   V P                   P                  V P                  4       V P                  pVR ,          ;'       g    RP	                  RR4      VR &   V P
                  ! R/ VB pRV9   d)   RP                  \        P                  ! RV^R7      4      pV P                  P                  V4       V P                  '       g   V P                  P                  4        R# R# )	
bar_formatz{l_bar}<bar/>{r_bar}z{bar}z<bar/> z\|?<bar/>\|?)maxsplitNrd   )rB   setnformat_dictreplaceformat_meterjoinresplitrD   r;   r   rZ   )r   re   rf   dmsgs   &*,  r   displaytqdm_tk.display   s    466"\?DD.DMMX,$!$s?''"((?C!DECc"###OO""$ $r   c                (    V P                  W4       R # rc   )set_description_strr   r?   refreshs   &&&r   set_descriptiontqdm_tk.set_description   s      /r   c                    Wn         V P                  '       gV   V P                  P                  V4       V'       d1   V P                  '       g   V P                  P                  4        R # R # R # R # rc   )r?   r   r   r>   r;   rZ   r{   s   &&&r   rz   tqdm_tk.set_description_str   sL    	|||OO$$T*t333&&(  4w r   c                b    V P                   e   V P                  4        V P                  4        R# )zN
`cancel_callback()` followed by `close()`
when close/cancel buttons clicked.
N)r2   r`   r   s   &r   r=   tqdm_tk.cancel   s%    
   ,!!#

r   c                   < \        V R4      '       d@   Vf   V P                  P                  ^dRR7       MV P                  P                  VRR7       \        SV `  VR7       R# )z
Resets to 0 iterations for repeated use.

Parameters
----------
total  : int or float, optional. Total to use for the new bar.
rJ   Nr(   )r'   r)   determinate)rK   )hasattrrJ   rL   r3   reset)r   rK   rT   s   &&r   r   tqdm_tk.reset   sS     4$$}''/'J''M'JE"r   c                 *   \         P                  P                  \         P                  P                  P                  0p \        P
                  ! 4       P                  4        F-  pV'       g   K  VP                  V 9   d    R# VP                  pK,  	  R# )z3determine if Tkinter mainloop is dispatching eventsTF)	r5   mainloop__code__Miscsys_current_framesvaluesf_codef_back)codesframes     r   r:   tqdm_tk._tk_dispatching_helper   sh     !!**GLL,A,A,J,JK((*113E%<<5(	 4
 r   )	r2   r;   rB   rJ   rD   r   r0   r?   r   )NTrc   )__name__
__module____qualname____firstlineno____doc__r4   r`   rg   rw   r}   rz   r=   r   staticmethodr:   __static_attributes____classdictcell____classcell__)rT   __classdict__s   @@r   r   r      sM     B'H4%0)#   r   c                 (    \        \        V !  3/ VB # )z4Shortcut for `tqdm.tk.tqdm(range(*args), **kwargs)`.)r   range)rO   rP   s   *,r   ttkranger      s    5$<*6**r   )r   r   r   trange)r   rs   r   r5   tkinter.ttkrE   warningsr   stdr   r   r   std_tqdm
__author____all__r   r   r   rd   r   r   <module>r      sV    
 
    5 !/=>

3dh dN+ 	r   