³ò
Ñ‘RMc           @   sP   d  Z  d d k l Z d d k l Z d d k l Z d e f d „  ƒ  YZ d S(   s   
Module objects.
iÿÿÿÿ(   t	   Wrappable(   t   OperationError(   t   we_are_translatedt   Modulec           B   st   e  Z d  Z e Z d d „ Z d „  Z d „  Z d „  Z	 d „  Z
 d „  Z d „  Z d d „ Z d	 „  Z d
 „  Z RS(   s	   A module.c         C   sx   | |  _  | d  j o | i d t ƒ } n | |  _ | |  _ | d  j	 o  | i | | i d ƒ | ƒ n t |  _	 d  S(   Nt   modulet   __name__(
   t   spacet   Nonet   newdictt   Truet   w_dictt   w_namet   setitemt   new_interned_strt   Falset   startup_called(   t   selfR   R   R
   (    (    s+   /64/home/arigo/u/pypy/interpreter/module.pyt   __init__   s    			 c         C   s   d S(   sj   NOT_RPYTHON: to allow built-in modules to do some more setup
        after the space is fully initialized.N(    (   R   (    (    s+   /64/home/arigo/u/pypy/interpreter/module.pyt    setup_after_space_initialization   s    c         C   sH   |  i  p: t ƒ  p |  i o d Sq* n t |  _  |  i | ƒ n d S(   sD   This is called each time the module is imported or reloaded
        N(   R   R   t   _frozenR	   t   startup(   R   R   (    (    s+   /64/home/arigo/u/pypy/interpreter/module.pyt   init   s    


	c         C   s   d S(   s…   This is called at runtime on import to allow the module to
        do initialization when it is imported for the first time.
        N(    (   R   R   (    (    s+   /64/home/arigo/u/pypy/interpreter/module.pyR   )   s    c         C   s   d S(   sx   This is called when the space is shut down, just after
        sys.exitfunc(), if the module has been imported.
        N(    (   R   R   (    (    s+   /64/home/arigo/u/pypy/interpreter/module.pyt   shutdown.   s    c         C   s   |  i  S(   N(   R
   (   R   (    (    s+   /64/home/arigo/u/pypy/interpreter/module.pyt   getdict3   s    c         C   s2   |  i  t | ƒ } t i | |  d  ƒ |  i | ƒ S(   N(   t   allocate_instanceR   R   R   t   wrap(   R   t	   w_subtypet   __args__R   (    (    s+   /64/home/arigo/u/pypy/interpreter/module.pyt   descr_module__new__6   s    c         C   sn   |  i  } | |  _ | d  j o | i } n | i |  i | i d ƒ | ƒ | i |  i | i d ƒ | ƒ d  S(   NR   t   __doc__(   R   R   R   t   w_NoneR   R
   R   (   R   R   t   w_docR   (    (    s+   /64/home/arigo/u/pypy/interpreter/module.pyt   descr_module__init__;   s    		c   
   	   C   sH  | i  |  i | i d ƒ ƒ } | d  j p  | i | i | | i ƒ ƒ o | i Sn | i i	 d ƒ } | i  | | ƒ d  j ol d d k
 l } | i d ƒ } | i | | ƒ } | i	 d ƒ } | i | | i | |  i ƒ  g ƒ g ƒ Sn | i i	 d ƒ } | | i | | i | i | i | i d ƒ g ƒ g ƒ g }	 | i |	 ƒ S(	   NR   t   modulesiÿÿÿÿ(   t   MixedModulet   _pickle_supportt
   module_newt
   __import__t    (   t   finditemR
   R   R   t   is_truet
   isinstancet   w_strR   t   syst   gett   pypy.interpreter.mixedmoduleR"   t   getbuiltinmodulet   interp_wt   newtupleR   t   builtin(
   R   R   R   t	   w_modulesR"   t   w_modt   modt   new_instt   w_importt
   tup_return(    (    s+   /64/home/arigo/u/pypy/interpreter/module.pyt   descr__reduce__C   s(     $c         C   sÔ   d d k  l } |  i d  j	 o | i | i |  i ƒ ƒ } n d } t |  | ƒ o | i d | ƒ Sn y7 | i |  | i d ƒ ƒ } | i | i | ƒ ƒ } Wn t	 j
 o d } n X| i d | | f ƒ S(   Niÿÿÿÿ(   R"   s   '?'s   <module %s (built-in)>t   __file__t   ?s   <module %s from %s>(
   R-   R"   R   R   t   str_wt   reprR)   R   t   getattrR   (   R   R   R"   t   namet
   w___file__R9   (    (    s+   /64/home/arigo/u/pypy/interpreter/module.pyt   descr_module__repr__a   s    N(   R   t
   __module__R   R   R   R   R   R   R   R   R   R   R   R    R8   R@   (    (    (    s+   /64/home/arigo/u/pypy/interpreter/module.pyR   	   s   
							N(   R   t   pypy.interpreter.baseobjspaceR    t   pypy.interpreter.errorR   t   pypy.rlib.objectmodelR   R   (    (    (    s+   /64/home/arigo/u/pypy/interpreter/module.pys   <module>   s   
