a
    F^i%                     @   s8  d dl mZmZmZmZmZ d dlmZmZm	Z	m
Z
mZmZmZmZmZmZmZmZ d dlmZ d dlZd dlZd dlZd dlZd dlZe pdZejZejZerej Z!e"e e#d e!e_ dd Z$e$e_#ee_ee_d dl%a&G dd	 d	ej'Z(d
d Z)e)  da*da+dd Z,dd Z-dd Z.dd Z/dd Z0dS )    )divisionabsolute_importwith_statementprint_functionunicode_literals)PY2
basestringbchrbordchropenpystrrangeroundstrtobytesunicode)OptionalNutf-8c                 C   s   dS )za
    This is install in sys to prevent games from trying to change the default
    encoding.
    N )namer   r   5C:\Users\PahaGest\Downloads\Selene\renpy\bootstrap.py_setdefaultencoding0   s    r   c                   @   s"   e Zd ZdZdd ZdddZdS )NullFilezB
    This file raises an error on input, and IOError on read.
    c                 C   s   d S )Nr   )selfsr   r   r   writeD   s    zNullFile.writeNc                 C   s   t dd S )NzNot implemented.)IOError)r   lengthr   r   r   readG   s    zNullFile.read)N)__name__
__module____qualname____doc__r   r   r   r   r   r   r   ?   s   r   c                   C   s\   zDt jd u st j dk r"t t _t jd u s:t j dk rBt t _W n tyV   Y n0 d S )Nr   )sysstderrfilenor   stdout	Exceptionr   r   r   r   
null_filesK   s    r)   c                 C   s0   t j| jj}td|| j| jj	| t
S )Nz{} {} {} {}
)ospathbasenamef_codeco_filename
trace_filer   formatf_linenoco_nametrace_local)frameeventargfnr   r   r   trace_function^   s    r8   c                 C   s0   t ddddda| dkrtand att d S )Nz	trace.txtw   r   )	bufferingencoding)r   r/   r8   r3   r$   settrace)levelr   r   r   enable_traced   s
    r?   c                 C   s   t d|   dS )z)
    os.start compatibility for mac.
    zopen N)r*   system)r7   r   r   r   	mac_startr   s    rA   c                 O   s   dS )zE
    Fix an issue where the __del__ method of popen doesn't wor,
    Nr   )r   argskwargsr   r   r   	popen_dely   s    rD   c              
   C   s  dd l add latjdddkr*tjd= t| ts>t| t} tj	
| d ri }t| d d.}t| | d d}t|| W d    n1 s0    Y  | D ] \}}|tjvrt|tj|< qtj	d}d	|v r|d |d	d
  }tj	
|d ri }t|d d.}t| |d d}t|| W d    n1 sN0    Y  | D ]$\}}|tjvr`t|tj|< q`tj	tjd }|ddkr|d |d }dd latj }|jrt|j |jrtj	|j}	t|	ts|	t}	n| }	tj	
|	s:tjd|	f  td tjrdtj	
|	d sdt |	d d t!"|	|}
tj	#d|	 tj$rt%t_&|	'drdt_(z dd l)}dtj*vr|+  W n* t,y   t-d.|tjd  Y n0 |j/dkrtj0sdd l1atj2j34|	|
 zdd l5}W n* t,yL   t-d.|tjd  Y n0 dd lat6  tj78  d }z|d u rd}z~|tj9_:| tj;_<|	tj;_|
tj;_=g tj;_:tjrtjd tj;_>n|	tj;_>tj	
tj;j>st?tj;j>d tj@@  d}W qp tAy    Y n tj9jBy4   tC  d }Y n tj9jDy } zv|jE}|jFrtGtdrtHItjJgtjdd    n2tKrtHItjLdgtj  ntHItjLgtj  W Y d }~nPd }~0  tj9jMy   Y n2 t,y } ztjNO| W Y d }~n
d }~0 0 qpt| W dtjv r<ttPtjd  tj2jQQd  tj2jRjST  tj2jUrntj2jUT  tjVjVT  tjWstXtHjI_Ynndtjv rttPtjd  tj2jQQd  tj2jRjST  tj2jUrtj2jUT  tjVjVT  tjWstXtHjI_Y0 d S )Nr   ZSDL_VIDEODRIVER Zwindibz/environment.txtrexec
renpy_basez.app   rb.z-Base directory %r does not exist. Giving up.
r:   z/gamei  zContents/Resources/autorunTpygamea%  Could not import pygame_sdl2. Please ensure that this program has been built
and unpacked properly. Also, make sure that the directories containing
this program do not contain : or ; in their names.

You may be using a system install of python. Please run {0}.sh,
{0}.exe, or {0}.app instead.
)filerunzCould not import _renpy. Please ensure that this program has been built
and unpacked properly.

You may be using a system install of python. Please run {0}.sh,
{0}.exe, or {0}.app instead.
ANDROID_PUBLICrenpy_executablez-EOZRENPY_SHUTDOWN_TRACE)Zrenpy.configrenpy	renpy.logr*   environget
isinstancer   
FSENCODINGr+   existsr   compiler   rG   itemsabspathfindr,   r$   argvrenpy.arguments	arguments	bootstraptracer?   basedirdecoder%   r   exitandroidmkdir__main__path_to_gamedirinsert	macintoshrA   	startfileendswithmacapppygame_sdl2modulesimport_as_pygamer(   printr0   Zcommandmobilerenpy.display.presplashdisplayZ	presplashstart_renpy
import_allloaderinit_importergamerB   configrH   gamedirZlogdirmakedirsmainKeyboardInterruptZUtterRestartException
reload_allZQuitExceptionstatusZrelaunchhasattr
subprocessPopenrQ   r   
executableZParseErrorExceptionerrorZreport_exceptionintZttsimcachequitdrawaudio
emscriptenrD   __del__)rH   ZevarsfcodekvZalt_pathr   rB   rc   r}   ro   rw   Zexit_statuser   r   r   ra      s   

(

*


	



(


ra   )1
__future__r   r   r   r   r   renpy.compatr   r   r	   r
   r   r   r   r   r   r   r   r   typingr   r*   r$   r   iorh   getfilesystemencodingrX   r'   Z
old_stdoutr%   Z
old_stderrr   Zsys_executablereloadZsetdefaultencodingr   Zrenpy.errorrS   IOBaser   r)   r/   r3   r8   r?   rA   rD   ra   r   r   r   r   <module>   s<   8
