ó
ÓnùWc           @   s­  d  Z  d d d g Z d d l Z d d l Z d d l Z d d l Z d d l Z e Z y d d l m	 Z	 Wn/ e
 k
 rœ e j d k r– d „  Z	 q ‚  n Xi e j d	 6d
 e j d  d 6e j j d d ƒ d d 6e j d 6e j ƒ  d 6e j ƒ  d 6e	 ƒ  d 6d d 6Z xC e e j ƒ  ƒ D]/ Z d e k r!e e e e j d d ƒ <q!q!Wd „  Z d e j f d „  ƒ  YZ d „  Z d „  Z e j ƒ  Z d „  Z d d „ Z d S(   sì  Interpret PEP 345 environment markers.

EXPR [in|==|!=|not in] EXPR [or|and] ...

where EXPR belongs to any of those:

    python_version = '%s.%s' % (sys.version_info[0], sys.version_info[1])
    python_full_version = sys.version.split()[0]
    os.name = os.name
    sys.platform = sys.platform
    platform.version = platform.version()
    platform.machine = platform.machine()
    platform.python_implementation = platform.python_implementation()
    a free string, like '2.6', or 'win32'
t   default_environmentt   compilet	   interpretiÿÿÿÿN(   t   python_implementationt   javac           C   s   d S(   Nt   Jython(    (    (    (    s9   /var/www/html/venv/build/setuptools/_markerlib/markers.pyR   !   s    s   sys.platforms   %s.%si   t   python_versiont    i   i    t   python_full_versions   os.names   platform.versions   platform.machines   platform.python_implementationt   extrat   .t   _c           C   s
   t  t ƒ S(   s2   Return copy of default PEP 385 globals dictionary.(   t   dictt   _VARS(    (    (    s9   /var/www/html/venv/build/setuptools/_markerlib/markers.pyR    8   s    t   ASTWhitelistc           B   s©   e  Z d  „  Z e j e j e j e j e j e j	 f Z
 e
 e j e j f 7Z
 e
 e j e j e j e j e j e j e j e j e j e j f
 7Z
 d „  Z d „  Z RS(   c         C   s   | |  _  d  S(   N(   t	   statement(   t   selfR   (    (    s9   /var/www/html/venv/build/setuptools/_markerlib/markers.pyt   __init__=   s    c         C   sL   t  | |  j ƒ s9 t d |  j d | j d f ƒ ‚ n  t j j |  | ƒ S(   s-   Ensure statement only contains allowed nodes.s)   Not allowed in environment markers.
%s
%sR   t   ^(   t
   isinstancet   ALLOWEDt   SyntaxErrorR   t
   col_offsett   astt   NodeTransformert   visit(   R   t   node(    (    s9   /var/www/html/venv/build/setuptools/_markerlib/markers.pyR   F   s
    c         C   s8   t  j d | j j | j f | j ƒ } t  j | | ƒ S(   s&   Flatten one level of attribute access.s   %s.%s(   R   t   Namet   valuet   idt   attrt   ctxt   copy_location(   R   R   t   new_node(    (    s9   /var/www/html/venv/build/setuptools/_markerlib/markers.pyt   visit_AttributeN   s    ((   t   __name__t
   __module__R   R   t   Comparet   BoolOpt	   AttributeR   t   Loadt   StrR   t   Andt   Ort   Eqt   Gtt   GtEt   Int   Ist   IsNott   Ltt   LtEt   NotEqt   NotInR   R"   (    (    (    s9   /var/www/html/venv/build/setuptools/_markerlib/markers.pyR   <   s   	*F	c         C   s.   t  j |  d d ƒ} t |  ƒ j | ƒ } | S(   Nt   modet   eval(   R   t   parseR   t   generic_visit(   t   markert   treet   new_tree(    (    s9   /var/www/html/venv/build/setuptools/_markerlib/markers.pyt   parse_markerS   s    c         C   s   t  |  d d d t ƒS(   Ns   <environment marker>R7   t   dont_inherit(   t   _builtin_compilet   True(   t   parsed_marker(    (    s9   /var/www/html/venv/build/setuptools/_markerlib/markers.pyt   compile_markerX   s    c            s€   y t  |  SWn t k
 r n X|  j ƒ  s> d d d „ } n' t t |  ƒ ƒ ‰  d d ‡  f d † } |  | _ | t  |  <t  |  S(   sC   Return compiled marker as a function accepting an environment dict.c         S   s   t  S(   t    (   R@   (   t   environmentt   override(    (    s9   /var/www/html/venv/build/setuptools/_markerlib/markers.pyt	   marker_fne   s    c            sG   | d k r i  } n  |  d k r- t ƒ  }  n  |  j | ƒ t ˆ  |  ƒ S(   s   override updates environmentN(   t   NoneR    t   updateR7   (   RD   RE   (   t   compiled_marker(    s9   /var/www/html/venv/build/setuptools/_markerlib/markers.pyRF   j   s    	N(   t   _cachet   KeyErrort   stripRG   RB   R=   t   __doc__(   R:   RF   (    (   RI   s9   /var/www/html/venv/build/setuptools/_markerlib/markers.pyR   ^   s    	
c         C   s   t  |  ƒ | ƒ S(   N(   R   (   R:   RD   (    (    s9   /var/www/html/venv/build/setuptools/_markerlib/markers.pyR   v   s    (   RM   t   __all__R   t   ost   platformt   syst   weakrefR   R?   R   t   ImportErrort   namet   version_infot   versiont   splitt   machineRG   R   t   listt   keyst   vart   replaceR    R   R   R=   RB   t   WeakValueDictionaryRJ   R   (    (    (    s9   /var/www/html/venv/build/setuptools/_markerlib/markers.pyt   <module>   s>   


!				