ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     ÿØÿà JFIF      ÿÛ „ 	 ( %!1!%)+//.383,7(-.+



-%%-////---/-.+/--+------/------/--0+--/-/-----.-----ÿÀ  ¥2" ÿÄ               ÿÄ J  	     ! 1AQ"aq2‘#BR‚¡ÁÑ3br’¢±Âð$CSƒ²á4c“%DsÓñÿÄ              ÿÄ *        !1AQa‘"2q3±ð#b¡ÿÚ   ? ¼QxJQaÍuò¸Zö Úü8,ÐÚú
"SSn<rçù–´âE—^ªBÖ9À\†¸ÔÁT­ÃÛ5
ëd´³Í#Ý;Þ38œî ¶H£M:wÎ3…³…âpÔF&‚FK¸9„â4àGEõªfÿ ‘ñ(ßw­pŽF|È¥ù®häðÍÑ¶¹‘[ÒinÙW¶ùñY˜Q{›K"išÒ[Ú8žë\F¹@-?v"ÔU”,ìöžkÿ {I‡£šÍ?e
ríV
..............................................................................................................................................................................
.............................................................................                                                  
                                                                                                                                                                                     
V~gc           @   s  d  Z  d d l Z d d l Z d d l Z d d l Z d Z d Z d Z d Z d Z	 d Z
 d	 Z d
 Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z d Z dJ Z dK Z dL Z dM Z dN Z  dO Z! e j" d k rdP dQ dR dS f Z# e e e  e! f Z$ n$ dT dU dV dW f Z# e e e e f Z$ e% g  e& e' e#   D]# Z( e# e( D] Z) e) e( f ^ qbqT Z* d" dX d#     YZ+ e& d e' e#  > Z, g  e, D]% Z- d$ j. d%   e/ e#  D  ^ qZ0 d&   Z1 e1 e,  Z2 g  Z3 x] e, D]U Z- d Z4 x9 e& e' e#   D]% Z5 d e5 >e- @re4 e$ e5 OZ4 qqWe3 j6 e4  qWd' dY d(     YZ7 dZ d[ d\ d] d^ d_ d` da db dc dd de df dg dh di dj dk dl dm dn do dp f Z8 e7 f d e+ f e' e8  d Z9 e% g  e& e' e8   D]# Z( e8 e( D] Z) e) e( f ^ qq Z: e j; dB  Z< e j; dC  Z= dD   Z> dE   Z? i  Z@ dF   ZA dG   ZB eC dH k rd dI lD mE ZE eE eB  n  d S(q   s  
MultiCall - a class which inherits its methods from a Tkinter widget (Text, for
example), but enables multiple calls of functions per virtual event - all
matching events will be called, not only the most specific one. This is done
by wrapping the event functions - event_add, event_delete and event_info.
MultiCall recognizes only a subset of legal event sequences. Sequences which
are not recognized are treated by the original Tk handling mechanism. A
more-specific event will be called before a less-specific event.

The recognized sequences are complete one-event sequences (no emacs-style
Ctrl-X Ctrl-C, no shortcuts like <3>), for all types of events.
Key/Button Press/Release events can have modifiers.
The recognized modifiers are Shift, Control, Option and Command for Mac, and
Control, Alt, Shift, Meta/M for other platforms.

For all events which were handled by MultiCall, a new member is added to the
event instance passed to the binded functions - mc_type. This is one of the
event type constants defined in this module (such as MC_KEYPRESS).
For Key/Button events (which are handled by MultiCall and may receive
modifiers), another member is added - mc_state. This member gives the state
of the recognized modifiers, as a combination of the modifier constants
also defined in this module (for example, MC_SHIFT).
Using these members is absolutely portable.

The order by which events are called is defined by these rules:
1. A more-specific event will be called before a less-specific event.
2. A recently-binded event will be called before a previously-binded event,
   unless this conflicts with the first rule.
Each function will be called at most once for each event.
iNi    i   i   i   i   i   i   i   i   i	   i
   i   i   i   i   i   i   i   i   i   i   i   i   t   darwint   Shiftt   Controlt   Optiont   Commandt   Altt   Metat   Mt   _SimpleBinderc           B   s,   e  Z d    Z d   Z d   Z d   Z RS(   c         C   sJ   | |  _  d t | d d |  _ | |  _ | |  _ g  |  _ d  |  _ d  S(   Nt   <i    t   >(   t   typet   _typest   sequencet   widgett
   widgetinstt   bindedfuncst   Nonet	   handlerid(   t   selfR   R   R   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyt   __init__E   s    				c         C   sV   |  j  sB |  j |  j d  } |  j j |  j |  j |  |  _  n  |  j j |  d  S(   Nc         S   ss   | |  _  i  } x] t t |  d d d  D]? } | | } | | k r, t | | <| |   } | rk | Sq, q, Wd  S(   Ni   i(   t   mc_typet   ranget   lent   True(   t   eventt   lR   t	   wascalledt   it   funct   r(    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyt   handlerO   s    	#

(   R   R   R   R   t   bindR   R   t   append(   R   t   tripletR   R   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyR    M   s
    	
c         C   sH   |  j  j |  |  j  sD |  j j |  j |  j |  j  d  |  _ n  d  S(   N(   R   t   removeR   t   unbindR   R   R   R   (   R   R"   R   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyR$   ]   s    	c         C   s/   |  j  r+ |  j j |  j |  j |  j   n  d  S(   N(   R   R   R$   R   R   (   R   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyt   __del__c   s    	(   t   __name__t
   __module__R   R    R$   R%   (    (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyR   D   s   			t    c         c   s1   |  ]' \ } } d  | >t  @r | d d Vq d S(   i   i    t   -N(   t   s(   t   .0R   t   m(    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pys	   <genexpr>m   s   	c            si   d   } g  } xS |  D]K   t  t   f d   |  D   } | j d | d t  | j |  q W| S(   s   For each item of states return a list containing all combinations of
    that item with individual bits reset, sorted by the number of set bits.
    c         S   s6   d } x) |  r1 t  |  d  \ }  } | | 7} q	 W| S(   s   number of bits set in n base 2i    i   (   t   divmod(   t   nt   nbt   rem(    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyt   nbitsv   s
    	c         3   s   |  ] }   | @Vq d  S(   N(    (   R+   t   x(   t   state(    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pys	   <genexpr>   s    t   keyt   reverse(   t   listt   sett   sortR   R!   (   t   statesR1   t	   statelistt	   substates(    (   R3   s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyt   expand_substatesr   s    	"t   _ComplexBinderc           B   s5   e  Z d    Z d   Z d   Z d   Z d   Z RS(   c         C   s"   | | | |  j  |  j d  } | S(   Nc         S   s   t  g | (| |  _ | |  _ i  } d  } x| | D]t } xa t t |  d d d  D]C }	 | |	 }
 |
 | k rR t  | |
 <| |	 |   } | r Pq qR qR W| r/ Pq/ q/ Wg  | (x | D] } |   q Wg  | (| r | Sd  S(   Ni   i(   R   R   t   mc_stateR   R   R   (   R   t   listsR   R>   t   ishandlerrunningt   doafterhandlerR   R   R   R   R   t   f(    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyR      s*    
		#

(   R@   RA   (   R   R?   R   R>   R   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyt   __create_handler   s
    c   	      C   s  | |  _  t | d |  _ | |  _ | |  _ i g  t D] } g  ^ q6 d  6|  _ g  |  _ g  |  _	 g  |  _
 x t D] } g  t | D] } |  j d  | ^ q } |  j | | t |  } d t | |  j d } |  j j | |  j j |  j | |  f  qq Wd  S(   Ni    R	   R
   (   R   R   t   typenameR   R   t   _statesR   R   t
   handleridsR@   RA   t   _state_subsetst   _ComplexBinder__create_handlert   _state_codest   _state_namesR!   R    (	   R   R   R   R   R*   R   R?   R   t   seq(    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyR      s    			#			(c   
         s+   d  j  k r g  t D] } g  ^ q  j   d <x t D] } g   d d  f D]( } t | D] }  j  | | ^ qc qU }  j |  j t |  } d t |  j  d f }  j	 j
 |  j j  j | |  f  q> Wn      f d   }	  j s|	   n  j j
 |	  d  S(   Ni   s	   <%s%s-%s>c              s     j   d  d j    S(   Ni   i    (   R   R!   (    (   R   R   R"   (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyt   <lambda>   R(   (   R   RE   R   RG   RH   R   RI   RJ   RD   RF   R!   R   R    R   R@   RA   (
   R   R"   R   R*   t   detailR   R?   R   RK   t   doit(    (   R   R   R"   s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyR       s    $(	
c            s<       f d   }  j  s( |   n  j j |  d  S(   Nc              s     j   d  d j    S(   Ni   i    (   R   R#   (    (   R   R   R"   (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyRL      R(   (   R@   RA   R!   (   R   R"   R   RN   (    (   R   R   R"   s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyR$      s    	
c         C   s7   x0 |  j  D]% \ } } |  j j |  j | |  q
 Wd  S(   N(   RF   R   R$   R   (   R   RK   t   id(    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyR%      s    (   R&   R'   RH   R   R    R$   R%   (    (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyR=      s
   				t   KeyPresst   Keyt
   KeyReleaset   ButtonPresst   Buttont   ButtonReleaset   Activatet	   Circulatet   Colormapt	   Configuret
   Deactivatet   Destroyt   Entert   Exposet   FocusInt   FocusOutt   Gravityt   Leavet   Mapt   Motiont
   MouseWheelt   Propertyt   Reparentt   Unmapt
   Visibilitys   ^\w+$s   ^[1-5]$c         C   sc  |  s' |  d d k s' |  d d k r+ d	 St j |  d d !d  } d } x7 | r | d t k r | d t | d >O} | d =qM W| r | d t k r t | d } | d =n d	 St | t k r | s | r d	 Sd	 } nw | g  d
 D] } t | ^ q k rt } n t } | s d	 } n6 t	 |  d k rR| j
 | d  rR| d } n d	 S| | | f S(   s-  Get a string which should describe an event sequence. If it is
    successfully parsed as one, return a tuple containing the state (as an int),
    the event type (as an index of _types), and the detail - None if none, or a
    string if there is one. If the parsing is unsuccessful, return None.
    i    R	   iR
   i   R)   RP   RR   N(   RP   RR   (   R   t   stringt   splitt   _modifier_namest   _type_namest   _binder_classesR   t
   _keysym_ret
   _button_reR   t   match(   R   t   wordst	   modifiersR   RM   R*   t   type_re(    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyt   _parse_sequence   s0    '
	#		%c         C   sb   |  d r: d t  |  d t |  d d d |  d d Sd t  |  d t |  d d d Sd  S(   Ni   R	   i    i   R)   R
   (   RJ   R   (   R"   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyt   _triplet_to_sequence'  s    
0c            s>     t  k r t    Sd   f   f d     Y} | t    <| S(   s   Return a MultiCall class which inherits its methods from the
    given widget class (for example, Tkinter.Text). This is used
    instead of a templating mechanism.
    t	   MultiCallc              s   e  Z e   e j  s t    f d    Z d d d   f d  Z d   f d  Z	   f d   Z
   f d   Z d   f d  Z d   Z RS(   c            sX     j  |  | |  i  |  _ g  t t t   D] } t | |   |   ^ q/ |  _ d  S(   N(   R   t   _MultiCall__eventinfoR   R   R   Rm   t   _MultiCall__binders(   R   t   argst   kwargsR   (   R   (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyR   :  s    	c            s#  t  |  t k rt |  d k r| d  d k r| d d k r| |  j k r |  j | } | d d  k	 r x4 | d D]% } |  j | d j | | d  q{ Wn  | | d <| d d  k	 r
x0 | d D]! } |  j | d j | |  q Wq
q| g  g |  j | <n    j |  | | |  S(   Ni   s   <<is   >>i    i   (   R   t   strR   Rw   R   Rx   R$   R    (   R   R   R   t   addt   eiR"   (   R   (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyR    C  s    $ &
%c            s   t  |  t k r t |  d k r | d  d k r | d d k r | |  j k r |  j | \ } } | d  k	 r x) | D]! } |  j | d j | |  qy Wd  |  j | d <q n    j |  | |  S(   Ni   s   <<is   >>i   i    (   R   R{   R   Rw   R   Rx   R$   (   R   R   t   funcidR   t   tripletsR"   (   R   (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyR$   T  s    $ c            s   | |  j  k r% d  g  g |  j  | <n  |  j  | \ } } xs | D]k } t |  } | d  k rs   j |  | |  q? | d  k	 r |  j | d j | |  n  | j |  q? Wd  S(   Ni   (   Rw   R   Rt   t	   event_addRx   R    R!   (   R   t   virtualt	   sequencesR   R   RK   R"   (   R   (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyR   _  s    c            s   | |  j  k r d  S|  j  | \ } } xs | D]k } t |  } | d  k ra   j |  | |  q- | d  k	 r |  j | d j | |  n  | j |  q- Wd  S(   Ni   (   Rw   Rt   R   t   event_deleteRx   R$   R#   (   R   R   R   R   R   RK   R"   (   R   (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyR   o  s    c            s]   | d  k s | |  j k r+   j |  |  St t t |  j | d     j |  |  Sd  S(   Ni   (   R   Rw   t
   event_infot   tuplet   mapRu   (   R   R   (   R   (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyR   }  s
    	c         S   s`   xY |  j  D]N } |  j  | \ } } | r
 x, | D]! } |  j | d j | |  q0 Wq
 q
 Wd  S(   Ni   (   Rw   Rx   R$   (   R   R   R   R   R"   (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyR%     s
    N(   R&   R'   t
   issubclasst   Tkintert   Misct   AssertionErrorR   R   R    R$   R   R   R   R%   (    (   R   (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyRv   7  s   	(   t   _multicall_dict(   R   Rv   (    (   R   s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyt   MultiCallCreator/  s
    V
c            s!  t  j   } | j d  t t t t j d |  j      \ } } } } | j d | | d f  t	 t  j
  |      j   d g   f d  } | d  | d  | d	  | d
  | d  | d  | d  | d  | d  | d  | d  | d  | j   d  S(   Ns   Test MultiCalls   [x+]s   +%d+%di   i    c            sS     f d   }  j  d | d |   j d | d    | d c d 7<d  S(   Nc            s	     GHd  S(   N(    (   R   (   RK   (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyR     s    s   <<handler%d>>i    i   (   R    R   (   RK   R.   R   (   t   text(   RK   s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyt   bindseq  s    s   <Key>s   <Control-Key>s   <Alt-Key-a>s   <Control-Key-a>s   <Alt-Control-Key-a>s   <Key-b>s   <Control-Button-1>s
   <Button-2>s   <Alt-Button-1>s
   <FocusOut>s   <Enter>s   <Leave>(   R   t   Tkt   titleR6   R   t   intt   reRj   t   geometryR   t   Textt   packt   mainloop(   t   parentt   roott   widtht   heightR2   t   yR   (    (   R   s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyt   _multi_call  s(    3












t   __main__(   t   runi   i   i   i    i@   i   (   R   (   R   (   R   (   R   (   R   (   R   (   R   (   R   R   (    (    (   RP   RQ   (   RR   (   RS   RT   (   RU   (   RV   (   RW   (   RX   (   RY   (   RZ   (   R[   (   R\   (   R]   (   R^   (   R_   (   R`   (   Ra   (   Rb   (   Rc   (   Rd   (   Re   (   Rf   (   Rg   (   Rh   (F   t   __doc__t   sysRi   R   R   t   MC_KEYPRESSt   MC_KEYRELEASEt   MC_BUTTONPRESSt   MC_BUTTONRELEASEt   MC_ACTIVATEt   MC_CIRCULATEt   MC_COLORMAPt   MC_CONFIGUREt   MC_DEACTIVATEt
   MC_DESTROYt   MC_ENTERt	   MC_EXPOSEt
   MC_FOCUSINt   MC_FOCUSOUTt
   MC_GRAVITYt   MC_LEAVEt   MC_MAPt	   MC_MOTIONt   MC_MOUSEWHEELt   MC_PROPERTYt   MC_REPARENTt   MC_UNMAPt   MC_VISIBILITYt   MC_SHIFTt
   MC_CONTROLt   MC_ALTt   MC_METAt	   MC_OPTIONt
   MC_COMMANDt   platformt
   _modifierst   _modifier_maskst   dictR   R   t   numbert   nameRk   R   RE   R*   t   joint	   enumerateRJ   R<   RG   RI   R   R   R!   R=   R   Rm   Rl   t   compileRn   Ro   Rt   Ru   R   R   R   R&   t   idlelib.idle_test.htestR   (    (    (    s6   /opt/alt/python27/lib64/python2.7/idlelib/MultiCall.pyt   <module>   s                         &
(/	\		"&	*		b	