
]c           @  sH  d  d l  m Z e d i   Z d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z d  d l	 Z	 d  d l
 Z d e f d     YZ e   Z d e f d     YZ d   Z d  d	 l m Z m Z i  Z e   Z d
 e f d     YZ d   Z i  Z i  Z e   Z d   Z d f  d     YZ e a  d   Z! d   Z" d   Z# d   Z$ d e f d     YZ% d   Z& d   Z' d e j( f d     YZ) e)   Z* d   Z+ e j, d  Z- d   Z. e j, d  Z/ d   Z0 e  j1 j2 e  j3 j2 BZ4 e4 e  j5 j2 Be  j j2 Be  j6 j2 BZ7 i  Z8 i  Z9 d   Z: d  d! e; e< d"  Z= d#   Z> d$   Z? d%   Z@ e< aA d&   ZB d' e f d(     YZC d) eD f d*     YZE d+   ZF d,   ZG d- e f d.     YZH d/ e f d0     YZI d1 e f d2     YZJ d3 e jK f d4     YZL d5 e jK f d6     YZM eM   ZN e	 j	   ZO d7 aP d8 e j jQ f d9     YZR d: e j jQ f d;     YZS e; e e d< d=  ZT e; e d>  ZU e e d?  ZV e e d@  ZW e e dA  ZX dB   ZY dC e f dD     YZZ dE   Z[ dF   Z\ dG   Z] dH   Z^ d  d l_ Z_ d  d l` Z` e_ ja e` jb e[  e_ ja e` jc e]  d S(I   i(   t   print_functiont   astNt   StoreDeletedc           B  s   e  Z d    Z RS(   c         C  s   d S(   Nt   deleted(    (   t   self(    (    s   renpy/python.pyt
   __reduce__4   s    (   t   __name__t
   __module__R   (    (    (    s   renpy/python.pyR   2   s   t   StoreModulec           B  s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   sP   
    This class represents one of the modules containing the store of data.
    c         C  s   t  |  j f f S(   N(   t   get_store_moduleR   (   R   (    (    s   renpy/python.pyR   C   s    c         C  s   t  j |  d |  d  S(   Nt   __dict__(   t   objectt   __setattr__(   R   t   d(    (    s   renpy/python.pyt   __init__F   s    c         C  s   | |  j  | <d  S(   N(   R
   (   R   t   keyt   value(    (    s   renpy/python.pyR   I   s    c         C  s   |  j  | =d  S(   N(   R
   (   R   R   (    (    s   renpy/python.pyt   __delattr__L   s    (   R   R   t   __doc__R   R   R   R   (    (    (    s   renpy/python.pyR   ;   s
   			c         C  s   t  j |  S(   N(   t   syst   modules(   t   name(    (    s   renpy/python.pyR	   R   s    (   t	   DictItemst   find_changest	   StoreDictc           B  s;   e  Z d  Z d   Z d   Z d   Z d   Z d   Z RS(   s_   
    This class represents the dictionary of a store module. It logs
    sets and deletes.
    c         C  s   t  d   d  S(   Ns0   Cannot pickle a reference to a store dictionary.(   t	   Exception(   R   (    (    s   renpy/python.pyR   b   s    c         C  s   t  |   |  _ t   |  _ d  S(   N(   R   t   oldt   sett   ever_been_changed(   R   (    (    s   renpy/python.pyR   e   s    c         C  s)   t    |  _ |  j   t |   |  _ d S(   sA   
        Called to reset this to its initial conditions.
        N(   R   R   t   clearR   R   (   R   (    (    s   renpy/python.pyt   reseto   s    
c         C  s   t  |   |  _ d S(   s@   
        Called to mark the start of a rollback period.
        N(   R   R   (   R   (    (    s   renpy/python.pyt   beginx   s    c         C  s   t  |   } t |  j | t  } | r3 | |  _ n  | d k rI t t f St   } | r x@ | D]5 } | |  j k r_ |  j j	 |  | j	 |  q_ q_ Wn  | | f S(   s  
        For every key that has changed since begin() was called, returns a
        dictionary mapping the key to its value when begin was called, or
        deleted if it did not exist when begin was called.

        As a side-effect, updates self.ever_been_changed, and returns the
        changes to ever_been_changed as well.

        `cycle`
            If true, this cycles the old changes to the new changes. If
            False, does not.
        N(
   R   R   R   R   t   Nonet
   EMPTY_DICTt	   EMPTY_SETR   R   t   add(   R   t   cyclet   newt   rvt	   delta_ebct   k(    (    s   renpy/python.pyt   get_changes   s    
	(   R   R   R   R   R   R   R   R)   (    (    (    s   renpy/python.pyR   \   s   		
			c          C  s%   x t  j   D] }  |  j   q Wd S(   s+   
    Calls .begin on every store dict.
    N(   t   store_dictst
   itervaluesR   (   t   sd(    (    s   renpy/python.pyt   begin_stores   s    c         C  s-  |  j  d  \ } } } | r+ t |  n  t |   }  |  t k rG d St j |   t j |  t    } | j   |  | d <|  | d <t	 d |  x9 t
 j j j   D]% \ } } | | k r | | | <q q W|  t k r t |  t j |  <n t |  t |  <t j |  <| r)t j |  t | | <n  d S(   s(   
    Creates the store with `name`.
    t   .NR   t   __package__t   1(   t
   rpartitiont   create_storet   strt   initialized_store_dictsR#   R*   t
   setdefaultR   R   t   evalt   renpyt   minstoreR
   t	   iteritemst   store_modulesR   R   R   (   R   t   parentt   _t   varR   R(   t   v(    (    s   renpy/python.pyR2      s(    


t   StoreBackupc           B  s2   e  Z d  Z d   Z d   Z d   Z d   Z RS(   sh   
    This creates a copy of the current store, as it was at the start of
    the current statement.
    c         C  s=   i  |  _  i  |  _ i  |  _ x t D] } |  j |  q" Wd  S(   N(   t   storeR   R   R*   t
   backup_one(   R   R(   (    (    s   renpy/python.pyR      s
    			c         C  sM   t  | } t |  |  j | <| j j   |  j | <t | j  |  j | <d  S(   N(   R*   t   dictR@   R   t   as_dictR   R   (   R   R   R   (    (    s   renpy/python.pyRA      s    
c         C  sf   t  | } | j   | j |  j |  t |  j |  | _ | j j   | j j |  j |  d  S(   N(   R*   R   t   updateR@   R   R   R   (   R   R   R,   (    (    s   renpy/python.pyt   restore_one   s    

c         C  s"   x t  D] } |  j |  q Wd  S(   N(   R*   RE   (   R   R(   (    (    s   renpy/python.pyt   restore  s    (   R   R   R   R   RA   RE   RF   (    (    (    s   renpy/python.pyR?      s
   			c          C  sA   x1 t  j   D]# \ }  } | j j   | j   q Wt   a d S(   s    
    Copy the clean stores.
    N(   R*   R9   R   R   R   R?   t   clean_store_backup(   t   _kR>   (    (    s   renpy/python.pyt   make_clean_stores  s    c           C  s   t  j   d S(   s-   
    Revert the store to the clean copy.
    N(   RG   RF   (    (    (    s   renpy/python.pyt   clean_stores   s    c         C  s-   |  j  d  s d |  }  n  t j |   d S(   s4   
    Reverts the named store to its clean copy.
    s   store.N(   t
   startswithRG   RE   (   R   (    (    s   renpy/python.pyt   clean_store(  s    c         C  s4   |  j  d  s d |  }  n  t |  } | j   d  S(   Ns   store.(   RK   R*   R   (   R   R,   (    (    s   renpy/python.pyt   reset_store_changes3  s    
t
   NoRollbackc           B  s   e  Z d  Z RS(   s  
    :doc: norollback class

    Instances of classes inheriting from this class do not participate in
    rollback. Objects reachable through an instance of a NoRollback class
    only participate in rollback if they are reachable through other paths.
    (   R   R   R   (    (    (    s   renpy/python.pyRN   ?  s   c         C  s'  | r |   n  t  |   } | | k r, d St |  t t f  rO d | | <d Sd | | <t |  t  rl d Sy1 x* t |   j   D] } t | | |  q WWn n Xy= t |  t  s x' |  j	   D] } t | | |  q Wn  Wn n Xy+ x$ |  j   D] } t | | |  q WWn n Xd S(   s  
    @param obj: The object that was reached.
    @param path: The path from the store via which it was reached.

    `reachable`
        A map from id(obj) to int. The int is 1 if the object was reached
        normally, and 0 if it was reached, but inherits from NoRollback.

    Ni    i   (
   t   idt
   isinstanceRN   t	   real_fileR   t   varsR+   t   reachedt
   basestringt   __iter__(   t   objt	   reachablet   waitt   idobjR>   (    (    s   renpy/python.pyRS   M  s6    


c         C  s   x$ |  j    D] } t | | |  q Wxu t j j D]g } t | j | |  t | j | |  x8 | j D]- } x$ | j    D] } t | | |  q} Wqj Wq4 Wd S(   s%  
    Marks everything reachable from the variables in the store
    or from the context info objects as reachable.

    @param store: A map from variable name to variable value.
    @param reachable: A dictionary mapping reached object ids to
    the path by which the object was reached.
    N(   R+   RS   R7   t   gamet   contextst   infot   musict   dynamic_stack(   R@   RW   RX   R>   t   cR   (    (    s   renpy/python.pyt   reached_vars  s    
t   WrapNodec           B  sG   e  Z d    Z d   Z d   Z d   Z d   Z d   Z d   Z RS(   c         C  sG   |  j  |  } | j sC | j j t j d d d t j     n  | S(   NRO   R   t   ctx(   t   generic_visitt   basest   appendR   t   Namet   Load(   R   t   n(    (    s   renpy/python.pyt   visit_ClassDef  s    	+c         C  sL   t  j d t  j d d d t  j    d |  j |  g d g  d d  d d   S(	   Nt   funcRO   t   __renpy__set__Rb   t   argst   keywordst   starargst   kwargs(   R   t   CallRf   Rg   Rc   R    (   R   Rh   (    (    s   renpy/python.pyt   visit_SetComp  s    		c         C  sL   t  j d t  j d d d t  j    d |  j |  g d g  d d  d d   S(	   NRj   RO   Rk   Rb   Rl   Rm   Rn   Ro   (   R   Rp   Rf   Rg   Rc   R    (   R   Rh   (    (    s   renpy/python.pyt	   visit_Set  s    		c         C  sL   t  j d t  j d d d t  j    d |  j |  g d g  d d  d d   S(	   NRj   RO   t   __renpy__list__Rb   Rl   Rm   Rn   Ro   (   R   Rp   Rf   Rg   Rc   R    (   R   Rh   (    (    s   renpy/python.pyt   visit_ListComp  s    		c         C  sn   t  | j t j  s" |  j |  St j d t j d d d t j    d |  j |  g d g  d d  d d   S(	   NRj   RO   Rs   Rb   Rl   Rm   Rn   Ro   (   RP   Rb   R   Rg   Rc   Rp   Rf   R    (   R   Rh   (    (    s   renpy/python.pyt
   visit_List  s    		c         C  sL   t  j d t  j d d d t  j    d |  j |  g d g  d d  d d   S(	   NRj   RO   t   __renpy__dict__Rb   Rl   Rm   Rn   Ro   (   R   Rp   Rf   Rg   Rc   R    (   R   Rh   (    (    s   renpy/python.pyt   visit_DictComp  s    		c         C  sL   t  j d t  j d d d t  j    d |  j |  g d g  d d  d d   S(	   NRj   RO   Rv   Rb   Rl   Rm   Rn   Ro   (   R   Rp   Rf   Rg   Rc   R    (   R   Rh   (    (    s   renpy/python.pyt
   visit_Dict  s    		(	   R   R   Ri   Rq   Rr   Rt   Ru   Rw   Rx   (    (    (    s   renpy/python.pyRa     s   						c         C  sc   t  j d  } x. t  j |  D] } t  j | | j d  q W|  j | j d _ | j |  _ d S(   s   
    Wraps code inside a python hide or python early hide block inside a
    function, so it gets its own scope that works the way Python expects
    it to.
    s9   def _execute_python_hide(): pass;
_execute_python_hide()
i    N(   R   t   parset   walkt   copy_locationt   body(   t   treet   hidet   i(    (    s   renpy/python.pyt	   wrap_hide  s    	u   [-￿]c         C  s   |  j  d  } t j |  s" | S|  j  d  } |  j  d  } |  j  d  } d | k rt d | k rt d | } n  | | | | } | S(   sZ   
    If the string s contains a unicode character, make it into a
    unicode string.
    i    i   i   i   t   ut   U(   t   groupt
   unicode_ret   search(   t   mt   st   prefixt   sepR|   R&   (    (    s   renpy/python.pyt   unicode_sub  s    s*   ([uU]?[rR]?)("""|"|\'\'\'|\')((\\.|.)*?)\2c         C  s(   t  j |   r$ t j t |   }  n  |  S(   N(   R   R   t	   string_ret   subR   (   R   (    (    s   renpy/python.pyt   escape_unicode"  s    c         C  s   d |  j  k r6 t |  d  s* | |  _ q6 |  j } n  d |  j  k rl t |  d  s` | |  _ ql |  j } n  x' t j |   D] } t | | |  q| Wd  S(   Nt   linenot
   col_offset(   t   _attributest   hasattrR   R   R   t   iter_child_nodest   fix_missing_locations(   t   nodeR   R   t   child(    (    s   renpy/python.pyR   =  s    s   <none>i   c         C  s  | r t  } n  t |  t j  r1 t |  | |  St |  t j j  r[ |  j } |  j } n  | r*| | t	 |   | t j
 j f } t j | d  } | d k	 r | St j | d  } | d k	 r | t | <| St j j
 j j | d  } | d k	 r*| t j j
 j | <t j |  } | t | <| Sn  t	 |   }  |  j d d  }  t |   }  y:| d }	 | d k rvd }
 n | }
 y) t } t |  | |
 t j | Bd  } Wn, t } t |  | |
 t j | Bd  } n Xt j |  } | d k rt |  n  t | d d  t j | | d  d }	 | r3| j St | | |
 | d  } | r| t | <t j  |  t j j
 j | <t! t j j
 _" n  | SWn: t# k
 r} | j$ d k	 r| j$ |	 7_$ n  |  n Xd S(   s  
    Compiles the given source code using the supplied codegenerator.
    Lists, List Comprehensions, and Dictionaries are wrapped when
    appropriate.

    `source`
        The source code, as a either a string, pyexpr, or ast module
        node.

    `mode`
        One of "exec" or "eval".

    `filename`
        The filename the source comes from. If a pyexpr is given, the
        filename embedded in the pyexpr is used.

    `lineno`
        The line number of the first line of source code. If a pyexpr is
        given, the filename embedded in the pyexpr is used.

    `ast_node`
        Rather than returning compiled bytecode, returns the AST object
        that would be used.
    s   t    i   R~   t   execi    N(%   t   FalseRP   R   t   Modulet   compileR7   t   PyExprt   filenamet
   linenumbert   unicodet   scriptt   MAGICt   py_compile_cachet   getR    t   old_py_compile_cacheRZ   t   bytecode_oldcachet   bytecode_newcachet   marshalt   loadst   replaceR   t   new_compile_flagst   PyCF_ONLY_ASTt   old_compile_flagst	   wrap_nodet   visitR   R   t   increment_linenoR|   t   dumpst   Truet   bytecode_dirtyt   SyntaxErrorR   (   t   sourcet   modeR   R   t   ast_nodet   cacheR   R&   t   bytecodet   line_offsett   py_modet   flagsR}   t   e(    (    s   renpy/python.pyt
   py_compileL  sl    		!


	##
c         K  s%   t  |  d d t | } t j |  S(   NR   R   (   R   R   R   R   (   R   Ro   t   code(    (    s   renpy/python.pyt   py_compile_exec_bytecode  s    c         K  s%   t  |  d d t | } t j |  S(   NR~   R   (   R   R   R   R   (   R   Ro   R   (    (    s   renpy/python.pyt   py_compile_hide_bytecode  s    c         K  s1   |  j    }  t |  d d t | } t j |  S(   NR6   R   (   t   stripR   R   R   R   (   R   Ro   R   (    (    s   renpy/python.pyt   py_compile_eval_bytecode  s    c           s     f d   } | S(   Nc           s_   t  j j j } t |   | k rO t j |   |  j   f | t |   <t a	 n    |  | |  S(   N(
   R7   RZ   t   logt   mutatedRO   t   weakreft   reft   _cleanR   t   mutate_flag(   R   Rl   Ro   R   (   t   method(    s   renpy/python.pyt   do_mutation  s
    %	(    (   R   R   (    (   R   s   renpy/python.pyt   mutator  s    t   CompressedListc           B  s)   e  Z d  Z d   Z d   Z d   Z RS(   s  
    Compresses the changes in a queue-like list. What this does is to try
    to find a central sub-list for which has objects in both lists. It
    stores the location of that in the new list, and then elements before
    and after in the sub-list.

    This only really works if the objects in the list are unique, but the
    results are efficient even if this doesn't work.
    c         C  s  t  |  d d } | | } t  |  d d } x t d | d  D]J } | | | | k rn | | } Pn  | | | | k rF | | } PqF qF W| |  _ d |  _ d |  _ g  |  _ d  S| } | d }	 | }
 | d } t  |  } t  |  } x@ | r6|
 r6| | d | |
 d k r6| d 8} |
 d 8}
 q WxD |	 | k  r}| | k  r}| |	 | | k r}|	 d 7}	 | d 7} q:Wt j | d |
  |  _ | |  _ |	 |  _ t j | | |  |  _ d  S(   Ni   i   i    (   t   lent   ranget   pret   startt   endt   postt   listt   __getslice__(   R   R   R%   t
   new_centert	   new_pivott   old_halfR   t
   old_centert	   new_startt   new_endt	   old_startt   old_endt   len_newt   len_old(    (    s   renpy/python.pyR     s>    


				

+
/
		c         C  s   |  j  | |  j |  j !|  j S(   N(   R   R   R   R   (   R   R%   (    (    s   renpy/python.pyt
   decompress  s    c         C  s"   d j  |  j |  j |  j |  j  S(   Ns   <CompressedList {} [{}:{}] {}>(   t   formatR   R   R   R   (   R   (    (    s   renpy/python.pyt   __repr__  s
    (   R   R   R   R   R   R   (    (    (    s   renpy/python.pyR     s   		3	t   RevertableListc           B  s  e  Z d    Z e e j  Z e e j  Z e e j  Z e e j  Z e e j	  Z	 e e j
  Z
 e e j  Z e e j  Z e e j  Z e e j  Z e e j  Z e e j  Z d   Z e e j  Z e e j  Z d   Z e Z d   Z d   Z d   Z RS(   c         G  sB   t  j j } | d  k	 r. d  | j t |   <n  t j |  |  d  S(   N(   R7   RZ   R   R    R   RO   R   R   (   R   Rl   R   (    (    s   renpy/python.pyR   )  s    c           s     f d   } | S(   Nc            s     |  |   } t  |  S(   N(   R   (   Rl   Ro   t   l(   R   (    s   renpy/python.pyt	   newmethod?  s    (    (   R   R   (    (   R   s   renpy/python.pyt   wrapper>  s    c         C  sF   t  | t  s0 t d j t |  j    n  t t j |  |   S(   Ns0   can't multiply sequence by non-int of type '{}'.(	   RP   t   intt	   TypeErrorR   t   typeR   R   R   t   __mul__(   R   t   other(    (    s   renpy/python.pyR   H  s    !c         C  s   |  S(   sN   
        Gets a clean copy of this object before any mutation occurs.
        (    (   R   (    (    s   renpy/python.pyR   P  s    c         C  si   |  s | r | St  j j d k r( | St |   t  j j k  sX t |  t  j j k  r\ | St | |   S(   s   
        Takes a clean copy of this object, compresses it, and returns compressed
        information that can be passed to rollback.
        N(   R7   t   configt   list_compression_lengthR    R   R   (   R   t   clean(    (    s   renpy/python.pyt	   _compressW  s    0c         C  s-   t  | t  r" | j |   |  (n | |  (d S(   s   
        Rolls this object back, using the information created by _compress.

        Since compressed can come from a save file, this method also has to
        recognize and deal with old data.
        N(   RP   R   R   (   R   t
   compressed(    (    s   renpy/python.pyt	   _rollbackh  s    (   R   R   R   R   R   t   __delitem__t   __delslice__t   __setitem__t   __iadd__t   __imul__Re   t   extendt   insertt   popt   removet   reverset   sortR   t   __add__R   R   t   __rmul__R   R   R   (    (    (    s   renpy/python.pyR   '  s*   					c          G  s   t  t |     S(   N(   R   R   (   Rl   (    (    s   renpy/python.pyt   revertable_rangev  s    c          O  s   t  t |  |    S(   N(   R   t   sorted(   Rl   Ro   (    (    s   renpy/python.pyt   revertable_sortedz  s    t   RevertableDictc           B  s   e  Z d    Z e e j  Z e e j  Z e e j  Z e e j  Z e e j	  Z	 e e j
  Z
 e e j  Z d   Z e e j  Z e e j  Z e e j  Z [ d   Z d   Z d   Z d   Z RS(   c         O  sE   t  j j } | d  k	 r. d  | j t |   <n  t j |  | |  d  S(   N(   R7   RZ   R   R    R   RO   RB   R   (   R   Rl   Ro   R   (    (    s   renpy/python.pyR     s    c           s     f d   } | S(   Nc            s   t    |  |    S(   N(   R   (   Rl   Ro   (   R   (    s   renpy/python.pyR     s    (    (   R   R   (    (   R   s   renpy/python.pyt   list_wrapper  s    c         C  s   t    } | j |   | S(   N(   R   RD   (   R   R&   (    (    s   renpy/python.pyt   copy  s    	c         C  s
   |  j    S(   N(   t   items(   R   (    (    s   renpy/python.pyR     s    c         C  s   | S(   N(    (   R   R   (    (    s   renpy/python.pyR     s    c         C  s/   |  j    x | D] \ } } | |  | <q Wd  S(   N(   R   (   R   R   R(   R>   (    (    s   renpy/python.pyR     s    
(   R   R   R   R   RB   R   R   R   R   t   popitemR5   RD   R  t   keyst   valuesR  R  R   R   R   (    (    (    s   renpy/python.pyR   ~  s"   					t   RevertableSetc           B  s  e  Z d    Z d   Z e j Z e j Z d   Z e e	 j
  Z
 e e	 j  Z e e	 j  Z e e	 j  Z e e	 j  Z e e	 j  Z e e	 j  Z e e	 j  Z e e	 j  Z e e	 j  Z e e	 j  Z e e	 j  Z e e	 j  Z e e	 j  Z d   Z e e	 j  Z e e	 j  Z e e	 j  Z e e	 j  Z e e	 j  Z e e	 j  Z e e	 j  Z e e	 j   Z  e e	 j!  Z! [ d   Z" d   Z# d   Z$ RS(   c         C  s:   t  | t  r) |  j | d j    n |  j |  d  S(   Ni    (   RP   t   tupleRD   R  (   R   t   state(    (    s   renpy/python.pyt   __setstate__  s    c         C  s   d   |  D f } | S(   Nc         S  s   i  |  ] } t  |  q S(    (   R   (   t   .0R   (    (    s   renpy/python.pys
   <dictcomp>  s   	 (    (   R   R&   (    (    s   renpy/python.pyt   __getstate__  s    c         G  sB   t  j j } | d  k	 r. d  | j t |   <n  t j |  |  d  S(   N(   R7   RZ   R   R    R   RO   R   R   (   R   Rl   R   (    (    s   renpy/python.pyR     s    c           s     f d   } | S(   Nc            s6     |  |   } t  | t t f  r. t |  S| Sd  S(   N(   RP   R   t	   frozensetR  (   Rl   Ro   R&   (   R   (    s   renpy/python.pyR     s    
(    (   R   R   (    (   R   s   renpy/python.pyR     s    c         C  s
   t  |   S(   N(   R   (   R   (    (    s   renpy/python.pyR     s    c         C  s   | S(   N(    (   R   R   (    (    s   renpy/python.pyR     s    c         C  s!   t  j |   t  j |  |  d  S(   N(   R   R   RD   (   R   R   (    (    s   renpy/python.pyR     s    (%   R   R   R
  R  R   R   t   __reduce_ex__R   R   R   t   __iand__t   __ior__t   __isub__t   __ixor__R#   R   t   difference_updatet   discardt   intersection_updateR   R   t   symmetric_difference_updateRD   t   union_updateR   t   __and__t   __sub__t   __xor__t   __or__R  t
   differencet   intersectiont   symmetric_differencet   unionR   R   R   (    (    (    s   renpy/python.pyR    sB   						
		t   RevertableObjectc           B  s_   e  Z d    Z d   Z d   Z d   Z e e  Z e e  Z d   Z d   Z d   Z	 RS(   c         O  sJ   t  t |   j |   } t j j } | d  k	 rF d  | j t |  <n  | S(   N(	   t   superR   t   __new__R7   RZ   R   R    R   RO   (   t   clsRl   Ro   R   R   (    (    s   renpy/python.pyR"    s
    c         O  s+   | s | r' t  j j r' t d   n  d  S(   Ns   object() takes no parameters.(   R7   R   t	   developerR   (   R   Rl   Ro   (    (    s   renpy/python.pyR     s    c         C  s   t  j |  | |  d  S(   N(   R   R   (   R   t   attrR   (    (    s   renpy/python.pyR     s    c         C  s   t  j |  |  d  S(   N(   R   R   (   R   R%  (    (    s   renpy/python.pyR     s    c         C  s   |  j  j   S(   N(   R
   R  (   R   (    (    s   renpy/python.pyR     s    c         C  s   | S(   N(    (   R   R   (    (    s   renpy/python.pyR     s    c         C  s!   |  j  j   |  j  j |  d  S(   N(   R
   R   RD   (   R   R   (    (    s   renpy/python.pyR     s    (
   R   R   R"  R   R   R   R   R   R   R   (    (    (    s   renpy/python.pyR     s   							t   RollbackRandomc           B  s   e  Z d  Z d   Z d   Z d   Z d   Z e e j	 j
  Z
 e e j	 j  Z e e j	 j  Z e e j	 j  Z e e j	 j  Z d d  Z	 RS(   sJ   
    This is used for Random objects returned by renpy.random.Random.
    c         C  sE   t  j j } | d  k	 r. d  | j t |   <n  t t |   j   d  S(   N(	   R7   RZ   R   R    R   RO   R!  R&  R   (   R   R   (    (    s   renpy/python.pyR     s    c         C  s
   |  j    S(   N(   t   getstate(   R   (    (    s   renpy/python.pyR   &  s    c         C  s   | S(   N(    (   R   R   (    (    s   renpy/python.pyR   )  s    c         C  s   t  t |   j |  d  S(   N(   R!  R&  t   setstate(   R   R   (    (    s   renpy/python.pyR   ,  s    c         C  s5   | d k r |  j   } n  t   } | j |  | S(   sF   
        Returns a new RNG object separate from the main one.
        N(   R    t   randomR&  t   seed(   R   R*  R%   (    (    s   renpy/python.pyt   Random5  s
    	N(   R   R   R   R   R   R   R   R   R)  R+  R(  t	   jumpaheadt   getrandbitsR*  R    (    (    (    s   renpy/python.pyR&    s   				t	   DetRandomc           B  s>   e  Z d  Z d   Z d   Z d   Z d   Z d d  Z RS(   s   
    This is renpy.random.
    c         C  s    t  t |   j   g  |  _ d  S(   N(   R!  R.  R   t   stack(   R   (    (    s   renpy/python.pyR   G  s    c         C  se   |  j  r |  j  j   } n t t |   j   } t j j } | j d  k	 ra | j j j
 |  n  | S(   N(   R/  R   R!  R.  R)  R7   RZ   R   t   currentR    Re   (   R   R&   R   (    (    s   renpy/python.pyR)  K  s    	c         C  s%   | } | j    |  j j |  d S(   su   
        Pushes the random numbers in l onto the stack so they will be generated
        in the order given.
        N(   R   R/  R   (   R   R   t   ll(    (    s   renpy/python.pyt   pushbackY  s    
c         C  s   |  j  2d S(   sI   
        Resets the RNG, removing all of the pushbacked numbers.
        N(   R/  (   R   (    (    s   renpy/python.pyR   d  s    c         C  s5   | d k r |  j   } n  t   } | j |  | S(   sF   
        Returns a new RNG object separate from the main one.
        N(   R    R)  R&  R*  (   R   R*  R%   (    (    s   renpy/python.pyR+  k  s
    	N(	   R   R   R   R   R)  R2  R   R    R+  (    (    (    s   renpy/python.pyR.  B  s   				i    t   Rollbackc           B  sG   e  Z d  Z d Z d Z d   Z d   Z d   Z d   Z	 d   Z
 RS(   s<  
    Allows the state of the game to be rolled back to the point just
    before a node began executing.

    @ivar context: A shallow copy of the context we were in before
    we started executing the node. (Shallow copy also includes
    a copy of the associated SceneList.)

    @ivar objects: A list of tuples, each containing an object and a
    token of information that, when passed to the rollback method on
    that object, causes that object to rollback.

    @ivar store: A list of updates to store that will cause the state
    of the store to be rolled back to the start of node
    execution. This is a list of tuples, either (key, value) tuples
    representing a value that needs to be assigned to a key, or (key,)
    tuples that mean the key should be deleted.

    @ivar checkpoint: True if this is a user-visible checkpoint,
    false otherwise.

    @ivar purged: True if purge_unreachable has already been called on
    this Rollback, False otherwise.

    @ivar random: A list of random numbers that were generated during the
    execution of this element.
    i   c         C  s   t  t |   j   t j j   j   |  _ g  |  _ t |  _	 g  |  _
 d  |  _ i  |  _ i  |  _ t |  _ t |  _ t |  _ t t f |  _ t d 7a d  S(   Ni   (   R!  R3  R   R7   RZ   t   contextt   rollback_copyt   objectsR   t   purgedR)  R    t   forwardt   storesR'   t   retain_after_loadt
   checkpointt   hard_checkpointt
   generationt   serialt
   identifier(   R   (    (    s   renpy/python.pyR     s    									c         C  s   | d k  r i i  d 6|  _  x` |  j D]R } t |  d k r^ | \ } } | |  j  d | <q& | \ } t |  j  d | <q& Wn  | d k  r t |  _ n  | d k  r |  j |  _ n  | d k  r i  |  _ n  d  S(   Ni   R@   i   i   i   (	   R9  R@   R   R   R   R:  R;  R<  R'   (   R   t   versionR   R(   R>   (    (    s   renpy/python.pyt   after_upgrade  s    	c   
      C  s}  |  j  r t St |  _  xS |  j j   D]B } x9 | j   D]+ \ } } | t k	 r9 t | | |  q9 q9 Wq& Wt |  j j	 | |  x; |  j j
 D]- } x$ | j   D] } t | | |  q Wq Wt |  j j j   | |  g  } x} |  j D]r \ } }	 | j t |  d  r6| j | |	 f  t |	 | |  q t j j r t d | d t j j q q W|  j 2|  j j |  t S(   sT  
        Adds objects that are reachable from the store of this
        rollback to the set of reachable objects, and purges
        information that is stored about totally unreachable objects.

        Returns True if this is the first time this method has been
        called, or False if it has already been called once before.
        i    s   Removing unreachable:t   file(   R7  R   R   R9  R+   R9   R   RS   R4  R\   R^   t   scene_listst   get_all_displayablesR6  R   RO   Re   R7   R   t   debugt   printR   t   real_stdoutR   (
   R   RW   RX   t   changesRH   R>   R   t   new_objectst   ot   rb(    (    s   renpy/python.pyt   purge_unreachable  s.    
		c         C  sY  x9 t  |  j  D]( \ } } | d k	 r | j |  q q Wx |  j j   D]| \ } } t j | d  } | d k r| qL n  xI | j   D]; \ } } | t k r | | k r | | =q q | | | <q WqL WxP |  j	 j   D]? \ } } t j | d  } | d k rq n  | j
 | 8_
 q Wt j |  j  t j j j   t j j j |  j  d S(   so   
        Reverts the state of the game to what it was at the start of the
        previous checkpoint.
        N(   t   reversedR6  R    R   R9  R9   R*   R   R   R'   R   t   rngR2  R)  R7   RZ   R[   R   Re   R4  (   R   RV   t   rollR   RH  R@   R   (    (    s   renpy/python.pyt   rollback
  s(    c         C  s*   t  j j j   t  j j j |  j  d S(   sr   
        This rolls back only the control information, while leaving
        the data information intact.
        N(   R7   RZ   R[   R   Re   R4  (   R   (    (    s   renpy/python.pyt   rollback_control-  s    N(   R   R   R   t   __version__R    R?  R   RA  RL  RP  RQ  (    (    (    s   renpy/python.pyR3    s   	"		0	#t   RollbackLogc           B  s4  e  Z d  Z d Z d d d g Z d Z e Z d   Z	 d   Z
 d   Z e d  Z d	   Z e d
  Z d   Z d d  Z d   Z d   Z d   Z d e e d  Z d   Z e d  Z d   Z d   Z d   Z d   Z e d e e e d d  Z d d  Z d   Z d d  Z d   Z  d   Z! RS(   s  
    This class manages the list of Rollback objects.

    @ivar log: The log of rollback objects.

    @ivar current: The current rollback object. (Equivalent to
    log[-1])

    @ivar rollback_limit: The number of steps left that we can
    interactively rollback.

    Not serialized:

    @ivar mutated: A dictionary that maps object ids to a tuple of
    (weakref to object, information needed to rollback that object)
    i   t	   old_storeR   t   identifier_cachec         C  s   t  t |   j   g  |  _ d  |  _ i  |  _ d |  _ t |  _	 t |  _
 d  |  _ g  |  _ i  |  _ t |  _ t j   t |  _ t |  _ t |  _ d  S(   Ni    (   R!  RS  R   R   R    R0  R   t   rollback_limitR   t   rollback_is_fixedt   checkpointing_suspendedt   fixed_rollback_boundaryR8  RT  t   rolled_forwardRN  R   t   retain_after_load_flagR   t   did_interactiont   force_checkpoint(   R   (    (    s   renpy/python.pyR   O  s    										
		c         C  s   i  |  _  t |  _ d  S(   N(   R   R   RZ  (   R   (    (    s   renpy/python.pyt   after_setstateo  s    	c         C  s   | d k  r( i t  |  j  d 6|  _ n  | d k  rI t |  _ d  |  _ n  | d k  ra t |  _ n  | d k  r |  j r d } x/ |  j |  j D] } | j	 r | d 7} q q W| |  _ q n  d  S(   Ni   R@   i   i   i   i    i   (
   R   R   R   RW  R    RY  R[  RV  R   R<  (   R   R@  t   nrblRK  (    (    s   renpy/python.pyRA  s  s    			c         C  s  d |  _ t j j   } | j s% d St } | r: t } nN |  j rL t } n< |  j	 d k	 r |  j	 j
 rp t } q |  j	 j r t } q n  | r d St |  _ |  j	 d k	 r |  j t  n t   x/ t |  j  t j j k r |  j j d  q W|  j rj|  j d |  j	 k rj|  j	 j j	 |  j k r6t |  _ qj|  j rj|  j rj|  j	 j j	 |  _ t |  _ qjn  t   |  _	 |  j |  j	 _ |  j j |  j	  |  j j   t a t |  _ d S(   s~   
        Called before a node begins executing, to indicate that the
        state needs to be saved for rollbacking.
        Ni    i(   R    RU  R7   RZ   R4  RP  R   R   R\  R0  R;  R:  t   completeR-   R   R   R   t   rollback_lengthR   RY  RW  R8  R3  R[  Re   R   R   R   RZ  (   R   t   forceR4  t   ignore(    (    s   renpy/python.pyR     sD    							c         C  s+   x$ |  j  D] } | j j | |  q
 Wd S(   sk   
        Replaces references to the `old` ast node with a reference to the
        `new` ast node.
        N(   R   R4  t   replace_node(   R   R   R%   R   (    (    s   renpy/python.pyRd    s    c         C  s*  |  j  r% |  j d t  t |  _  n  xC t j   D]5 \ } } | j |  \ |  j j | <|  j j | <q2 Wx t	 d  D] } |  j j
 2y x~ |  j j   D]m \ } } | d k r q n  | \ } } |   }	 |	 d k r q n  |	 j |  }
 |  j j
 j |	 |
 f  q WPWqx t k
 r!qx Xqx Wd S(   sp  
        Called after a node is finished executing, before a save
        begins, or right before a rollback is attempted. This may be
        called more than once between calls to begin, and should always
        be called after an update to the store but before a rollback
        occurs.

        `begin`
            Should be true if called from begin().
        t   hardi   N(   R]  R;  R   R*   R9   R)   R0  R9  R'   t   xrangeR6  R   R    R   Re   t   RuntimeError(   R   R   R   R,   t   _iRH   R>   R   R   RV   R   (    (    s   renpy/python.pyR`    s(    	-
	c         C  s   i  } xe t  j   D]W \ } } xH | j D]= } | | k rT | | | | d | <q) t | | d | <q) Wq Wx+ t t j j d  D] } | j |  q W| S(   s  
        Return a map giving the current roots of the store. This is a
        map from a variable name in the store to the value of that
        variable. A variable is only in this map if it has ever been
        changed since the init phase finished.
        R.   i   (	   R*   R9   R   R   RM  R7   RZ   R[   t   pop_dynamic_roots(   R   R&   t
   store_nameR,   R   R   (    (    s   renpy/python.pyt	   get_roots  s    c         C  sU   i  } t  | | |  |  j } | j   x$ | D] } | j | |  s1 Pq1 q1 Wd S(   s  
        This is called to purge objects that are unreachable from the
        roots from the object rollback lists inside the Rollback entries.

        This should be called immediately after complete(), so that there
        are no changes queued up.
        N(   R`   R   R   RL  (   R   t   rootsRX   RW   t   revlogR   (    (    s   renpy/python.pyRL    s    	

c         C  s   |  j  r t St Sd  S(   N(   R8  R   R   (   R   (    (    s   renpy/python.pyt   in_rollback0  s    	c         C  s   |  j  S(   N(   RW  (   R   (    (    s   renpy/python.pyt   in_fixed_rollback6  s    c         C  s<   |  j  r8 |  j  d \ } } |  j j j | k r8 | Sn  d S(   s;   
        Returns the current forward info, if any.
        i    N(   R8  R0  R4  R    (   R   R   t   data(    (    s   renpy/python.pyt   forward_info9  s
    	c         C  s  |  j  r t } n  t |  _ |  j j r+ d St j j   j sA d St	 |  j _ | r |  j j
 r |  j t j j k  r |  j d 7_ n  | |  j _
 n  |  j   r|  j r|  j d \ } } |  j j j | k r | |  j _ |  j j d  q| |  j _ |  j 2n | d k	 r|  j r}|  j d \ } } |  j j j | k rs| | k rs| s`|  j rs|  j j d  q}|  j 2n  | |  j _ n  d S(   s   
        Called to indicate that this is a checkpoint, which means
        that the user may want to rollback to just before this
        node.
        Ni   i    (   RX  R   R[  R0  R;  R7   RZ   R4  RP  R   R<  RV  R   t   hard_rollback_limitRo  R8  R   R    RZ  (   R   Rp  t   keep_rollbackRe  t   fwd_namet   fwd_data(    (    s   renpy/python.pyR;  G  s8    			
	
c         C  s   | |  _  d S(   s{   
        Called to temporarily suspend checkpointing, so any rollback
        will jump to prior to this statement
        N(   RX  (   R   t   flag(    (    s   renpy/python.pyt   suspend_checkpointing{  s    c         C  s/   d |  _  t t j j   _ | r+ |  j 2n  d S(   sr   
        Called to indicate that the user should not be able to rollback
        through this checkpoint.
        i    N(   RV  R   R7   RZ   R4  R]  R   (   R   t   purge(    (    s   renpy/python.pyt   block  s    	c         C  s>   t  j j j r d St |  _ t |  j _ t t  j j	   _
 d S(   sv   
        Called to return data from this statement until the next checkpoint
        when the game is loaded.
        N(   R7   t   displayt   predictt
   predictingR   R[  R0  R:  RZ   R4  R]  (   R   (    (    s   renpy/python.pyR:    s
    	c         C  s<   |  j  r8 t |  j  d k r8 |  j d j j |  _ n  d  S(   Ni   i(   RW  R   R   R4  R0  RY  (   R   (    (    s   renpy/python.pyt   fix_rollback  s    c         C  s   |  j  d k S(   s2   
        Returns True if we can rollback.
        i    (   RV  (   R   (    (    s   renpy/python.pyt   can_rollback  s    c         C  s   t  j j s t d   n  |  j j   } | j   x  t  j j   rV t  j j	   q7 Wt
 t  j j d _ t  j j d j t  j j  t  j j    d S(   sG   
        This is called to try to recover when rollback fails.
        s^   Couldn't find a place to stop rolling back. Perhaps the script changed in an incompatible way?i    N(   R7   R   t   load_failed_labelR   R   R   RP  t   exportst   call_stack_deptht   pop_callR   RZ   R[   R]  t
   goto_labelt   RestartTopContext(   R   RK  (    (    s   renpy/python.pyt   load_failed  s    
c         C  s  | r  |  j  d k r  | r  d S|  j t  |  j |  j    g  } x |  j r |  j j   }	 | j |	  |	 j r |  j  d 8_  n  |	 j s | r |	 j	 r | d 8} n  | d k rI t
 j j j |	 j j  r Pq qI qI W| j   |  j j |  | r|  j   n
 t d  d St }
 xq | r|  j r|  j  d k r|  j d }	 t
 j j j |	 j j  snPn  |	 j r{Pn  | j |  j j    q$Wt
 j j   j rt } g  } n/ t } t
 j j d } t
 j j d d !t
 j _ | r| d j r| j   } t |  _ n d } d } | d k	 rCt
 j j   j } | } n  xm | D]e }	 |	 j   |	 j j |  j k r{t |  _ n  |	 j d k	 rJ|  j j d |	 j j |	 j f  qJqJW| d k	 r| j   |  j j |  n  | d k	 r	| d k r	t
 j j   j } n  | d k	 r1t
 j j   j | |  n  | t
 j j  _! | rZt" j#   |  j 2n  | t
 j _$ t
 j% j% j   x! t
 j j D] } | j& j'   qWt
 j j j |  t(   | r|
 rt t
 j j d _) n  t
 j j*    n* |
 rt t
 j j   _) n  t
 j j+    d S(   s  
        This rolls the system back to the first valid rollback point
        after having rolled back past the specified number of checkpoints.

        If we're currently executing code, it's expected that complete()
        will be called before a rollback is attempted.

        force makes us throw an exception if we can't find a place to stop
        rolling back, otherwise if we run out of log this call has no
        effect.

        `label`
            A label that is called after rollback has finished, if the
            label exists.

        `greedy`
            If true, rollback will keep going until just after the last
            checkpoint. If False, it will stop immediately before the
            current statement.

        `on_load`
            Should be true if this rollback is being called in response to a
            load. Used to implement .retain_after_load()

        `abnormal`
            If true, treats this as an abnormal event, suppressing transitions
            and so on.

        `current_label`
            A lable that is called when control returns to the current statement,
            after rollback. (At most one of `current_label` and `label` can be
            provided.)
        i    Ni   s4   Can't find a place to rollback to. Not rolling back.i(,   RV  Rw  R   RL  Rk  R   R   Re   R<  R;  R7   RZ   R   t	   has_labelR4  R0  R   R   R  RF  RP  R   R[   R:  R[  R    RY  RW  R8  R   RQ  t	   come_fromt	   interfacet   suppress_transitionRN  R   t   after_rollbackt   audioRC  t   remove_all_hiddenR-   R]  R  t   RestartContext(   R   t   checkpointsRb  t   labelt   greedyt   on_loadt   abnormalt   current_labelRm  RK  R]  t   replace_contextt   other_contextst   retainedR  R   (    (    s   renpy/python.pyRP    s    %	

!			
)


c         C  s<   |  j  t  |  j   } |  j | d | t |  j _ | S(   s	  
        This is called to freeze the store and the log, in preparation
        for serialization. The next call on log should either be
        unfreeze (called after a serialization reload) or discard_freeze()
        (called after the save is complete).
        RX   (   R`  R   Rk  RL  R0  R7  (   R   RX   Rl  (    (    s   renpy/python.pyt   freezed  s
    	c         C  s   d S(   sa   
        Called to indicate that we will not be restoring from the
        frozen state.
        N(    (   R   (    (    s   renpy/python.pyt   discard_freezev  s    c      
   C  s  t  j j j   |  t  j _ t   t  j j   x | j	   D] \ } } d | k rp | j
 d d  \ } } n d } | t k r q= n  t | } | j j |  | t k r | | k r | | =q q= | | | <q= Wt  j j d t  } |  j d d t d | d | d	 t d
 S(   s}  
        Used to unfreeze the game state after a load of this log
        object. This call will always throw an exception. If we're
        lucky, it's the one that indicates load was successful.

        @param roots: The roots returned from freeze.

        @param label: The label that is jumped to in the game script
        after rollback has finished, if it exists.
        R.   i   R@   t   _greedy_rollbacki    Rb  R  R  R  N(   R7   Rz  t   screent   before_restartRZ   R   RJ   t   translationt   init_translationR9   t   rsplitR*   R   R#   R   t   sessionR   R   RP  R   (   R   Rl  R  R   R   Rj  R@   R  (    (    s   renpy/python.pyt   unfreeze|  s$    
c         C  s   |  j  d  k	 r d  S|  j } d } i  |  _  x t |  j  D]| } | j d  k	 r t j j j	 | j
 j  r | |  j  | j <q n  | j r | d 7} n  | j r | d 8} n  | s; Pq; q; Wd  S(   Ni   (   RU  R    RV  RM  R   R?  R7   RZ   R   R  R4  R0  R<  R;  (   R   RV  R  R   (    (    s   renpy/python.pyt   build_identifier_cache  s    				c         C  s   |  j    |  j j | d   S(   N(   R  RU  R   R    (   R   R?  (    (    s   renpy/python.pyt   get_identifier_checkpoints  s    
N("   R   R   R   RR  t   nosaveR    RU  R   R]  R   R^  RA  R   Rd  R`  Rk  RL  Rn  Ro  Rq  R   R;  Rw  Ry  R:  R}  R~  R  RP  R  R  R  R  R  (    (    (    s   renpy/python.pyRS  7  s:   	 		B		2				4						/	R@   c         B  sK   | r i  } n  | d  k r( e | } n  | d  k r= | } n  |  | | Ud  S(   N(   R    R*   (   R   R~   t   globalst   localsR@   (    (    s   renpy/python.pyt   py_exec_bytecode  s    		c         B  sE   | d  k r e d } n  | r( i  } n | } e |  d  | | Ud  S(   NR@   R   (   R    R*   R   (   R   R~   R@   R  (    (    s   renpy/python.pyt   py_exec  s    	c         C  s>   | d  k r t d } n  | d  k r. | } n  t |  | |  S(   NR@   (   R    R*   R6   (   R   R  R  (    (    s   renpy/python.pyt   py_eval_bytecode  s
    	c         C  s1   t  |  t  r! t |  d  }  n  t |  | |  S(   NR6   (   RP   RT   R   R  (   R   R  R  (    (    s   renpy/python.pyt   py_eval  s    c         C  s1   | d  k r! t j d  j } n  t |  | |  S(   Ni   (   R    R   t	   _getframet	   f_globalsR  (   R   R  R  (    (    s   renpy/python.pyt
   store_eval  s    c         B  sW   | \ } } e  j d |  } e  j | | d  e | | d  } | i |  d 6Ud S(   s   
    Raises `e` (which must be an Exception object) at location `loc`.

    `loc`
        A location, which should be a (filename, line_number) tuple.
    s   raise ei   R   R   N(   R   Ry   R   R   (   R   t   locR   t   lineR   R   (    (    s   renpy/python.pyt   raise_at_location  s
    t
   StoreProxyc           B  s#   e  Z d    Z d   Z d   Z RS(   c         C  s   t  t j |  S(   N(   t   getattrR7   R@   (   R   R(   (    (    s   renpy/python.pyt   __getattr__  s    c         C  s   t  t j | |  d  S(   N(   t   setattrR7   R@   (   R   R(   R>   (    (    s   renpy/python.pyR     s    c         C  s   t  t j |  d  S(   N(   t   delattrR7   R@   (   R   R(   (    (    s   renpy/python.pyR     s    (   R   R   R  R   R   (    (    (    s   renpy/python.pyR    s   		c         C  s=   |  j  j } |  j } | d  k r- |  j } n  t | | f f S(   N(   t   im_funcR   t   im_selfR    t   im_classt   method_unpickle(   R   R   RV   (    (    s   renpy/python.pyt   method_pickle  s
    	c         C  s   t  |  |  S(   N(   R  (   RV   R   (    (    s   renpy/python.pyR  *  s    c         C  s4   t  j j r$ t d j |     n  t |  j f f S(   Ns   Could not pickle {!r}.(   R7   R   R$  R   R   t   module_unpickleR   (   t   module(    (    s   renpy/python.pyt   module_pickle0  s    c         C  s
   t  |   S(   N(   t
   __import__(   R   (    (    s   renpy/python.pyR  7  s    (d   t
   __future__R    R  R   R   R)  R   t   reR   t   timet   renpy.audioR7   R   R   R   R   R	   t   renpy.pydictR   R   R!   R   R"   RB   R   R-   R*   R:   R4   R2   R?   R    RG   RI   RJ   RL   RM   RN   RS   R`   t   NodeTransformerRa   R   R   R   R   R   R   R   t   nested_scopest   compiler_flagt   with_statementR   t   absolute_importt   unicode_literalsR   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R  R   R+  R&  R.  RN  R=  R>  t   ObjectR3  RS  R  R  R  R  R  R  R  R  R  R  R  t   copy_regt   typest   picklet
   MethodTypet
   ModuleType(    (    (    s   renpy/python.pyt   <module>   s   				F			*-					9	R					$	i				IO		0H#)6	  					