File: //home/arjun/projects/env/lib/python3.10/site-packages/babel/__pycache__/support.cpython-310.pyc
o
!we�h � @ s d Z ddlmZ ddlZddlZddlZddlZddlmZ ddl m
Z
mZmZm
Z
ddlmZ ddlmZmZmZmZ ddlmZmZmZmZmZmZ e
rZdd lmZ dd
lmZ G dd� d�ZG d
d� d�Z G dd� dej!�Z!G dd� de!ej"�Z#ddd�Z$dS )a-
babel.support
~~~~~~~~~~~~~
Several classes and functions that help with integrating and using Babel
in applications.
.. note: the code in this module is not used by Babel itself
:copyright: (c) 2013-2023 by the Babel Team.
:license: BSD, see LICENSE for more details.
� )�annotationsN)�Iterator)�
TYPE_CHECKING�Any�Callable�Iterable)�Locale)�format_date�format_datetime�format_time�format_timedelta)�format_compact_currency�format_compact_decimal�format_currency�format_decimal�format_percent�format_scientific)�Literal)�_PredefinedTimeFormatc @ s� e Zd ZdZdBdCd d
�Z dDdEdd�Z dDdFdd�Z dDdGdd�Z dHdId'd(�ZdJd+d,�Z dBdKd.d/�Z
0 1dLdMd6d7�ZdNd9d:�Z 0 1dLdOd<d=�Z
dBdKd>d?�ZdJd@dA�ZdS )P�FormataC Wrapper class providing the various date and number formatting functions
bound to a specific locale and time-zone.
>>> from babel.util import UTC
>>> from datetime import date
>>> fmt = Format('en_US', UTC)
>>> fmt.date(date(2007, 4, 1))
u'Apr 1, 2007'
>>> fmt.decimal(1.2345)
u'1.234'
N�locale�Locale | str�tzinfo�datetime.tzinfo | None�return�Nonec C s t �|�| _|| _dS )z�Initialize the formatter.
:param locale: the locale identifier or `Locale` instance
:param tzinfo: the time-zone info (a `tzinfo` instance or `None`)
N)r �parser r )�selfr r � r �F/home/arjun/projects/env/lib/python3.10/site-packages/babel/support.py�__init__4 s
zFormat.__init__�medium�date�datetime.date | None�format�_PredefinedTimeFormat | str�strc C � t ||| jd�S )z�Return a date formatted according to the given pattern.
>>> from datetime import date
>>> fmt = Format('en_US')
>>> fmt.date(date(2007, 4, 1))
u'Apr 1, 2007'
�r )r r )r r"