
0Kc           @   s   d  d k  Z  d  d k Z d  d k Z d  d k Z d   Z d a d a d   Z d   Z	 d   Z
 e i d  Z d   Z d   Z d	   Z d
   Z d S(   iNc       !   C   s  d d  k  }  |  d d  k } d d  k } d d  k } d d  k } d d  k } d d  k } d d  k } d d  k } d d  k	 } | i
 d d  k } | d d  k } | d d  k } | d d  k } | d d  k } d d  k } d d  k } d d  k } | i d d  k } | d d  k } | d d  k }	 d d  k }	 |	 i i d d  k }
 |
 d d  k } | d d  k } | d d  k } d d  k } d d  k } | i  d d  k! } | d d  k" } d d  k# } | i$ d d  k% } | d  S(   Ni(&   t   datetimet   encodings.asciit   encodings.utf_8t   encodings.zlib_codect   encodings.unicode_escapet   encodings.string_escapet   encodings.raw_unicode_escapet   encodings.mbcst   encodings.utf_16_bet   encodings.utf_16_let	   utf_16_let   matht   globt   picklet   platformt
   pysdlsoundt   pysdlsound.soundt   pysdlsound.winmixert   pysdlsound.linmixert   linmixert   difflibt   shutilt   renpy.tools.archivert   renpy.tools.add_fromt   toolst   add_fromt   tarfilet   bz2t
   webbrowsert   pygame.localst   pygame.colort   pygame.colordictt	   colordictt	   posixpatht   ctypest   ctypes.wintypest   wintypest   EasyDialogs(   R    t	   encodingsR   R   R   R   R   R   R   t   renpyR   R   R   t   pygameR!   R"   R%   (    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\bootstrap.pyt   extra_imports   s@    c         C   sA   t  i i |  i i  } t | I|  i I|  i i I| IJt S(   N(	   t   ost   patht   basenamet   f_codet   co_filenamet
   trace_filet   f_linenot   co_namet   trace_local(   t   framet   eventt   argt   fn(    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\bootstrap.pyt   trace_functionA   s    %c         C   s@   t  d d d  a |  d j o
 t a n d  a t i t  d  S(   Ns	   trace.txtt   wi   (   t   fileR/   R7   R2   t   Nonet   syst   settrace(   t   level(    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\bootstrap.pyt   enable_traceF   s
    
c         C   s   t  i d |   d  S(   Ns   open (   R*   t   system(   R6   (    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\bootstrap.pyt	   mac_startS   s    c         C   st   |  i  p d  Sn |  i d |  yD d d  k } |  i d  j o$ | i d  j	 o | i i |   n Wn n Xd  S(   Nt
   _deadstatei(   t   _child_createdt   pollt
   subprocesst
   returncodeR:   t   _activet   append(   t   selfRA   RD   (    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\bootstrap.pyt	   popen_delW   s    
 c         C   sb  t  i i |   t  i d <t  i i |  d  o_ h  } t |  d |  xE | i   D]3 \ } } | t  i j o t |  t  i | <qT qT Wn t  i i t	 i
 d  } | i d  d j o | | i d   } n t i   } | i d d d d	 g  d
 d d d | i d d d d	 t d
 d d d | i d d d d	 d  d d | i d d d d	 d  d
 d d d | i d d d d	 d  d
 d d t i | i d d d d	 d  d t i | i d d d d	 t d
 d d d | i d  d d! d	 t d
 d d d" | i d# d d$ d
 d d	 t d d% | i d& d d' d
 d( d	 d d d) | i d* d d+ d
 d d	 t d t i | i d, d d- d	 d  d d. | i d/ d d0 d
 d d d1 | i d2 d d3 d
 d d d4 | i d5 d d6 d	 d  d d7 | i   \ } } | i o& d d  k a t i i i | i  n | i o t | i  n | i oI d d  k } | i g | t	 _
 t | i | i | i  t	 i d  n t |  } t |  d8 j o t  i i | d  }	 n |  }	 | i  o | i  }
 n | g } | } xK | oC | d } | d8 } | d9 j p | d: j o | i! |  q	q	W| i" d d; d< g  xN | D]@ } | d= j o qqn |	 d> | }
 t  i i# |
  o PqqqqW|	 }
 t	 i i$ d |	  t% t	 d?  o! d@ t  i j o dA t  i d@ <n | i& oD | i' o9 | i( o. | i) o# d d  k a t i i i* |
  n d d  k+ } t, | i- _. t	 i/ dB j o t0 t  _1 n d d  k a t i2   | i( o t i( GHt	 i d  n t3 } d  } x^| oVyV | t i  _4 |  t i5 _6 |	 t i5 _7 |
 t i5 _8 | i9 t i5 _9 t i: i:   t } Wqt; j
 o d d  k< } | i=   Pqt i  i> j
 o& t i i? i@   } t iA   qqt i  iB j
 o8 | o$ | iC dC  o t iA   t3 } q$t } qtD j
 oD } tE |  | o$ | iC dD  o t iA   t3 } q$t } qXqW| iF o tG   n t i iH iI iJ   t	 i d  d  S(E   Nt
   RENPY_BASEs   /environment.txti    t   .is   --argt   destt   argst   defaultt   actionRG   t   helpsA   Append an argument to a list that can be accessed as config.args.s	   --versiont   versiont
   store_trues   Display the version of Ren'Pys   --gamet   games   The directory the game is in.s	   --savedirt   savedirt   stores^   The directory in which to save data. Defaults to the saves directory under the game directory.s   --lockt   locks   --pythont   pythons	   --compilet   compilesF   Causes Ren'Py to compile all .rpy files to .rpyc files, and then quit.s   --lintt   lintsG   Run a number of expensive tests, to try to detect errors in the script.s	   --profilet   profilesE   Causes the amount of time it takes to draw the screen to be profiled.s   --tracet   tracet   countsJ   Dump internal trace data to trace.txt. Use twice to dump in absurd detail.s   --leakt   leaks   --warpt   warpsq   This takes as an argument a filename:linenumber pair, and tries to warp to the statement before that line number.s   --remotet   remotes*   Allows Ren'Py to be fed commands on stdin.s   --rmpersistentt   rmpersistents'   Deletes the persistent data, and exits.s   --presplasht	   presplashs0   Used internally to display the presplash screen.i   t    t   _t   datat   launcherR'   t   /t   winvert   SDL_VIDEODRIVERt   windibt   darwins   a parse errors   an exception(K   R*   R+   t   abspatht   environt   existst   execfilet	   iteritemst   strR,   R;   t   argvt   findt   optparset   OptionParsert
   add_optiont   FalseR:   t   SUPPRESS_HELPt
   parse_argsRa   t   renpy.display.presplashR'   t   displayt   showR[   R>   RW   t   __main__t   __dict__t   exitt   listt   lenRS   RG   t   extendt   isdirt   insertt   hasattrRY   RX   RQ   R`   t   startRD   RI   t   Popent   __del__R   R@   t	   startfilet
   import_allt   Truet   optionst   configt
   renpy_baset   basedirt   gamedirRM   t   maint   KeyboardInterruptt	   tracebackt	   print_exct   UtterRestartExceptiont   errort   ReportErrort
   reload_allt   ParseErrorExceptiont   reportt	   Exceptiont   report_exceptionR]   t   memory_profilet   imt   cachet   quit(   R   t   evarst   kt   vt   namet   opR   RM   R|   R   R   t   gamedirst	   game_namet   prefixt   iRD   t   keep_runningt   report_errorR   t   e(    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\bootstrap.pyt	   bootstrapc   s     






	


 	 ,












c         C   s   x | o | i  } | i } | i } | i } | i d  o) | i d  o |  d | | f IJnU d | i j oD | i d } d d  k } t | | i	 i
  o | i |   q n | i } q Wd  S(   Ns   .rpyt   commons    - python at line %d of %s.RH   i(   t   tb_framet	   tb_linenoR-   R.   t   endswitht
   startswitht   f_localsR'   t
   isinstancet	   executiont   Contextt	   report_tbt   tb_next(   t   outt   tbt   ft   linet   cot   filenamet   objR'   (    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\bootstrap.pyR   .  s    
				!c         C   s  d d  k  } d d  k } d d  k } t i   \ } } } d   } | i | d  t i  | i d G| |   GHH| i	 i
 GHt t i |  yed } t | d  }	 t i i |  }
 |	 i | i  |	 d IJ|	 d IJ|	 J|	 | i d I|	 | |   IJ|	 J|	 | i	 i
 IJt |	 |  |	 J|	 d IJ|	 J| i | d  |	  |	 | i d I|	 | |   IJ|	 J|	 | i	 i
 IJt |	 |  |	 J|	 d	 I| i IJ|	 i   y> | i i o  | i i |
 g d
 d d
 n t i |  Wn n XWn n Xd  S(   Nic         S   sO   y t  |   } Wn t |   } n Xt | t   o | i d  Sn | Sd  S(   Ns   utf-8(   t   unicodeRp   R   t   encode(   R   t   m(    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\bootstrap.pyt	   safe_utf8K  s    t   :s   traceback.txtR8   s?   I'm sorry, but an exception occured while executing your Ren'Pys   script.sN   -- Full Traceback ------------------------------------------------------------s   Ren'Py Version:i   t	   transient(   R'   t   codecsR   R;   t   exc_infot   print_tbR:   t   stdoutt   __name__RS   t   exception_infoR   R9   R*   R+   t   realpatht   writet   BOM_UTF8RQ   t   closeR   t   editort   exportst   launch_editorR   (   R   R'   R   R   t   typet   valueR   R   t   trb_nameR   t   opat_trb(    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\bootstrap.pyR   C  sX    	



 c    	      C   s   d GHHd GHHd d  k  }  |  i   |  i   } h  } x4 | D], } t |  } | i | d  d | | <q; Wg  } | i   D] \ } } | | | f q| ~ } | i   x# | D] \ } } | Gt |  GHq Wd  S(   Ns   Memory Profiles5   Showing all objects in memory at program termination.ii    i   (   t   gct   collectt   get_objectsR   t   getRo   t   sortRp   (	   R   t   objst   cR   t   tt   _[1]t   tyR\   t   results(    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\bootstrap.pyR     s"    
 3
 (   Rs   R*   t   os.pathR;   R)   R:   R/   R2   R7   R>   R@   t   maxintRI   R   R   R   R   (    (    (    s7   D:\Version 1-0-7\Games\Katawa Shoujo\renpy\bootstrap.pys   <module>   s   	"						M