3
X'ícC¤ ã @ s4 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% ej&dZ'yPddl(m)Z* e'Z+yddl,m-Z-m.Z.m/Z/ W n" e0k
rB e1 Z- Z.Z/Y nX W nB e0k
r ddl2m'Z+ ddl3m)Z* ddl4m5Z-m6Z.m7Z/ Y nX d-ddZ8G dd de*Z)G dd de)Z9dd Z:G dd de)Z;dd Z<G d d! d!e)Z=G d"d# d#e)Z>G d$d% d%Z?d&d' Z@d.d(d)ZAg fd*d+ZBeCd,kr0e@ dS )/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 C s g }t | ttfs| g} xV| D ]N}|dkr,qt |ttfrN|jt||d q|jdd t|j|D qW tdd |D st|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 | ]}|j V qd S )N)Ústrip)Ú.0Ús© r! ú8/tmp/pip-build-gk9425m9/babel/babel/messages/frontend.pyú <genexpr>Y s z listify_value.<locals>.<genexpr>c s s | ]}t |tV qd S )N)Ú
isinstanceÚstr)r Úvalr! r! r"