j-B ^ d Z ddlmZ ddlZddlZddlmZ ddlmZ ddl m
Z
ddlmZm
Z
ddlmZmZ erdd lmZmZ dd
lmZ ddlmZ d=dZd=dZ G d de Z G d d Z G d d Z d>d?d#Z ej d$ Zd=d%Z d@dAd+Z! dBdCd6Z"dDd<Z#dS )Ez
babel.messages.pofile
~~~~~~~~~~~~~~~~~~~~~
Reading and writing of files in the ``gettext`` PO (portable object)
format.
:copyright: (c) 2013-2023 by the Babel Team.
:license: BSD, see LICENSE for more details.
)annotationsN)Iterable)
TYPE_CHECKING)Locale)CatalogMessage)_cmpwraptext)IOAnyStr)
SupportsWrite)Literalstringstrreturnc h d }t j d || dd S )zReverse `escape` the given string.
>>> print(unescape('"Say:\\n \\"hello, world!\\"\\n"'))
Say:
"hello, world!"
:param string: the string to unescape
c ` | d }|dk rdS |dk rdS |dk rdS |S )N n
t r
)group)matchms u/builddir/build/BUILD/imunify360-venv-2.6.2/opt/imunify360/venv/lib/python3.11/site-packages/babel/messages/pofile.pyreplace_escapesz!unescape..replace_escapes' s@ KKNN884
#XX4
#XX4 z\\([\\trn"])r )recompilesub)r r s r unescaper% s; :o&&**?F1R4LIIIr c d| v r]| }| d r
|dd }t t | }d | S t | S )a Reverse the normalization done by the `normalize` function.
>>> print(denormalize(r'''""
... "Say:\n"
... " \"hello, world!\"\n"'''))
Say:
"hello, world!"
>>> print(denormalize(r'''""
... "Say:\n"
... " \"Lorem ipsum dolor sit "
... "amet, consectetur adipisicing"
... " elit, \"\n"'''))
Say:
"Lorem ipsum dolor sit amet, consectetur adipisicing elit, "
:param string: the string to denormalize
r ""r N )
splitlines
startswithmapr% join)r
escaped_linesliness r denormalizer/ 4 so * v~~))++
T"" .)!""-MHm,,wwu~~r c $ e Zd ZdZd fdZ xZS )
PoFileErrorzDException thrown by PoParser when an invalid po file is encountered.messager catalogr linelinenointr Nonec ~ t | d| || _ || _ || _ d S )Nz on )super__init__r3 r4 r5 )selfr2 r3 r4 r5 __class__s r r: zPoFileError.__init__V sB
G1111222 r )
r2 r r3 r r4 r r5 r6 r r7 )__name__
__module____qualname____doc__r:
__classcell__)r<