ó
{Udc           @` s­   d  d l  m Z m Z m Z d  d l Z d d l m Z m Z d d l m	 Z	 m
 Z
 e r‚ d  d l m Z m Z e d e ƒ Z n e Z e j d ƒ Z d	 „  Z d
 „  Z d S(   i    (   t   absolute_importt   divisiont   print_functionNi   (   t   TYPE_CHECKINGt   cast(   t   InvalidVersiont   Version(   t   NewTypet   Uniont   NormalizedNames   [-_.]+c         C` s%   t  j d |  ƒ j ƒ  } t d | ƒ S(   Nt   -R	   (   t   _canonicalize_regext   subt   lowerR   (   t   namet   value(    (    si   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_vendor/packaging/utils.pyt   canonicalize_name   s    c         C` s]  t  |  t ƒ s7 y t |  ƒ }  Wq7 t k
 r3 |  SXn  g  } |  j d k rh | j d j |  j ƒ ƒ n  | j t j d d d j d „  |  j	 Dƒ ƒ ƒ ƒ |  j
 d k	 rÏ | j d j d „  |  j
 Dƒ ƒ ƒ n  |  j d k	 rú | j d j |  j ƒ ƒ n  |  j d k	 r%| j d	 j |  j ƒ ƒ n  |  j d k	 rP| j d
 j |  j ƒ ƒ n  d j | ƒ S(   s   
    This is very similar to Version.__str__, but has one subtle difference
    with the way it handles the release segment.
    i    s   {0}!s   (\.0)+$t    t   .c         s` s   |  ] } t  | ƒ Vq d  S(   N(   t   str(   t   .0t   x(    (    si   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_vendor/packaging/utils.pys	   <genexpr>1   s    c         s` s   |  ] } t  | ƒ Vq d  S(   N(   R   (   R   R   (    (    si   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_vendor/packaging/utils.pys	   <genexpr>5   s    s   .post{0}s   .dev{0}s   +{0}N(   t
   isinstanceR   R   t   epocht   appendt   formatt   reR   t   joint   releaset   pret   Nonet   postt   devt   local(   t   versiont   parts(    (    si   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_vendor/packaging/utils.pyt   canonicalize_version   s$    2&(   t
   __future__R    R   R   R   t   _typingR   R   R"   R   R   t   typingR   R   R   R	   t   compileR   R   R$   (    (    (    si   /var/www/html/phendo-backend/phendo_python/env/lib/python2.7/site-packages/pip/_vendor/packaging/utils.pyt   <module>   s   	