AlkantarClanX12
Current Path : /lib/python3.6/site-packages/dnf/__pycache__/ |
Current File : //lib/python3.6/site-packages/dnf/__pycache__/i18n.cpython-36.pyc |
3 �ft`!0 � @ s� d dl mZ d dl mZ d dlmZ d dlZd dlZd dlZd dlZd dl Z d dl Z G dd� de�Zdd� Z d d � Zdd� Zd d� Zdd� Zdd� Zdd� Zd'dd�Zdd� Zd(dd�Zd)dd�Zd d!� Zd"d#� Zd$d%� Zed&�\ZZeZdS )*� )�print_function)�unicode_literals)�unicodeNc @ s$ e Zd Zdd� Zdd� Zdd� ZdS )� UnicodeStreamc C s || _ || _d S )N)�stream�encoding)�selfr r � r �/usr/lib/python3.6/i18n.py�__init__$ s zUnicodeStream.__init__c C s� t |t�s.tjjr |j| jd�n|j| jd�}y| jj |� W n\ t k r� |j| jjd�}t| jd�rz| jjj |� n|j| jjd�}| jj |� Y nX d S )N�replace�backslashreplace�buffer�ignore) � isinstance�str�dnf�pycomp�PY3�decoder �encoder �write�UnicodeEncodeError�hasattrr )r �sZs_bytesr r r r ( s zUnicodeStream.writec C s t | j|�S )N)�getattrr )r �namer r r �__getattr__7 s zUnicodeStream.__getattr__N)�__name__� __module__�__qualname__r r r r r r r r # s r c C s0 | dkrdS | j � }|jd�s(|jd�r,dS dS )a� Return true if encoding can express any Unicode character. Even if an encoding can express all accented letters in the given language, we can't generally settle for it in DNF since sometimes we output special characters like the registered trademark symbol (U+00AE) and surprisingly many national non-unicode encodings, including e.g. ASCII and ISO-8859-2, don't contain it. NFzutf-Zutf_T)�lower� startswith)r r! r r r �_full_ucd_support: s r# c C s t jd�} | jd�rdS | S )z= Take the best shot at the current system's string encoding. FZANSIzutf-8)�locale�getpreferredencodingr"