golden hour
/opt/saltstack/salt/lib/python3.10/site-packages/salt/ext/tornado/__pycache__
⬆️ Go Up
Upload
File/Folder
Size
Actions
__init__.cpython-310.pyc
378 B
Del
OK
_locale_data.cpython-310.pyc
3.23 KB
Del
OK
auth.cpython-310.pyc
39.18 KB
Del
OK
autoreload.cpython-310.pyc
7.02 KB
Del
OK
concurrent.cpython-310.pyc
17.24 KB
Del
OK
curl_httpclient.cpython-310.pyc
12.8 KB
Del
OK
escape.cpython-310.pyc
9.89 KB
Del
OK
gen.cpython-310.pyc
38.39 KB
Del
OK
http1connection.cpython-310.pyc
19.47 KB
Del
OK
httpclient.cpython-310.pyc
25.19 KB
Del
OK
httpserver.cpython-310.pyc
11.45 KB
Del
OK
httputil.cpython-310.pyc
29.84 KB
Del
OK
ioloop.cpython-310.pyc
33.19 KB
Del
OK
iostream.cpython-310.pyc
42.97 KB
Del
OK
locale.cpython-310.pyc
15.22 KB
Del
OK
locks.cpython-310.pyc
16.61 KB
Del
OK
log.cpython-310.pyc
8.07 KB
Del
OK
netutil.cpython-310.pyc
14.32 KB
Del
OK
options.cpython-310.pyc
19.63 KB
Del
OK
process.cpython-310.pyc
10.27 KB
Del
OK
queues.cpython-310.pyc
11.29 KB
Del
OK
routing.cpython-310.pyc
21.08 KB
Del
OK
simple_httpclient.cpython-310.pyc
16.08 KB
Del
OK
stack_context.cpython-310.pyc
10.65 KB
Del
OK
tcpclient.cpython-310.pyc
6.49 KB
Del
OK
tcpserver.cpython-310.pyc
10.06 KB
Del
OK
template.cpython-310.pyc
30.52 KB
Del
OK
testing.cpython-310.pyc
24.61 KB
Del
OK
util.cpython-310.pyc
13.72 KB
Del
OK
web.cpython-310.pyc
105.22 KB
Del
OK
websocket.cpython-310.pyc
39.08 KB
Del
OK
wsgi.cpython-310.pyc
11.5 KB
Del
OK
Edit: locale.cpython-310.pyc
o �xezO � @ s� d Z ddlmZmZmZ ddlZddlZddlZddlm Z ddl Z ddlZddlZddl mZ ddlmZ ddlmZ ddlmZ d ai aetg�ad adZdd � Zdd� Zddd�Zdd� Zdd� ZG dd� de �Z!G dd� de!�Z"G dd� de!�Z#dS )a� Translation methods for generating localized strings. To load a locale and generate a translated string:: user_locale = tornado.locale.get("es_LA") print(user_locale.translate("Sign out")) `tornado.locale.get()` returns the closest matching locale, not necessarily the specific locale you requested. You can support pluralization with additional arguments to `~Locale.translate()`, e.g.:: people = [...] message = user_locale.translate( "%(list)s is online", "%(list)s are online", len(people)) print(message % {"list": user_locale.list(people)}) The first string is chosen if ``len(people) == 1``, otherwise the second string is chosen. Applications should call one of `load_translations` (which uses a simple CSV format) or `load_gettext_translations` (which uses the ``.mo`` format supported by `gettext` and related tools). If neither method is called, the `Locale.translate` method will simply return the original string. � )�absolute_import�division�print_functionN)�BytesIO)�escape)�gen_log)�PY3)�LOCALE_NAMES�en_USF�c G s t j| � S )a� Returns the closest match for the given locale codes. We iterate over all given locale codes in order. If we have a tight or a loose match for the code (e.g., "en" for "en_US"), we return the locale. Otherwise we move to the next code in the list. By default we return ``en_US`` if no translations are found for any of the specified locales. You can change the default locale with `set_default_locale()`. )�Locale�get_closest)�locale_codes� r �K/opt/saltstack/salt/lib/python3.10/site-packages/salt/ext/tornado/locale.py�getB s r c C s | a ttt�� �t g �adS )a7 Sets the default locale. The default locale is assumed to be the language used for all strings in the system. The translations loaded from disk are mappings from the default locale to the destination locale. Consequently, you don't need to create a translation file for the default locale. N)�_default_locale� frozenset�list� _translations�keys�_supported_locales)�coder r r �set_default_localeP s r c C s� i a t�| �D ]�}|�d�sq|�d�\}}t�d|�s)t�d|tj � | |�� qtj � | |�}|du r^t|d��}|�t tj��}W d � n1 sLw Y |tjtjfv r\d}nd}trht|d |d �}n*t� }tj|d |d ��}|�t�|�� �� W d � n1 s�w Y |�d� i t |<