��W� � @ sy d d l Z d d l Z d d l Z d d l m Z e j e j d d � d Z d d � Z d d � Z d d � Z d S)� N� )�PY2�.c C s� d d l } t j d � } d } x_ | d k r� | j j d d � j d � rd | j } | d 7} q$ | j j | j j @r~ | SPq$ Wd S)Nr r �__name__� zclick.)� __future__�sys� _getframe� f_globals�get� startswith�f_back�f_code�co_flagsZunicode_literalsZ compiler_flag)r Zfrm�idx� r �/_unicodefun.py�_find_unicode_literals_frame s r c C sa t s d St s t j r d St � } | d k r7 d Sd d l m } | t d � d | �d S)Nr )�warna Click detected the use of the unicode_literals __future__ import. This is heavily discouraged because it can introduce subtle bugs in your code. You should instead use explicit u"" literals for your unicode strings. For more information see http://click.pocoo.org/python3/� stacklevel)� __debug__r �clickZ disable_unicode_literals_warningr �warningsr �Warning)Z bad_framer r r r �_check_for_unicode_literals s r c C s t r d Sy( d d l } t j | j � � j } Wn t k rL d } Yn X| d k r] d Sd } t j d k rd d l } | j d d g d | j d | j �j � d } t � } d } t | t � r� | j d d � } xZ | j � D]L } | j � } | j � j d � r� | j | � | j � d k r� d } q� W| d 7} | sY| d 7} n0 | rl| d 7} n | d d j t | � � 7} d } xZ t j j d � t j j d � f D]4 } | r�| j � j d � r�| } | d k r�Pq�W| d k r| d | 7} t d | � � d S)z=Ensures that the environment is good for unicode on Python 3.Nr �asciir �posix�localez-a�stdout�stderrF�replace�.utf-8�.utf8�c.utf8�c.utf-8Tz z�Additional information: on this system no suitable UTF-8 locales were discovered. This most likely requires resolving by reconfiguring the locale system.z�This system supports the C.UTF-8 locale which is recommended. You might be able to resolve your issue by exporting the following environment variables: export LC_ALL=C.UTF-8 export LANG=C.UTF-8z�This system lists a couple of UTF-8 supporting locales that you can pick from. The following suitable locales where discovered: %sz, �LC_ALLZLANGz� Click discovered that you exported a UTF-8 locale but the locale system could not pick up from it because it does not exist. The exported locale is "%s" but it is not supportedz�Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Either run this under Python 2 or consult http://click.pocoo.org/python3/ for mitigation steps.)r! r"