łň
~×YKc           @   s^   d  d k  Z  d e f d     YZ d e  i i f d     YZ d e  i i f d     YZ d S(   i˙˙˙˙Nt   Deletec           B   s   e  Z RS(    (   t   __name__t
   __module__(    (    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\execution.pyR       s   t   PredictInfoc           B   s   e  Z d  Z d d  Z RS(   s9   
    This stores information involved in prediction.
    c         C   sU   t  t |   i   | o t i i i | i  |  _ n t i i i d   |  _ d  S(   N(	   t   superR   t   __init__t   renpyt   displayt   coret   ImagePredictInfot   imagest   None(   t   selft   pi(    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\execution.pyR   %   s    N(   R   R   t   __doc__R   R   (    (    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\execution.pyR       s   t   Contextc           B   sĄ   e  Z d  Z d Z d   Z d d  Z e d  Z d   Z	 d   Z
 d   Z d   Z d d	  Z d
   Z d d  Z e d  Z d   Z d   Z d   Z RS(   sĂ  
    This is the context object which stores the current context
    of the game interpreter.

    @ivar current: The name of the node that is currently being
    executed.

    @ivar return_stack: A list of names of nodes that should be
    returned to when the return statement executes. (When a return
    occurs, the name is looked up, and name.text is then executed.)

    @ivar scene_lists: The scene lists associated with the current
    context.

    @ivar rollback: True if this context participates in rollbacks.

    @ivar runtime: The time spent in this context, in milliseconds.

    @ivar info: An object that is made available to user code. This object
    does participates in rollback.
    i   c         C   sp   | d j  o" t    |  _ |  i i |  i _ n | d j  o t |  _ t |  _ n | d j  o h  |  _ n d  S(   Ni   i   i   (	   R   t   predict_infoR
   t   scene_listst   image_predict_infot   Falset   abnormalt   last_abnormalt   music(   R   t   version(    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\execution.pyt   after_upgradeH   s    	c         C   sr  t  t |   i   d  |  _ g  |  _ g  |  _ h  g |  _ | |  _ d |  _	 t
 i i   |  _ t |  _ t |  _ t |  _ t
 i i   |  _ | o} | i } | i	 |  _	 t |  i  i t | i   x0 | i i   D] \ } } | i   |  i | <qÖ Wt | i  |  _ n d  } t   |  _ t
 i i i | |  i i  |  _ |  i  d d d d d g  |  i i! h   d  S(   Ni    t   _returnt   _argst   _kwargst   mouse_visiblet   suppress_overlay("   R   R   R   R   t   currentt   call_location_stackt   return_stackt   dynamic_stackt   rollbackt   runtimeR   t   pythont   RevertableObjectt   infoR   t   seent   TrueR   R   t   RevertableDictR   R   t   varst   updatet	   iteritemst   copyR   R   R   R   t
   SceneListsR
   t   make_dynamict   append(   R   R"   t   contextt   oldslt   kt   v(    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\execution.pyR   U   s2    									 !c         C   s   t  t i  } | o
 d } n d } xc | D][ } | |  i | j o q- n | | j o | | |  i | | <q- t   |  i | | <q- Wd S(   s   
        Makes the variable names listed in names dynamic, by backing up
        their current value (if not already dynamic in the current call).
        i    i˙˙˙˙N(   R*   R   t   storeR!   R    (   R   t   namesR1   R5   t   indext   i(    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\execution.pyR/      s    
 c         C   sd   t  t i  } |  i i   } x? | i   D]1 \ } } t | t  o | | =q+ | | | <q+ Wd S(   sg   
        Pops one level of the dynamic stack. Called when the return
        statement is run.
        N(   R*   R   R5   R!   t   popR,   t
   isinstanceR    (   R   R5   t   dynamicR3   R4   (    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\execution.pyt   pop_dynamicĄ   s     c         C   s    x |  i  o |  i   q Wd S(   se   
        Pops all levels of the dynamic stack. Called when we jump
        out of a context.
        N(   R!   R<   (   R   (    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\execution.pyt   pop_all_dynamic˛   s    c         C   s   | |  _  d S(   se   
        Sets the name of the node that will be run when this context
        next executes.
        N(   R   (   R   t	   node_name(    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\execution.pyt
   goto_labelź   s    c      
   C   s   xN |  i  D]C } y3 t i i i |  } | d | i | i f IJWq
 q
 Xq
 Wy6 t i i i |  i  } | d | i | i f IJWn n Xd  S(   Ns    - script call at line %d of %ss    - script at line %d of %s(   R   R   t   gamet   scriptt   lookupt
   linenumbert   filenameR   (   R   t   outR8   t   node(    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\execution.pyt	   report_tbÄ   s    
 c         C   sL  t  |  _ | d j o t i i i |  i  } n x| o| i |  _ |  i |  _	 t
 |  _ |  i o! t i i o t i i i   n t
 |  _ y | i   } Wn@ t i i j
 o. } t i i i | i d  } t  |  _ n X|  i o* t  t i i |  i <t  t i i |  i <n |  i o! t i i o t i i i   q5 q5 Wd S(   sé   
        Executes as many nodes as possible in the current context. If the
        node argument is given, starts executing from that node. Otherwise,
        looks up the node given in self.current, and executes from there.
        i    N(   R(   R   R   R   R@   RA   RB   R   t   nameR   R   R"   t   logt   beginR'   t   executet   JumpExceptiont   argst	   seen_evert   seen_sessiont   complete(   R   RF   t   e(    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\execution.pyt   runÓ   s(    	
		
c         C   s   t  |  _ d S(   sT   
        Marks the current statement as one that has been seen by the user.
        N(   R(   R'   (   R   (    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\execution.pyt	   mark_seen÷   s    c         C   sŽ   |  i  p t d   n | d j o |  i  } n |  i i |  i   |  i i |  |  i i h   | |  _  |  i d d g  d t i	 _
 d t i	 _ t i i i |  S(   s(   
        Calls the named label.
        s-   Context not capable of executing Ren'Py code.R   R   N(   R   t	   ExceptionR   R   R0   R    R!   R/   R   R5   R   R   R@   RA   RB   (   R   t   labelt   return_site(    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\execution.pyt   callţ   s    
	c         C   se   t  |  i  d j o d Sn | o  |  i i   } |  i i   n |  i d } t i i i |  S(   sZ   
        Returns the node to return to, or None if there is no
        such node.
        i    i˙˙˙˙N(	   t   lenR    R   R9   R   R   R@   RA   RB   (   R   R9   RU   (    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\execution.pyt   lookup_return  s    c         C   s   t  |  i |   } |  i | _ |  i | _ g  } |  i D] } | | i   q: ~ | _ |  i | _ |  i | _ |  i | _ | S(   sL   
        Makes a copy of this object, suitable for rolling back to.
        (	   R   R"   R   R    R!   R-   R   R#   R&   (   R   t   rvt   _[1]R8   (    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\execution.pyt   rollback_copy&  s    -c   	      C   s3  |  i  p d Sn |  i } t i i i |  i   |  i f g } xä t d t i i  D]Í } | t	 |  j o Pn | | \ } } t
 |  |  _ yY xR | i |  D]A } | d j o qĽ n | | j o | i | |  i f  qĽ qĽ WWqU t i i o  d d k } H| i   d GHq"qU XqU W| |  _ d S(   sż   
        Performs image prediction, calling the given callback with each
        images that we predict to be loaded, in the rough order that
        they will be potentially loaded.
        Ni    i˙˙˙˙s   While predicting images.(   R   R   R   R@   RA   RB   t   ranget   configt   predict_statementsRX   R   t   predictR   R0   t   debug_image_cachet	   tracebackt	   print_exc(	   R   t   callbackt   old_predict_infot   nodesR8   RF   R   t   nRb   (    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\execution.pyR`   6  s0    
	$  "
c         C   sB   |  i  p t Sn | o t i i } n t i i } |  i  | j S(   s2  
        Returns a true value if we have finshed the current statement
        at least once before.

        @param ever: If True, we're checking to see if we've ever
        finished this statement. If False, we're checking to see if
        we've finished this statement in the current session.
        (   R   R   R   R@   RN   RO   (   R   t   everR'   (    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\execution.pyt   seen_currentd  s    

N(   R   R   R   t   __version__R   R   R   R   R/   R<   R=   R?   RG   RR   RS   RW   R(   RY   R\   R`   Ri   (    (    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\execution.pyR   /   s    	4		
		$			.(   R   t   objectR    t   ObjectR   R   (    (    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\execution.pys   <module>   s   