
7Tc           @   s[   d  Z  d d l Z d d l Z d d l Z d d l Z e a d   Z d   Z d   Z	 d S(   s,   Core functionality module - e.g., init, quitiNc           C   s;   t  r
 d St a  t j j   t j j   t j j   d S(   s}   
    This is the core Spyral code that is run on startup; not only does it setup
    spyral, but it also sets up pygame.
    N(	   t   _initedt   Truet   spyralt   eventt   _initt   pygamet   displayt   initt   font(    (    (    s>   /home/icarito/Proyectos/peru-learns-english/Lib/spyral/core.pyR   
   s    c           C   s&   t  j   g  t j _ t t j _ d S(   s<   
    Cleanly quits pygame and empties the spyral stack.
    N(   R   t   quitR   t   directort   _stackt   Falset   _initialized(    (    (    s>   /home/icarito/Proyectos/peru-learns-english/Lib/spyral/core.pyt   _quit   s    
c          C   s   x t  j   D] \ }  } } } } } t  j |   } t j d d !d k r\ t  j |   } n  t | j  d k r | j d d k r | j d } t	 | t
 j  r | Sq q Wd S(   s   
    Returns the currently executing scene using Python introspection.

    This function should not be used lightly - it requires some dark magic.
    i    i   i   t   selfN(   i   i   (   t   inspectt   stackt   getargvaluest   syst   version_infot   ArgInfot   lent   argst   localst
   isinstanceR   t   Scene(   t   framet   _R   t   obj(    (    s>   /home/icarito/Proyectos/peru-learns-english/Lib/spyral/core.pyt   _get_executing_scene   s    %((
   t   __doc__R   R   R   R   R   R    R   R   R   (    (    (    s>   /home/icarito/Proyectos/peru-learns-english/Lib/spyral/core.pyt   <module>   s   		