
-X '                 @   sF  d  Z  d d l m Z m Z m Z m Z m Z m Z m Z m	 Z	 m
 Z
 m Z y d d l m Z Wn e k
 rz d Z Yn Xd d l m Z m Z m Z d d l 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 d d l Z e j d e  d Z d	 Z d
 Z d Z d Z  d Z! d Z" d Z# d Z$ d Z% d d   Z& d d   Z' d d   Z( d d d  Z) d d   Z* d d   Z+ Gd d   d  Z, Gd  d!   d!  Z- Gd" d#   d# e- e j.  Z/ d d$ d%  Z0 Gd& d'   d' e- e  Z1 d d( d)  Z2 d* d+   Z3 d, d-   Z4 d d. d/  Z5 d0 d1   Z6 d S)2zThis module provides the components needed to build your own __import__
function.  Undocumented functions are obsolete.

In most cases it is preferred you consider using the importlib module's
functionality over this module.

    )
	lock_heldacquire_lockrelease_lockget_frozen_objectis_frozen_packageinit_builtininit_frozen
is_builtin	is_frozen_fix_co_filename)load_dynamicN)SourcelessFileLoader_ERR_MSG_SpecMethods)	machinery)utilzhthe imp module is deprecated in favour of importlib; see the module's documentation for alternative uses                        	   c             C   s   t  j |   S)z_**DEPRECATED**

    Create a new module.

    The module is not entered into sys.modules.

    )types
ModuleType)name r   3/home/kubikplay/www/django_dtb/lib/python3.4/imp.py
new_module/   s    r    c               C   s   t  j S)zH**DEPRECATED**

    Return the magic number for .pyc or .pyo files.
    )r   MAGIC_NUMBERr   r   r   r   	get_magic:   s    r"   c               C   s
   t  j j S)z,Return the magic tag for .pyc or .pyo files.)sysimplementation	cache_tagr   r   r   r   get_tagB   s    r&   c             C   s   t  j |  |  S)a  **DEPRECATED**

    Given the path to a .py file, return the path to its .pyc/.pyo file.

    The .py file does not need to exist; this simply returns the path to the
    .pyc/.pyo file calculated as if the .py file were imported.  The extension
    will be .pyc unless sys.flags.optimize is non-zero, then it will be .pyo.

    If debug_override is not None, then it must be a boolean and is used in
    place of sys.flags.optimize.

    If sys.implementation.cache_tag is None then NotImplementedError is raised.

    )r   cache_from_source)pathdebug_overrider   r   r   r'   G   s    r'   c             C   s   t  j |   S)a  **DEPRECATED**

    Given the path to a .pyc./.pyo file, return the path to its .py file.

    The .pyc/.pyo file does not need to exist; this simply returns the path to
    the .py file calculated to correspond to the .pyc/.pyo file.  If path does
    not conform to PEP 3147 format, ValueError will be raised. If
    sys.implementation.cache_tag is None then NotImplementedError is raised.

    )r   source_from_cache)r(   r   r   r   r*   Y   s    r*   c              C   sN   d d   t  j D }  d d   t  j D } d d   t  j D } |  | | S)z**DEPRECATED**c             S   s   g  |  ] } | d  t  f  q S)rb)C_EXTENSION).0sr   r   r   
<listcomp>i   s   	 z get_suffixes.<locals>.<listcomp>c             S   s   g  |  ] } | d  t  f  q S)r)	PY_SOURCE)r-   r.   r   r   r   r/   j   s   	 c             S   s   g  |  ] } | d  t  f  q S)r+   )PY_COMPILED)r-   r.   r   r   r   r/   k   s   	 )r   EXTENSION_SUFFIXESSOURCE_SUFFIXESBYTECODE_SUFFIXES)
extensionssourcebytecoder   r   r   get_suffixesg   s    r9   c               @   s.   e  Z d  Z d Z d d   Z d d   Z d S)NullImporterz-**DEPRECATED**

    Null import object.

    c             C   sL   | d k r! t  d d d  n' t j j |  rH t  d d |  n  d  S)N zempty pathnamer(   zexisting directory)ImportErrorosr(   isdir)selfr(   r   r   r   __init__x   s    zNullImporter.__init__c             C   s   d S)zAlways returns None.Nr   )r?   fullnamer   r   r   find_module~   s    zNullImporter.find_moduleN)__name__
__module____qualname____doc__r@   rB   r   r   r   r   r:   p   s   r:   c                   s=   e  Z d  Z d Z d   f d d  Z   f d d   Z   S)_HackedGetDatazMCompatibiilty support for 'file' arguments of various load_*()
    functions.Nc                s    t    j | |  | |  _ d  S)N)superr@   file)r?   rA   r(   rI   )	__class__r   r   r@      s    z_HackedGetData.__init__c                sw   |  j  rc | |  j k rc |  j  j s0 |  j  } n t |  j d  |  _  } |  | j   SWd QXn t   j |  Sd S)z;Gross hack to contort loader to deal w/ load_*()'s bad API.r0   N)rI   r(   closedopenreadrH   get_data)r?   r(   rI   )rJ   r   r   rN      s    z_HackedGetData.get_data)rC   rD   rE   rF   r@   rN   r   r   )rJ   r   rG      s   rG   c               @   s   e  Z d  Z d Z d S)_LoadSourceCompatibilityz5Compatibility support for implementing load_source().N)rC   rD   rE   rF   r   r   r   r   rO      s   rO   c             C   s   t  |  | |  } t j |  | d | } t |  } |  t j k r^ | j t j |   } n | j   } t j	 |  |  | _
 | j
 | j _ | S)Nloader)rO   r   spec_from_file_locationr   r#   modulesexecloadr   SourceFileLoader
__loader____spec__rP   )r   pathnamerI   rP   specmethodsmoduler   r   r   load_source   s    r\   c               @   s   e  Z d  Z d Z d S)_LoadCompiledCompatibilityz7Compatibility support for implementing load_compiled().N)rC   rD   rE   rF   r   r   r   r   r]      s   r]   c             C   s   t  |  | |  } t j |  | d | } t |  } |  t j k r^ | j t j |   } n | j   } t |  |  | _	 | j	 | j
 _ | S)z**DEPRECATED**rP   )r]   r   rQ   r   r#   rR   rS   rT   r   rV   rW   rP   )r   rX   rI   rP   rY   rZ   r[   r   r   r   load_compiled   s    r^   c             C   s   t  j j |  r t j d d  t j d d  } xU | D]5 } t  j j | d |  } t  j j |  r= Pq= q= Wt d j	 |    n  t
 j |  | d g  } t |  } |  t j k r | j t j |   S| j   Sd S)z**DEPRECATED**Nr@   z{!r} is not a packagesubmodule_search_locations)r=   r(   r>   r   r4   r5   joinexists
ValueErrorformatr   rQ   r   r#   rR   rS   rT   )r   r(   r6   	extensionrY   rZ   r   r   r   load_package   s    	re   c       	      C   s  | \ } } } | rI | j  d
  s1 d | k rI t d j |    n?| d k r | t t h k r d j |  } t |   n| t k r t |  | |  S| t k r t |  | |  S| t k rt d k	 r| d k rt	 | d   } t |  | |  SWd QXqt |  | |  Sni | t
 k r8t |  |  S| t k rNt |   S| t k rdt |   Sd j |  |  } t | d	 |   d S)z**DEPRECATED**

    Load a module, given information returned by find_module().

    The module name must include the full package name, if any.

    r0   U+zinvalid file open mode {!r}Nz.file object required for import (type code {})r+   z*Don't know how to import {} (type code {})r   )r0   rf   )
startswithrb   rc   r1   r2   r\   r^   r,   r   rL   PKG_DIRECTORYre   	C_BUILTINr   	PY_FROZENr   r<   )	r   rI   filenameZdetailssuffixmodetype_msgZopened_filer   r   r   load_module   s.    "

rq   c             C   s,  t  |  t  s- t d j t |      n9 t  | t d  t f  sf t d j t |      n  | d k r t |   r d d d d t f f St	 |   r d d d d t
 f f St j } n  x | D] } t j j | |   } xb d t j d g D]M } d | } t j j | |  } t j j |  r d | d d t f f Sq WxR t   D]D \ } } } |  | }	 t j j | |	  } t j j |  rSPqSqSWq Pq Wt t j |   d |   d }
 d	 | k rt | d
   } t j | j  d }
 Wd QXn  t | | d |
 } | | | | | f f S)a,  **DEPRECATED**

    Search for a module.

    If path is omitted or None, search for a built-in, frozen or special
    module and continue search in sys.path. The module name cannot
    contain '.'; to search for a submodule of a package, pass the
    submodule name and the package's __path__.

    z'name' must be a str, not {}Nz%'list' must be None or a list, not {}r;   z.pyr   r@   r   br+   encoding)
isinstancestr	TypeErrorrc   typelistRuntimeErrorr	   rj   r
   rk   r#   r(   r=   r`   r   r5   isfileri   r9   r<   r   rL   tokenizedetect_encodingreadline)r   r(   entryZpackage_directoryrm   Zpackage_file_nameZ	file_pathrn   ro   	file_namers   rI   r   r   r   rB      s@    	

rB   c             C   s   t  j |   S)zw**DEPRECATED**

    Reload the module and return it.

    The module must have been successfully imported before.

    )	importlibreload)r[   r   r   r   r   3  s    r   )7rF   _impr   r   r   r   r   r   r   r	   r
   r   r   r<   Zimportlib._bootstrapr   r   r   r   r   r   r=   r#   r{   r   warningswarnPendingDeprecationWarningZSEARCH_ERRORr1   r2   r,   ZPY_RESOURCEri   rj   rk   ZPY_CODERESOURCEZIMP_HOOKr    r"   r&   r'   r*   r9   r:   rG   rU   rO   r\   r]   r^   re   rq   rB   r   r   r   r   r   <module>   sT   F		#4