B
    `                 @   s  d dl Z d dlZd dlZejdkZejdk ZejdkZejdZ	ejdZ
eedZe dd	d
ddgZdd Zerd dlmZ d dlZd dlmZmZ d dlmZmZ efZeZeZd dlmZ  dd Z!dd Z"dd Z#n|d dl$Zyd dl%mZ W n   d dlmZ Y nX eZ d dl&mZmZ d dl'mZmZ e(fZeZe)Zdd Z!dd Z"dd Z#erd dl*m+Z+m,Z, ee,drdd Z-nd d Z-nd dl.Z.d!d Z-erd-d"d#Z/ne0d$ d%d& Z1e2Z2d'd( Z3e4fd)d*Z5d+d, Z6dS ).    N)   r   )r   )      javawinpypy_version_infoArgSpecargsvarargskeywordsdefaultsc             C   s   t | r| j} t | s(td| | j}t |sFtd||j}|j	}t
r\|jnd}t|d| }||7 }d}|jt j@ r|j	| }|d }d}|jt j@ r|j	| }t|||| jS )zBgetargspec based on fully vendored getfullargspec from Python 3.3.z{!r} is not a Python functionz{!r} is not a code objectr   N   )inspectismethod__func__
isfunction	TypeErrorformat__code__iscodeco_argcountco_varnamespy3kco_kwonlyargcountlistco_flags
CO_VARARGSCO_VARKEYWORDSr   __defaults__)funcconargsnamesnkwargsr	   r
   varkw r%   S/home/kop/projects/devel/pgwui/test_venv/lib/python3.7/site-packages/mako/compat.pyinspect_getargspec   s(    




r'   )StringIO)
quote_plusunquote_plus)codepoint2namename2codepoint)BytesIOc             C   s   | S )Nr%   )sr%   r%   r&   u@   s    r/   c             C   s
   |  dS )Nzlatin-1)encode)r.   r%   r%   r&   bC   s    r1   c             C   s   t d|  S )NZ0o)eval)litr%   r%   r&   octalF   s    r4   c             C   s
   t | dS )Nzutf-8)unicode)r.   r%   r%   r&   r/   [   s    c             C   s   | S )Nr%   )r.   r%   r%   r&   r1   ^   s    c             C   s   t d|  S )N0)r2   )r3   r%   r%   r&   r4   a   s    )	machineryutilmodule_from_specc             C   s&   t | |}t |}|j| |S )N)r8   spec_from_file_locationr9   loaderexec_module)	module_idpathspecmoduler%   r%   r&   load_modulej   s    
rA   c             C   s   t | | }tj| = |S )N)r7   SourceFileLoaderrA   sysmodules)r=   r>   r@   r%   r%   r&   rA   p   s    c             C   s4   t |d}zt| ||}tj| = |S |  X d S )Nrb)openimpload_sourcerC   rD   close)r=   r>   fpr@   r%   r%   r&   rA   x   s    
c             C   s*   |d k	r||_ |j|k	r"|||d S )N)	__cause____traceback__with_traceback)tpvaluetbcauser%   r%   r&   reraise   s
    

rR   zEdef reraise(tp, value, tb=None, cause=None):
    raise tp, value, tb
c               C   s   t  d S )Nr   )rC   exc_infor%   r%   r%   r&   exception_as   s    rT   c             C   s   | j jS )N)	__class____name__)excr%   r%   r&   exception_name   s    rX   c             C   s   | d| j  |fi S )z%Create a base class with a metaclass.z%sBase)rV   )metabaser%   r%   r&   with_metaclass   s    r[   c             C   s   t | dr| jS t| S dS )zxGets the string name of a kwarg or vararg
    In Python3.4 a function's args are
    of _ast.arg type not _ast.name
    argN)hasattrr\   str)Zfunc_argr%   r%   r&   arg_stringname   s    
r_   )NN)7collectionsr   rC   version_infor   Zpy2kZpy27platform
startswithjythonwin32r]   pypy
namedtupler   r'   ior(   builtinsZcompat_builtinsurllib.parser)   r*   html.entitiesr+   r,   r^   string_typesbytesbinary_type	text_typer-   Zbyte_bufferr/   r1   r4   __builtin__	cStringIOurllibhtmlentitydefs
basestringr5   	importlibr7   r8   rA   rG   rR   execrT   allrX   objectr[   r_   r%   r%   r%   r&   <module>   sj   







	