
0Tc           @   s  d  d l  Z  d  d l Z d  d l Z d  d l Z d  d l Z d  d l Z y d  d l m Z e Wn e k
 ry d Z n Xd d d e f Z	 d Z
 d d	 j d
   e	 D  Z d Z d Z d Z e Z e Z d d d d d d d d d h	 Z e j f Z d d d d d d d d d d  d! d" d# h Z d$ d, d%     YZ d a d&   Z d'   Z d(   Z d)   Z d*   Z d+   Z  e rd  d l! j" Z# n  e Z$ e Z% e Z& e Z' d  d l( Z( e( j)   d re Z$ n e( j*   d re Z% n e Z& d S(-   iN(   t
   vc_versioni    i   i   i   s#   ... through shared popular culture.s   Ren'Py t   .c         c   s   |  ] } t  |  Vq d  S(   N(   t   str(   t   .0t   i(    (    s$   /home/tom/ab/renpy/renpy/__init__.pys	   <genexpr>1   s    iVL s	   -LT1.savei   t   renpys   renpy.objects	   renpy.logs   renpy.bootstraps   renpy.displays   renpy.display.pgrenders   renpy.display.scales   renpy.display.presplashs   renpy.text.ftfonts#   renpy.loadsave.autosave_not_runnings   renpy.python.unicode_res   renpy.python.string_res   renpy.text.text.VERT_FORWARDs   renpy.text.text.VERT_REVERSEs(   renpy.savelocation.scan_thread_conditions   renpy.savelocation.disk_locks   renpy.character.TAG_REs   renpy.display.im.caches   renpy.display.render.blit_locks   renpy.display.render.IDENTITYs   renpy.loader.auto_locks   renpy.display.screen.cproft   Backupc           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   sg  
    This represents a backup of all of the fields in the python modules
    comprising Ren'Py, shortly after they were imported.

    This attempts to preserve object aliasing, but not object identity. If
    renpy.mod.a is renpy.mod.b before the restore, the same will be true
    after the restore - even though renpy.mod.a will have changed identity.
    c         C   s   i  |  _  i  |  _ i  |  _ y d d  l } d  SWn n Xx6 t j j   D]% } | d  k ra qI n  |  j |  qI Wt	 j
 |  j  |  _ d  |  _ d  S(   Ni(   t	   variablest   objectst   namest   androidt   syst   modulest   valuest   Nonet   backup_modulet   cPicklet   dumpst   objects_pickle(   t   selfR
   t   m(    (    s$   /home/tom/ab/renpy/renpy/__init__.pyt   __init__l   s    			c         C   s   | j  } | j d  s d S| t k r, d St t |  j    |  j | <x t |  j   D] \ } } | j d  r | j d  r q^ n  t	 | t
  r q^ n  | d | t k r q^ n  t |  } | |  j | | f <| |  j | <q^ Wd S(   sI   
        Makes a backup of `mod`, which must be a Python module.
        R   Nt   __R   (   t   __name__t
   startswitht   backup_blacklistt   sett   varst   keysR	   t	   iteritemst   endswitht
   isinstancet   type_blacklistt   name_blacklistt   idR   R   (   R   t   modt   namet   kt   vt   idv(    (    s$   /home/tom/ab/renpy/renpy/__init__.pyR      s     	c   	      C   s   |  j  s d SxQ |  j  j   D]@ \ } } t |  } x% t | j    | D] } | | =qL Wq Wt j |  j  } x= |  j j   D], \ } } | \ } } t	 | | | |  q Wd S(   sz   
        Restores the modules to a state similar to the state of the modules
        when the backup was created.
        N(
   R	   R   R   R   R   R   t   loadsR   R   t   setattr(	   R   R#   R	   t   modvarsR$   R   R%   R&   t   field(    (    s$   /home/tom/ab/renpy/renpy/__init__.pyt   restore   s    	(   R   t
   __module__t   __doc__R   R   R,   (    (    (    s$   /home/tom/ab/renpy/renpy/__init__.pyR   b   s   		&c         C   s   |  j  j d  } d d l } t j j | j  } |  j j t j j	 | |   d d l
 } t j j | j d  } |  j j t j j	 | |   d S(   s`   
    Update the __path__ of package, to import binary modules from a libexec
    directory.
    R   iNi    (   R   t   splitt   _renpyt   ost   patht   dirnamet   __file__t   __path__t   appendt   joint	   encodings(   t   packageR$   R0   t   libexecR8   (    (    s$   /home/tom/ab/renpy/renpy/__init__.pyt   update_path   s    c          C   s2  d d  l  }  t |   d d  l }  d d  l }  d d  l }  d d  l }  d d  l }  d d  l }  d d  l }  d d  l	 }  d d  l
 }  d d  l }  d d  l }  d d  l }  d d  l }  d d  l }  d d  l }  d d  l }  d d  l }  d d  l }  d d  l }  d d  l }  d d  l }  d d  l }  d d  l }  d d  l }  t |  j  d d  l }  d d  l }  d d  l }  d d  l }  d d  l }  d d  l }  d d  l  }  t |  j!  d d  l" }  d d  l# }  d d  l$ }  d d  l% }  d d  l& }  d d  l' }  |  j! j! t( j) d <d d  l* }  t |  j+  d d  l, }  t |  j-  d d  l. }  d d  l/ }  d d  l0 }  d d  l1 }  d d  l2 }  d d  l3 }  d d  l4 }  d d  l5 }  d d  l6 }  d d  l7 }  d d  l8 }  d d  l9 }  d d  l: }  d d  l; }  d d  l< }  d d  l= }  d d  l> }  d d  l? }  d d  l@ }  d d  lA }  d d  lB }  d d  lC }  d d  lD }  d d  lE }  d d  lF }  d d  lG }  d d  lH }  t |  jI  d d  lJ }  d d  lK }  d d  lL }  d d  lM }  d d  lN }  d d  lO }  d d  lP }  d d  lQ }  d d  lR }  d d  lS }  d d  lT }  d d  lU }  d d  lV }  tW   aX tY   d  S(   Nis   renpy.display.text(Z   R   R;   t   renpy.argumentst	   renpy.logt   renpy.displayt   renpy.objectt
   renpy.gamet   renpy.preferencest   renpy.loadert   renpy.pyanalysist	   renpy.astt	   renpy.atlt   renpy.curryt
   renpy.easyt   renpy.executiont   renpy.loadsavet   renpy.savelocationt   renpy.persistentt   renpy.parsert   renpy.pythont   renpy.scriptt   renpy.statementst   renpy.stylet   renpy.substitutionst   renpy.translationt   displayt   renpy.display.presplasht   renpy.display.pgrendert   renpy.display.scalet   renpy.display.modulet   renpy.display.rendert   renpy.display.coret
   renpy.textt   textt   renpy.text.ftfontt   renpy.text.fontt   renpy.text.textsupportt   renpy.text.texwrapt   renpy.text.textt   renpy.text.extrasR   R   t   renpy.glt   glt   renpy.anglet   anglet   renpy.display.layoutt   renpy.display.motiont   renpy.display.behaviort   renpy.display.transitiont   renpy.display.movetransitiont   renpy.display.imt   renpy.display.imageliket   renpy.display.imaget   renpy.display.videot   renpy.display.focust   renpy.display.animt   renpy.display.particlet   renpy.display.joystickt   renpy.display.minigamet   renpy.display.screent   renpy.display.dragdropt   renpy.display.imagemapt   renpy.display.predictt   renpy.display.emulatort   renpy.display.ttst   renpy.display.errort   renpy.audio.audiot   renpy.audio.musict   renpy.audio.soundt   renpy.uit   renpy.screenlangt	   renpy.sl2t   sl2t   renpy.sl2.slparsert   renpy.sl2.sldisplayablest
   renpy.lintt
   renpy.warpt   renpy.editort   renpy.memoryt   renpy.exportst   renpy.charactert
   renpy.dumpt   renpy.configt   renpy.minstoret   renpy.defaultstoret
   renpy.mainR   t   backupt   post_import(   R   (    (    s$   /home/tom/ab/renpy/renpy/__init__.pyt
   import_all   s    
	c          C   s   d d l  }  |  j j d  t j d |  _ |  j |  j _ t j d t j d <d d l } | t j d <x6 |  j j	 j
   D]" \ } } |  j j	 j | |  q{ Wx6 t   j
   D]% \ } } t |  j  j | |  q Wd S(   se   
    This is called after import or reload, to do further initialization
    of various modules.
    iNt   stores   renpy.stores   renpy.subprocess(   R   t   pythont   create_storeR   R   R   t   exportst
   subprocesst   defaultstoret   __dict__R   t
   setdefaultt   globalsR   (   R   R   R%   R&   (    (    s$   /home/tom/ab/renpy/renpy/__init__.pyR   b  s    c          C   s@  d d l  }  d d l }  t j   |  j j   |  j j j j	   |  j
 j   |  j j   d |  j j _ |  j j j   |  j j j   d |  j _ d |  j _ xh t j j   D]W } | j d  s | d k r t j | } | d k	 r | j j   n  t j | =q q Wt j   |  j j j   t   |  j
 j   d S(   s[   
    Resets all modules to the state they were in right after import_all
    returned.
    iNR   s   renpy.store(   RP   R>   R   t	   exc_cleart   stylet   resetRS   t   imt   cachet   quitt   loadert   quit_importerR   t   free_memoryR   t   rendert   screen_rendert
   mark_sweept   drawt   deinitt	   interfaceR   R   R   R   R   R,   t   reset_moduleR   t   init_importer(   R   R   R   (    (    s$   /home/tom/ab/renpy/renpy/__init__.pyt
   reload_all  s,    

c         C   s   d d l  } t j j | j  } x[ d d d d g D]G } t j j | d |  } t j j |  r4 |  j d | |  q4 q4 Wd S(	   sS   
    Informs modulefinder about the location of modules in nonstandard places.
    iNRS   Rc   Re   R[   R   s   renpy.(   R0   R1   R2   R3   R4   R7   t   existst   AddPackagePath(   t   modulefinderR0   R:   R   t   displaypath(    (    s$   /home/tom/ab/renpy/renpy/__init__.pyt   setup_modulefinder  s    c          C   s   d d l  }  d d l }  d d l }  d d l }  d d l }  d d l }  d d l }  d d l }  d d l }  d d l	 }  d d l
 }  d d l }  d d l }  d d l }  d d l }  d d l }  d S(   st   
    Never called, but necessary to ensure that modulefinder will properly
    grab the various cython modules.
    iN(   R<   t   renpy.display.acceleratorRX   t   renpy.gl.gldrawt   renpy.gl.glenviron_fixedt   renpy.gl.glenviron_limitedt   renpy.gl.glenviron_shadert   renpy.gl.glrtt_copyt   renpy.gl.glrtt_fbot   renpy.gl.gltexturet   renpy.angle.gldrawt   renpy.angle.glenviron_shadert   renpy.angle.glrtt_copyt   renpy.angle.glrtt_fbot   renpy.angle.gltexturet   renpy.styleclass(   R   (    (    s$   /home/tom/ab/renpy/renpy/__init__.pyt   import_cython  s     (    (+   R   R1   t   copyt   typest	   threadingR   t   renpy.vc_versionR    t   ImportErrort   version_tuplet   version_nameR7   t   versiont   script_versiont   savegame_suffixt   bytecode_versiont   Truet   first_utter_startt   Falset
   autoreloadR   t
   ModuleTypeR    R!   R   R   R   R;   R   R   R   R   R   R   R   R   t   windowst	   macintosht   linuxR
   t   platformt	   win32_vert   mac_ver(    (    (    s$   /home/tom/ab/renpy/renpy/__init__.pyt   <module>   sz    
		d				:					