%PDF- %PDF-
Direktori : /opt/alt/python37/lib/python3.7/site-packages/babel/messages/__pycache__/ |
Current File : //opt/alt/python37/lib/python3.7/site-packages/babel/messages/__pycache__/frontend.cpython-37.pyc |
B H��XU� � @ s� d Z ddlmZ ddlZddlZddlZddlZddlZddlZddl Z ddl m Z ddlmZ ddl mZ ddl mZmZ ddlmZmZmZ dd lmZ dd lmZ ddlmZmZmZmZ ddlm Z dd l!m"Z"m#Z# ddl$m%Z%m&Z& ddl'm(Z) ddl*m+Z, ddl-m.Z.m/Z/ yddl0m1Z1 W n" e2k �rF ddl3m1Z1 Y nX d*dd�Z4G dd� de,�Z+G dd� de+�Z5G dd� de+�Z6dd� Z7G dd� de+�Z8G dd � d e+�Z9G d!d"� d"e:�Z;d#d$� Z<d+d%d&�Z=g fd'd(�Z>e?d)k�r�e<� dS ),z� babel.messages.frontend ~~~~~~~~~~~~~~~~~~~~~~~ Frontends for the message extraction functionality. :copyright: (c) 2013 by the Babel Team. :license: BSD, see LICENSE for more details. � )�print_functionN)�datetime)�getpreferredencoding)�__version__)�Locale� localedata)�StringIO�string_types� text_type)�UnknownLocaleError)�Catalog)�DEFAULT_KEYWORDS�DEFAULT_MAPPING�check_and_call_extract_file�extract_from_dir)�write_mo)�read_po�write_po)�LOCALTZ�odict)�log)�Command)�DistutilsOptionError�DistutilsSetupError)�RawConfigParserc C s� g }t | ttf�s| g} xV| D ]N}|dkr,qt |ttf�rN|�t||d�� q|�dd� t|��|�D �� qW tdd� |D ��s�t�|S )a Make a list out of an argument. Values from `distutils` argument parsing are always single strings; values from `optparse` parsing may be lists of strings that may need to be further split. No matter the input, this function returns a flat list of whitespace-trimmed strings, with `None` values filtered out. >>> listify_value("foo bar") ['foo', 'bar'] >>> listify_value(["foo bar"]) ['foo', 'bar'] >>> listify_value([["foo"], "bar"]) ['foo', 'bar'] >>> listify_value([["foo"], ["bar", None, "foo"]]) ['foo', 'bar', 'foo'] >>> listify_value("foo, bar, quux", ",") ['foo', 'bar', 'quux'] :param arg: A string or a list of strings :param split: The argument to pass to `str.split()`. :return: N)�splitc s s | ]}|� � V qd S )N)�strip)�.0�s� r �H/opt/alt/python37/lib/python3.7/site-packages/babel/messages/frontend.py� <genexpr>O s z listify_value.<locals>.<genexpr>c s s | ]}t |t�V qd S )N)� isinstancer )r �valr r r r! P s ) r"