ó
:©ídc           @   sB   d  Z  d d l Z d e f d „  ƒ  YZ d e f d „  ƒ  YZ d S(   s  
    werkzeug.useragents
    ~~~~~~~~~~~~~~~~~~~

    This module provides a helper to inspect user agent strings.  This module
    is far from complete but should work for most of the currently available
    browsers.


    :copyright: 2007 Pallets
    :license: BSD-3-Clause
iÿÿÿÿNt   UserAgentParserc           B   sÅ   e  Z d  Z dH dI dJ dK dL dM dN dO dP dQ dR dS dT dU dV dW dX dY dZ d[ d\ f Z d] d^ d_ d` da db dc dd de df dg dh di dj dk dl dm dn do dp dq dr ds f Z dD Z e j dE ƒ Z dF „  Z	 dG „  Z
 RS(t   s5   A simple user agent parser.  Used by the `UserAgent`.s    cros t   chromeoss
   iphone|iost   iphonet   ipads   darwin|mac|os\s*xt   macost   wint   windowst   androidt   netbsdt   openbsdt   freebsdt	   dragonflyt   dragonflybsds   (sun|i86)ost   solariss   x11|lin(\b|ux)?t   linuxs   nintendo\s+wiit   wiit   irixs   hp-?uxt   hpuxt   aixs   sco|unix_svt   scot   bsdt   amigas   blackberry|playbookt
   blackberryt   symbiant	   googlebott   googlet   msnbott   msnt   yahoos
   ask jeevest   asks   aol|america\s+online\s+browsert   aols	   opera|oprt   operat   edges   chrome|criost   chromet	   seamonkeys"   firefox|firebird|phoenix|iceweaselt   firefoxt   galeons   safari|versiont   safarit   webkitt   caminot	   konquerors   k-meleont   kmeleont   netscapes4   msie|microsoft\s+internet\s+explorer|trident/.+? rv:t   msiet   lynxt   linkst   Baiduspidert   baidut   bingbott   bingt   mozillas   (?:%s)[/\sa-z(]*(\d+[.\da-z]+)?sa   (?:;\s*|\s+)(\b\w{2}\b(?:-\b\w{2}\b)?)\s*;|(?:\(|\[|;)\s*(\b\w{2}\b(?:-\b\w{2}\b)?)\s*(?:\]|\)|;)c         C   s   g  |  j  D]' \ } } | t j | t j ƒ f ^ q
 |  _  g  |  j D]. \ } } | t j |  j | t j ƒ f ^ qD |  _ d  S(   N(   t	   platformst   ret   compilet   It   browserst   _browser_version_re(   t   selft   at   b(    (    sd   /var/www/when_to_call/project-create-wtc-api/venv/lib/python2.7/site-packages/werkzeug/useragents.pyt   __init__K   s    :c         C   sæ   x< |  j  D]+ \ } } | j | ƒ } | d  k	 r
 Pq
 q
 Wd  } xO |  j D]: \ } } | j | ƒ } | d  k	 rI | j d ƒ } PqI qI Wd  } } |  j j | ƒ } | d  k	 rÐ | j d ƒ pÊ | j d ƒ } n d  } | | | | f S(   Ni   i   (   R3   t   searcht   NoneR7   t   groupt   _language_re(   R9   t
   user_agentt   platformt   regext   matcht   browsert   versiont   language(    (    sd   /var/www/when_to_call/project-create-wtc-api/venv/lib/python2.7/site-packages/werkzeug/useragents.pyt   __call__R   s     
!(   s    cros R   (   s
   iphone|iosR   (   R   R   (   s   darwin|mac|os\s*xR   (   R   R   (   R   R   (   R   R   (   R	   R	   (   R
   R
   (   R   R   (   s   (sun|i86)osR   (   s   x11|lin(\b|ux)?R   (   s   nintendo\s+wiiR   (   R   R   (   s   hp-?uxR   (   R   R   (   s   sco|unix_svR   (   R   R   (   R   R   (   s   blackberry|playbookR   (   R   R   (   R   R   (   R   R   (   R   R   (   s
   ask jeevesR   (   s   aol|america\s+online\s+browserR   (   s	   opera|oprR   (   R    R    (   s   chrome|criosR!   (   R"   R"   (   s"   firefox|firebird|phoenix|iceweaselR#   (   R$   R$   (   s   safari|versionR%   (   R&   R&   (   R'   R'   (   R(   R(   (   s   k-meleonR)   (   R*   R*   (   s4   msie|microsoft\s+internet\s+explorer|trident/.+? rv:R+   (   R,   R,   (   R-   R-   (   R.   R/   (   R0   R1   (   R2   R2   (   t   __name__t
   __module__t   __doc__R3   R7   R8   R4   R5   R@   R<   RH   (    (    (    sd   /var/www/when_to_call/project-create-wtc-api/venv/lib/python2.7/site-packages/werkzeug/useragents.pyR       sd   				t	   UserAgentc           B   sJ   e  Z d  Z e ƒ  Z d „  Z d „  Z d „  Z d „  Z e Z	 d „  Z
 RS(   s±  Represents a user agent.  Pass it a WSGI environment or a user agent
    string and you can inspect some of the details from the user agent
    string via the attributes.  The following attributes exist:

    .. attribute:: string

       the raw user agent string

    .. attribute:: platform

       the browser platform. ``None`` if not recognized.
       The following platforms are currently recognized:

       -   `aix`
       -   `amiga`
       -   `android`
       -   `blackberry`
       -   `bsd`
       -   `chromeos`
       -   `dragonflybsd`
       -   `freebsd`
       -   `hpux`
       -   `ipad`
       -   `iphone`
       -   `irix`
       -   `linux`
       -   `macos`
       -   `netbsd`
       -   `openbsd`
       -   `sco`
       -   `solaris`
       -   `symbian`
       -   `wii`
       -   `windows`

    .. attribute:: browser

        the name of the browser. ``None`` if not recognized.
        The following browsers are currently recognized:

        -   `aol` *
        -   `ask` *
        -   `baidu` *
        -   `bing` *
        -   `camino`
        -   `chrome`
        -   `edge`
        -   `firefox`
        -   `galeon`
        -   `google` *
        -   `kmeleon`
        -   `konqueror`
        -   `links`
        -   `lynx`
        -   `mozilla`
        -   `msie`
        -   `msn`
        -   `netscape`
        -   `opera`
        -   `safari`
        -   `seamonkey`
        -   `webkit`
        -   `yahoo` *

        (Browsers marked with a star (``*``) are crawlers.)

    .. attribute:: version

        the version of the browser. ``None`` if not recognized.

    .. attribute:: language

        the language of the browser. ``None`` if not recognized.
    c         C   sX   t  | t ƒ r$ | j d d ƒ } n  | |  _ |  j | ƒ \ |  _ |  _ |  _ |  _ d  S(   Nt   HTTP_USER_AGENTt    (	   t
   isinstancet   dictt   gett   stringt   _parserRB   RE   RF   RG   (   R9   t   environ_or_string(    (    sd   /var/www/when_to_call/project-create-wtc-api/venv/lib/python2.7/site-packages/werkzeug/useragents.pyR<   ¶   s
    	c         C   s   |  j  S(   N(   RR   (   R9   (    (    sd   /var/www/when_to_call/project-create-wtc-api/venv/lib/python2.7/site-packages/werkzeug/useragents.pyt	   to_header¾   s    c         C   s   |  j  S(   N(   RR   (   R9   (    (    sd   /var/www/when_to_call/project-create-wtc-api/venv/lib/python2.7/site-packages/werkzeug/useragents.pyt   __str__Á   s    c         C   s   t  |  j ƒ S(   N(   t   boolRE   (   R9   (    (    sd   /var/www/when_to_call/project-create-wtc-api/venv/lib/python2.7/site-packages/werkzeug/useragents.pyt   __nonzero__Ä   s    c         C   s   d |  j  j |  j |  j f S(   Ns
   <%s %r/%s>(   t	   __class__RI   RE   RF   (   R9   (    (    sd   /var/www/when_to_call/project-create-wtc-api/venv/lib/python2.7/site-packages/werkzeug/useragents.pyt   __repr__É   s    (   RI   RJ   RK   R    RS   R<   RU   RV   RX   t   __bool__RZ   (    (    (    sd   /var/www/when_to_call/project-create-wtc-api/venv/lib/python2.7/site-packages/werkzeug/useragents.pyRL   h   s   J					(   RK   R4   t   objectR    RL   (    (    (    sd   /var/www/when_to_call/project-create-wtc-api/venv/lib/python2.7/site-packages/werkzeug/useragents.pyt   <module>   s   W