�
ƪbC� � �h � d Z ddlZddlZddlZddlZddlZddlZddlZddlZddl m
Z
ddlmZ ddl
m
Z
ddlmZ ddlmZ ddlmZmZ dd lmZ dd
lmZmZ ddlmZmZmZmZ ddlm Z dd
l!m"Z"m#Z# ddl$m%Z% ejL d� Z' ddl(m)Z* e'Z+ ddl,m-Z-m.Z.m/Z/ d'd�Z8 G d� de*� Z) G d� de)� Z9d� Z: G d� de)� Z;d� Z< G d� de)� Z= G d� d e)� Z> G d!� d"� Z?d#� Z@d'd$�ZAg fd%�ZBeCd&k( r e@� yy# e0$ r e1xZ-xZ.Z/Y �rw xY w# e0$ r ddl2m'Z+ ddl3m)Z* ddl4m5Z-m6Z.m7Z/ Y ��w xY w)(z�
babel.messages.frontend
~~~~~~~~~~~~~~~~~~~~~~~
Frontends for the message extraction functionality.
:copyright: (c) 2013-2022 by the Babel Team.
:license: BSD, see LICENSE for more details.
� N)�OrderedDict)�RawConfigParser)�datetime)�StringIO)�__version__)�Locale�
localedata)�UnknownLocaleError)�Catalog�DEFAULT_HEADER)�DEFAULT_KEYWORDS�DEFAULT_MAPPING�check_and_call_extract_file�extract_from_dir)�write_mo)�read_po�write_po)�LOCALTZ�babel)�Command)�OptionError�
SetupError� BaseError)�log)�DistutilsOptionError�DistutilsSetupError�DistutilsErrorc �> � g }t | t t f� s| g} | D ]h }|��t |t t f� r|j t ||�� � �9|j d� t |� j
|� D � � �j t d� |D � � sJ �|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:
)�splitc 3 �< |