???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................ž
¦ÿf­(  c               @   s  d  Z  d d l Z d d l Z d d l Z d d l Z d d l m Z m Z m	 Z	 d d g Z
 Gd d „  d e ƒ Z Gd d	 „  d	 e ƒ Z d d d d d d
 d „ Z d d d d d d d „ Z d d „  Z d d „  Z d d d „ Z d d d d d „ Z d d „  Z d d „  Z d d d d „ Z e d k r{e e j ƒ d k  r]e d d e j ƒq{e j d =e e j d ƒ n  d S(    uZ  runpy.py - locating and running Python code using the module namespace

Provides support for locating and running Python scripts using the Python
module namespace instead of the native filesystem.

This allows Python code to play nicely with non-filesystem based PEP 302
importers when locating support scripts as well as when importing modules.
i    N(   u	   read_codeu
   get_loaderu   get_importeru
   run_moduleu   run_pathc             B   s>   |  Ee  Z d  Z d Z d d „  Z d d „  Z d d „  Z d S(	   u   _TempModuleuC   Temporarily replace a module in sys.modules with an empty namespacec             C   s(   | |  _  t j | ƒ |  _ g  |  _ d  S(   N(   u   mod_nameu   impu
   new_moduleu   moduleu   _saved_module(   u   selfu   mod_name(    (    u*   /opt/alt/python33/lib64/python3.3/runpy.pyu   __init__   s    	u   _TempModule.__init__c             C   sM   |  j  } y |  j j t j | ƒ Wn t k
 r8 Yn X|  j t j | <|  S(   N(   u   mod_nameu   _saved_moduleu   appendu   sysu   modulesu   KeyErroru   module(   u   selfu   mod_name(    (    u*   /opt/alt/python33/lib64/python3.3/runpy.pyu	   __enter__   s    	u   _TempModule.__enter__c             G   s=   |  j  r# |  j  d t j |  j <n t j |  j =g  |  _  d  S(   Ni    (   u   _saved_moduleu   sysu   modulesu   mod_name(   u   selfu   args(    (    u*   /opt/alt/python33/lib64/python3.3/runpy.pyu   __exit__'   s    	u   _TempModule.__exit__N(   u   __name__u
   __module__u   __qualname__u   __doc__u   __init__u	   __enter__u   __exit__(   u
   __locals__(    (    u*   /opt/alt/python33/lib64/python3.3/runpy.pyu   _TempModule   s   	u   _TempModulec             B   s8   |  Ee  Z d  Z d d „  Z d d „  Z d d „  Z d S(   u   _ModifiedArgv0c             C   s    | |  _  t ƒ  |  _ |  _ d  S(   N(   u   valueu   objectu   _saved_valueu	   _sentinel(   u   selfu   value(    (    u*   /opt/alt/python33/lib64/python3.3/runpy.pyu   __init__/   s    	u   _ModifiedArgv0.__init__c             C   sE   |  j  |  j k	 r! t d ƒ ‚ n  t j d |  _  |  j t j d <d  S(   Nu   Already preserving saved valuei    (   u   _saved_valueu	   _sentinelu   RuntimeErroru   sysu   argvu   value(   u   self(    (    u*   /opt/alt/python33/lib64/python3.3/runpy.pyu	   __enter__3   s    u   _ModifiedArgv0.__enter__c             G   s    |  j  |  _ |  j t j d <d  S(   Ni    (   u	   _sentinelu   valueu   _saved_valueu   sysu   argv(   u   selfu   args(    (    u*   /opt/alt/python33/lib64/python3.3/runpy.pyu   __exit__9   s    u   _ModifiedArgv0.__exit__N(   u   __name__u
   __module__u   __qualname__u   __init__u	   __enter__u   __exit__(   u
   __locals__(    (    u*   /opt/alt/python33/lib64/python3.3/runpy.pyu   _ModifiedArgv0.   s   u   _ModifiedArgv0c             C   s[   | d k	 r | j | ƒ n  | j d | d | d d d d d | d | ƒ t |  | ƒ | S(   u)   Helper to run code in nominated namespaceu   __name__u   __file__u
   __cached__u   __doc__u
   __loader__u   __package__N(   u   Noneu   updateu   exec(   u   codeu   run_globalsu   init_globalsu   mod_nameu	   mod_fnameu
   mod_loaderu   pkg_name(    (    u*   /opt/alt/python33/lib64/python3.3/runpy.pyu	   _run_code=   s    u	   _run_codec             C   sZ   t  | ƒ B } t | ƒ - | j j } t |  | | | | | | ƒ Wd QXWd QX| j ƒ  S(   u5   Helper to run code in new namespace with sys modifiedN(   u   _TempModuleu   _ModifiedArgv0u   moduleu   __dict__u	   _run_codeu   copy(   u   codeu   init_globalsu   mod_nameu	   mod_fnameu
   mod_loaderu   pkg_nameu   temp_moduleu   mod_globals(    (    u*   /opt/alt/python33/lib64/python3.3/runpy.pyu   _run_module_codeL   s
    u   _run_module_codec             C   sI   xB d D]: } t  |  | d  ƒ } | d  k	 r t j j | | ƒ ƒ Sq Wd  S(   Nu   get_filenameu   _get_filename(   u   get_filenameu   _get_filename(   u   getattru   Noneu   osu   pathu   abspath(   u   loaderu   mod_nameu   attru   meth(    (    u*   /opt/alt/python33/lib64/python3.3/runpy.pyu   _get_filename]   s
    u   _get_filenamec             C   s  t  |  ƒ } | d  k r+ t d |  ƒ ‚ n  | j |  ƒ rÁ |  d k sU |  j d ƒ rd t d ƒ ‚ n  y |  d } t | ƒ SWqÁ t k
 r½ } z t d d | |  f ƒ ‚ WYd  d  } ~ XqÁ Xn  | j |  ƒ } | d  k rï t d |  ƒ ‚ n  t | |  ƒ } |  | | | f S(   Nu   No module named %su   __main__u	   .__main__u%   Cannot use package as __main__ moduleu   %s; %r is a package and cannot u   be directly executedu   No code object available for %s(   u
   get_loaderu   Noneu   ImportErroru
   is_packageu   endswithu   _get_module_detailsu   get_codeu   _get_filename(   u   mod_nameu   loaderu   pkg_main_nameu   eu   codeu   filename(    (    u*   /opt/alt/python33/lib64/python3.3/runpy.pyu   _get_module_detailse   s"    
*u   _get_module_detailsc       
      C   s	  yF | s |  d k r0 t  |  ƒ \ }  } } } n t ƒ  \ }  } } } Wnk t k
 r³ } zK | rp t | ƒ } n d t j d } d t j | f } t j | ƒ WYd d } ~ Xn X|  j d ƒ d } t j	 d j
 }	 | rí | t j d <n  t | |	 d d | | | ƒ S(   uÅ  Runs the designated module in the __main__ namespace

       Note that the executed module will have full access to the
       __main__ namespace. If this is not desirable, the run_module()
       function should be used to run the module code in a fresh namespace.

       At the very least, these variables in __main__ will be overwritten:
           __name__
           __file__
           __cached__
           __loader__
           __package__
    u   __main__u"   can't find '__main__' module in %ri    u   %s: %sNu   .(   u   _get_module_detailsu   _get_main_module_detailsu   ImportErroru   stru   sysu   argvu
   executableu   exitu
   rpartitionu   modulesu   __dict__u	   _run_codeu   None(
   u   mod_nameu
   alter_argvu   loaderu   codeu   fnameu   excu   infou   msgu   pkg_nameu   main_globals(    (    u*   /opt/alt/python33/lib64/python3.3/runpy.pyu   _run_module_as_main|   s      u   _run_module_as_mainc             C   s   t  |  ƒ \ }  } } } | d k r- |  } n  |  j d ƒ d } | r_ t | | | | | | ƒ St | i  | | | | | ƒ Sd S(   un   Execute a module's code without importing it

       Returns the resulting top level namespace dictionary
    u   .i    N(   u   _get_module_detailsu   Noneu
   rpartitionu   _run_module_codeu	   _run_code(   u   mod_nameu   init_globalsu   run_nameu	   alter_sysu   loaderu   codeu   fnameu   pkg_name(    (    u*   /opt/alt/python33/lib64/python3.3/runpy.pyu
   run_module¢   s    	c              C   s¤   d }  t  j |  } t  j |  =zr y t |  ƒ SWn] t k
 r } z= |  t | ƒ k rx t d |  t  j d f ƒ | ‚ n  ‚  WYd  d  } ~ Xn XWd  | t  j |  <Xd  S(   Nu   __main__u   can't find %r module in %ri    (   u   sysu   modulesu   _get_module_detailsu   ImportErroru   stru   path(   u	   main_nameu
   saved_mainu   exc(    (    u*   /opt/alt/python33/lib64/python3.3/runpy.pyu   _get_main_module_details´   s    
u   _get_main_module_detailsc             C   s—   t  | d ƒ  } t | ƒ } Wd  QX| d  k rx t  | d ƒ 4 } t | j ƒ  | d ƒ } t j j |  | ƒ } Wd  QXn t j j |  | ƒ } | | f S(   Nu   rbu   exec(	   u   openu	   read_codeu   Noneu   compileu   readu	   importlibu	   machineryu   SourceFileLoaderu   SourcelessFileLoader(   u   run_nameu   fnameu   fu   codeu   loader(    (    u*   /opt/alt/python33/lib64/python3.3/runpy.pyu   _get_code_from_fileÇ   s    u   _get_code_from_filec             C   s3  | d k r d } n  | j d ƒ d } t |  ƒ } t | t d ƒ t j f ƒ r€ t | |  ƒ \ } } t | | | |  | | ƒ St	 j
 j d |  ƒ zo t ƒ  \ } } } }	 t | ƒ H }
 t |  ƒ 3 |
 j j } t | | | | |	 | | ƒ j ƒ  SWd QXWd QXWd y t	 j
 j |  ƒ Wn t k
 r-Yn XXd S(   u_  Execute code located at the specified filesystem location

       Returns the resulting top level namespace dictionary

       The file path may refer directly to a Python script (i.e.
       one that could be directly executed with execfile) or else
       it may refer to a zipfile or directory containing a top
       level __main__.py script.
    u
   <run_path>u   .i    N(   u   Noneu
   rpartitionu   get_importeru
   isinstanceu   typeu   impu   NullImporteru   _get_code_from_fileu   _run_module_codeu   sysu   pathu   insertu   _get_main_module_detailsu   _TempModuleu   _ModifiedArgv0u   moduleu   __dict__u	   _run_codeu   copyu   removeu
   ValueError(   u	   path_nameu   init_globalsu   run_nameu   pkg_nameu   importeru   codeu
   mod_loaderu   mod_nameu   loaderu   fnameu   temp_moduleu   mod_globals(    (    u*   /opt/alt/python33/lib64/python3.3/runpy.pyu   run_pathÔ   s(    
	
&u   __main__i   u!   No module specified for executionu   fileTF(   u   __doc__u   osu   sysu   importlib.machineryu	   importlibu   impu   pkgutilu	   read_codeu
   get_loaderu   get_importeru   __all__u   objectu   _TempModuleu   _ModifiedArgv0u   Noneu	   _run_codeu   _run_module_codeu   _get_filenameu   _get_module_detailsu   Trueu   _run_module_as_mainu   Falseu
   run_moduleu   _get_main_module_detailsu   _get_code_from_fileu   run_pathu   __name__u   lenu   argvu   printu   stderr(    (    (    u*   /opt/alt/python33/lib64/python3.3/runpy.pyu   <module>   s6   &,
