³ò
B3IHc           @   s  d  d k  Z  e  i i ƒ  Z d e d <e d e Z d  d k Z d  d k Z d  d k Z d  d k Z d d> d „  ƒ  YZ d d? d „  ƒ  YZ	 d	 d@ d
 „  ƒ  YZ
 d dA d „  ƒ  YZ d dB d „  ƒ  YZ d Z g  Z d dC d „  ƒ  YZ d dD d „  ƒ  YZ d dE d „  ƒ  YZ d d d d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d d „ Z d d  „ Z d d! „ Z d d d d" „ Z d# „  Z d$ „  Z d% „  Z d& „  Z d' „  Z  d( d) „ Z! d* „  Z" d+ „  Z# d, „  Z$ d- „  Z% d. „  Z& d/ „  Z' d0 Z( d e( Z) d e( d1 Z* dF Z+ d S(G   iÿÿÿÿNs   General Python scripts.t   descriptiont   doct   Keywordsc           B   s   e  Z d  Z d „  Z RS(   s_   Filter out easily keywords from generic options list.
    
    See VideoControl for an example.c         C   sX   xQ | i  ƒ  D]C } | i | ƒ o | | |  i | <| | =q | | |  i | <q Wd  S(   N(   t   keyst   has_keyt   __dict__(   t   selft   keywt   defaultst   key(    (    s   C:\py\_spe\sm\python.pyt   filterKeywords   s     (   t   __name__t
   __module__t   __doc__R
   (    (    (    s   C:\py\_spe\sm\python.pyR      s   t   Newc           B   s   e  Z d  Z d „  Z RS(   s<   Empty class of which properties can be set through keywords.c         K   s   | |  _  d  S(   N(   R   (   R   t   keywords(    (    s   C:\py\_spe\sm\python.pyt   __init__   s    (   R   R   R   R   (    (    (    s   C:\py\_spe\sm\python.pyR      s   t   Strc           B   s   e  Z d  Z d „  Z RS(   s2   Use its own dictionary as a string representation.c         C   s   |  i  ƒ  GHd  S(   N(   R   (   R   (    (    s   C:\py\_spe\sm\python.pyt   __str__#   s    (   R   R   R   R   (    (    (    s   C:\py\_spe\sm\python.pyR   !   s   t
   ValueRangec           B   sŒ   e  Z d  Z d d d d d d „ Z d „  Z d „  Z d „  Z d „  Z d d „ Z	 d d	 d d
 „ Z
 d d „ Z d d d „ Z d „  Z RS(   s2   Range class between minimum and max with features.i    i   c         C   sœ   | o" t  | ƒ |  _  t | ƒ |  _ n0 | |  _  t d  j o |  i  |  _ n
 | |  _ | |  _ |  i |  i  |  _ |  i  |  _ |  i |  _ |  i |  _ d  S(   N(   t   mint   maxt   Nonet   stept   deltat   _mint   _maxt   _delta(   R   t   minimumt   maximumR   t   randomt   lst(    (    s   C:\py\_spe\sm\python.pyR   (   s    			c         C   s   |  i  |  i d S(   s    Return the average of the range.i   (   R   R   (   R   (    (    s   C:\py\_spe\sm\python.pyt   average9   s    c         C   s>   |  i  |  i j o |  i  Sn t i |  i  |  i |  i ƒ Sd S(   s(   Choose a random number out of the range.N(   R   R   R   t	   randrangeR   (   R   (    (    s   C:\py\_spe\sm\python.pyt   choose=   s    c         C   s   | |  i  |  i S(   t   fraction2rangeFloat(   R   R   (   R   t   x(    (    s   C:\py\_spe\sm\python.pyt   f2fD   s    c         C   s   t  t | |  i |  i ƒ ƒ S(   t   fraction2range(   t   intt   roundR   R   (   R   R$   (    (    s   C:\py\_spe\sm\python.pyt   f2rH   s    c         C   s…   t  |  i ƒ | } t t | d | ƒ ƒ |  i |  _ | d j o
 | } n t t | | ƒ ƒ |  i |  _ |  i |  i |  _ d S(   s$   Limit/expand the scope of the range.i   N(	   t   floatR   R'   R(   R   R   R   R   R   (   R   t   nR   R   R   (    (    s   C:\py\_spe\sm\python.pyt   limitL   s    $ 
 R   c         C   sº   | d j oM t  t |  i |  i | ƒ ƒ |  _ | d  j o t |  i | ƒ |  _ q£ nJ t  t |  i |  i | ƒ ƒ |  _ | d  j o t |  i | ƒ |  _ n |  i |  i |  _ d  S(   NR   (	   R'   R(   R   R   R   R   R   R   R   (   R   t   fractiont   whicht   extra(    (    s   C:\py\_spe\sm\python.pyt   limitFractionT   s    # # c         C   s3   t  | |  i ƒ |  i } | o d | } n | S(   t   range2fractioni   (   R*   R   R   (   R   R$   t   invertt   f(    (    s   C:\py\_spe\sm\python.pyt   r2f_   s     c         C   sP   t  |  i |  i d |  i ƒ } | o | i | ƒ n | o t | ƒ n | S(   s"   Returns as a list with all values.i   (   t   rangeR   R   R   t   shufflet   reverse(   R   R   t	   backwardst   r(    (    s   C:\py\_spe\sm\python.pyR5   e   s      c         C   sE   | |  i  j  p | |  i j o | |  i  |  i |  i  Sn | Sd S(   s&   Make sure a value fits within a range.N(   R   R   R   (   R   R$   (    (    s   C:\py\_spe\sm\python.pyt   cyclel   s     N(   R   R   R   R   R   R    R"   R%   R)   R,   R0   R4   R5   R:   (    (    (    s   C:\py\_spe\sm\python.pyR   &   s   				t   ValueRangeInOutc           B   s;   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s&   Class to convert between value ranges.c         C   s"   | |  _  | |  _ |  i |  _ d  S(   N(   t   inputt   outputt   i2ot   __call__(   R   R<   R=   (    (    s   C:\py\_spe\sm\python.pyR   u   s    		c         C   s   |  i  i |  i i | ƒ ƒ S(   s   in2out float(   R=   R%   R<   R4   (   R   R$   (    (    s   C:\py\_spe\sm\python.pyt   i2fz   s    c         C   s   |  i  i |  i i | ƒ ƒ S(   t   in2out(   R=   R)   R<   R4   (   R   R$   (    (    s   C:\py\_spe\sm\python.pyR>   ~   s    c         C   s   |  i  i |  i i | ƒ ƒ S(   s   out2in float(   R<   R%   R=   R4   (   R   R$   (    (    s   C:\py\_spe\sm\python.pyt   o2f‚   s    c         C   s   |  i  i |  i i | ƒ ƒ S(   t   out2in(   R<   R)   R=   R4   (   R   R$   (    (    s   C:\py\_spe\sm\python.pyt   o2i†   s    (   R   R   R   R   R@   R>   RB   RD   (    (    (    s   C:\py\_spe\sm\python.pyR;   s   s   				s   __www.stani.be__t   _StuntControlMethodc           B   s#   e  Z d  Z e d „ Z d „  Z RS(   sQ   Call with arguments and keywords.

    See Stunt class for more information.
    c         C   s   | |  _  | |  _ g  |  _ d  S(   N(   t   methodt   appendMethodst   argKey(   R   t   controlRF   RG   (    (    s   C:\py\_spe\sm\python.pyR   ”   s    		c         O   sƒ   y t  | d j } Wn d } n X|  i |  i j p | o/ | o | d  } n |  i i | | f ƒ n | | f g |  _ d  S(   Niÿÿÿÿi    (   t   APPENDRF   RG   RH   t   append(   R   t	   argumentsR   t   appendArgument(    (    s   C:\py\_spe\sm\python.pyR?   ˜   s    
(   R   R   R   t   APPEND_METHODSR   R?   (    (    (    s   C:\py\_spe\sm\python.pyRE      s   t   _StuntControlc           B   s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   s{   Buffer to register all calls to dialog control methods. Useful for threads.

    See Stunt class for more information.
    c         C   s   | |  _  h  |  _ d  S(   N(   RI   t   methods(   R   RI   (    (    s   C:\py\_spe\sm\python.pyR   ¨   s    	c         C   s[   t  | ƒ o? | |  i i ƒ  j o t |  | ƒ |  i | <n |  i | Sn |  i | Sd  S(   N(   t   publicRP   R   RE   R   (   R   RF   (    (    s   C:\py\_spe\sm\python.pyt   __getattr__«   s
    c         C   sd   xP |  i  i ƒ  D]? \ } } x0 | i D]% \ } } t t | | ƒ | | ƒ q& Wq W|  i  i ƒ  d  S(   N(   RP   t   itemsRH   t   applyt   getattrt   clear(   R   t   containerControlRF   t   StuntMethodRL   R   (    (    s   C:\py\_spe\sm\python.pyR?   ±   s     
  !(   R   R   R   R   RR   R?   (    (    (    s   C:\py\_spe\sm\python.pyRO   £   s   		t   Stuntc           B   s5   e  Z d  Z d d „ Z d „  Z d „  Z d „  Z RS(   s÷  Buffer to register all calls to a dialog. Usefull for threads.

    These actions can be applied later through for example a dialog timer event.
    Example:
        >>> dialog=Stunt()
        >>> dialog.gauge.SetRange(100)
        >>> dialog.gauge.SetValue(25)
        >>> dialog.label.SetValue('Hello world')
        >>> dialog.controls
        {'gauge': <smNew._StuntControl instance at 0x0165BA18>, 'label': <smNew._StuntControl instance at 0x0165B980>}
        >>> dialog.controls['gauge'].methods
        {'SetValue': <smNew._StuntControlMethod instance at 0x0166FAF8>, 'SetRange': <smNew._StuntControlMethod instance at 0x0166F940>}
        >>> dialog.controls['gauge'].methods['SetValue'].argKey
        [((25,), {})]
        #>> dialog(wxDialog)
    c         C   s   h  |  _  | |  _ d  S(   N(   t   controlst   _Stunt__container(   R   t	   container(    (    s   C:\py\_spe\sm\python.pyR   Ç   s    	c         C   sX   t  | ƒ o< | |  i i ƒ  j o t | ƒ |  i | <n |  i | Sn |  i | Sd  S(   N(   RQ   RZ   R   RO   R   (   R   RI   (    (    s   C:\py\_spe\sm\python.pyRR   Ê   s
    c         C   sY   d |  _  x3 |  i i ƒ  D]" \ } } | t |  i | ƒ ƒ q W|  i i ƒ  d |  _  d S(   s+   Apply Stunted methods of self to container.i   i    N(   t   busyRZ   RS   RU   R[   RV   (   R   RI   t   StuntControl(    (    s   C:\py\_spe\sm\python.pyR?   Ñ   s    	 c         C   s   d S(   Ni   (    (   R   (    (    s   C:\py\_spe\sm\python.pyt   __nonzero__Ø   s    N(   R   R   R   R   R   RR   R?   R_   (    (    (    s   C:\py\_spe\sm\python.pyRY   ¶   s
   		i    i   c         C   s5   g  } t  | |  | ƒ D] } | | | |  q ~ S(   s   Arbitrary range with floats(   R5   (   t   startt   stopR   t   _[1]R$   (    (    s   C:\py\_spe\sm\python.pyt   arangeÝ   s    c         C   s)   t  |  ƒ i d j o |  Sn |  g Sd S(   s   Force x to a list.t   listN(   t   typeR   (   R$   (    (    s   C:\py\_spe\sm\python.pyt
   assertListá   s     c         C   s†   t  |  | ƒ } d } d } xd | | j oV xE |  | d j o3 | | d j o" | | 9} |  | :}  | | :} q. W| d 7} q W| S(   s'   Calculates common greatest denominator.i   i   i    (   R   (   R$   t   yR   t   resultt   d(    (    s   C:\py\_spe\sm\python.pyt   cgdæ   s      "

c         C   sW   t  i |  d | d ƒ d } t  i |  d | d ƒ d } t  i | | | | ƒ S(   s*   Calculates distance between two 2d points.i    i   (   t   matht   fabst   sqrt(   t   p1t   p2t   pxt   py(    (    s   C:\py\_spe\sm\python.pyt   distanceó   s    c         C   s,   g  } |  D] } | D] } | | q q ~ S(   s    Flattens a sequence of sequences(    (   t   seqRb   t   subseqR$   (    (    s   C:\py\_spe\sm\python.pyt   flatù   s    c         C   sR   g  } xE |  D]= } y | t  | ƒ } Wq t j
 o | i | ƒ q Xq W| S(   s   Flattens a list.(   t   flattent	   TypeErrorRK   (   t   sRh   t   i(    (    s   C:\py\_spe\sm\python.pyRv   ý   s     i   c         C   s   t  t |  | ƒ | ƒ S(   s.   Make sure a number is in 'hh:mm:ss:ff' format.(   t
   index2hmsft
   hmsf2index(   R$   t   fps(    (    s   C:\py\_spe\sm\python.pyt   fixHmsf  s    c         C   s±   |  i  d ƒ }  |  d g j o
 g  }  n g  } t d t |  ƒ ƒ D] } | d qD ~ g  } |  D] } | t | ƒ qb ~ }  |  d d |  d d |  d | |  d } | S(	   sB   Convert frame notation into frame number
    x='hh:mm:ss:ff' 
    t   :t    i   i    i<   i   i   i   (   t   splitR5   t   lenR'   (   R$   R|   Rb   t   at   _[2]t   bt   frame(    (    s   C:\py\_spe\sm\python.pyR{     s     
V.c         C   s4   d |  d | |  d | d |  | d |  | f S(   sH   Convert frame notation into frame number
    returns 'hh:mm:ss:ff' 
    s   %02i:%02i:%02i:%02ii  i<   (    (   R$   R|   (    (    s   C:\py\_spe\sm\python.pyRz     s    c         C   s9   g  } t  | |  | d ƒ D] } | | | |  q ~ S(   s/   Arbitrary range with floats, inclusive endpointi   (   R5   (   R`   Ra   R   Rb   R$   (    (    s   C:\py\_spe\sm\python.pyt   irange  s    c         C   s   t  t |  ƒ ƒ S(   N(   R5   R   (   R$   (    (    s   C:\py\_spe\sm\python.pyt   lrange  s    c      	   C   s—   | oˆ t  |  ƒ | j ou t  |  ƒ t | d ƒ } |  d g g  } t | d ƒ D]% } | |  t t | | ƒ ƒ d qS ~ |  d g Sn |  Sd  S(   Ni   i    i   iÿÿÿÿ(   R   R*   R5   R'   R(   (   R$   R+   R   Rb   Ry   (    (    s   C:\py\_spe\sm\python.pyt
   limitRange"  s    [c         C   s,   t  |  ƒ }  t |  d ƒ d t |  d ƒ S(   s+   Converts seconds to minutes:seconds string.i<   R~   (   R'   t   str(   t   seconds(    (    s   C:\py\_spe\sm\python.pyt   minSec)  s    c         C   s   |  d  d j S(   s1   Returns true if string x doesn't start with '__'.i   t   __(    (   R$   (    (    s   C:\py\_spe\sm\python.pyRQ   .  s    c         C   s!   t  |  | ƒ } |  | | | f S(   N(   Rj   (   R$   Rg   Ri   (    (    s   C:\py\_spe\sm\python.pyt   ratio2  s    t    c         C   sy   y |  i  d ƒ SWna t |  ƒ } y@ x1 |  d j o# |  | d | j o | d 8} q) W|  |  SWqu |  Squ Xn Xd  S(   Nt   -i    i   (   t   rstripR   (   R$   t   chart   index(    (    s   C:\py\_spe\sm\python.pyR   6  s     "c         C   s   d i  | ƒ i d |  ƒ S(   s,   Fills a string with n times the substring s.R   RŽ   (   t   ljustt   replace(   Rx   R+   (    (    s   C:\py\_spe\sm\python.pyt   strFillB  s    c            s   ‡  f d †  } t  | |  ƒ S(   s   Subtract list m from list lc            s
   |  ˆ  j S(   N(    (   R$   (   t   m(    s   C:\py\_spe\sm\python.pyt
   _notCommonH  s    (   t   filter(   t   lR–   R—   (    (   R–   s   C:\py\_spe\sm\python.pyt   subtractF  s    c         C   s   t  t i ƒ  |  ƒ S(   s4   Returns the time as a string in min and sec since x.(   R‹   t   time(   R$   (    (    s   C:\py\_spe\sm\python.pyt
   timePassedL  s    c         C   s   t  d  |  Œ S(   N(   t   mapR   (   R$   (    (    s   C:\py\_spe\sm\python.pyt	   transposeP  s    c         C   sU  t  |  ƒ } | d j o g  Sn h  } y x |  D] } d | | <q1 WWn t j
 o
 ~ n X| i ƒ  Sy t |  ƒ } | i ƒ  Wn t j
 o
 ~ n‚ X| d j p t ‚ | d } d } } xM | | j  o? | | | j o  | | | | <} | d } n | d } qÇ W| |  Sg  } x, |  D]$ } | | j o | i | ƒ q)q)W| S(   s  Return a list of the elements in s, but without duplicates.

    For example, unique([1,2,3,1,2,3]) is some permutation of [1,2,3],
    unique("abcabc") some permutation of ["a", "b", "c"], and
    unique(([1, 2], [2, 3], [1, 2])) some permutation of
    [[2, 3], [1, 2]].

    For best speed, all sequence elements should be hashable.  Then
    unique() will usually work in linear time.

    If not possible, the sequence elements should enjoy a total
    ordering, and if list(s).sort() doesn't raise TypeError it's
    assumed that they do enjoy a total ordering.  Then unique() will
    usually work in O(N*log2(N)) time.

    If that's not possible either, the sequence elements must support
    equality-testing.  Then unique() will usually work in quadratic
    time.
    i    i   (   R   Rw   R   Rd   t   sortt   AssertionErrorRK   (   Rx   R+   t   uR$   t   tt   lastt   lastiRy   (    (    s   C:\py\_spe\sm\python.pyt   uniqueS  s@     
	

  c         C   so   y t  i |  | ƒ SWnT t |  ƒ }  t |  ƒ } | | j o$ d t | | ƒ d d |  f Sqk |  Sn Xd  S(   Ns   %0s   d%si    (   t   stringt   zfillR‰   R   (   R$   t   widthR™   (    (    s   C:\py\_spe\sm\python.pyR§   —  s    $gR¸…ëQ@i
   t   januaryt   februaryt   marcht   aprilt   mayt   junet   julyt   augustt	   septembert   octobert   novembert   december(    (    (    (    (    (    (    (    (   R©   Rª   R«   R¬   R­   R®   R¯   R°   R±   R²   R³   R´   (,   t   smt   INFOt   copyR   Rk   R   R¦   R›   R   R   R   R   R;   RJ   RN   RE   RO   RY   Rc   Rf   Rj   Rr   Ru   Rv   R}   R{   Rz   R†   R‡   Rˆ   R‹   RQ   R   R   R•   Rš   Rœ   Rž   R¥   R§   t   INCH2CMt   CM2INCHt   MM2INCHt   MONTHS(    (    (    s   C:\py\_spe\sm\python.pys   <module>   sP   
0M'					

										D	
