Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +382 -0
- micromamba_root/Lib/_pyrepl/__pycache__/__init__.cpython-314.pyc +0 -0
- micromamba_root/Lib/_pyrepl/__pycache__/__main__.cpython-314.pyc +0 -0
- micromamba_root/Lib/_pyrepl/__pycache__/_module_completer.cpython-314.pyc +0 -0
- micromamba_root/Lib/_pyrepl/__pycache__/_threading_handler.cpython-314.pyc +0 -0
- micromamba_root/Lib/_pyrepl/__pycache__/historical_reader.cpython-314.pyc +0 -0
- micromamba_root/Lib/_pyrepl/__pycache__/input.cpython-314.pyc +0 -0
- micromamba_root/Lib/_pyrepl/__pycache__/keymap.cpython-314.pyc +0 -0
- micromamba_root/Lib/_pyrepl/__pycache__/main.cpython-314.pyc +0 -0
- micromamba_root/Lib/_pyrepl/__pycache__/pager.cpython-314.pyc +0 -0
- micromamba_root/Lib/_pyrepl/__pycache__/reader.cpython-314.pyc +0 -0
- micromamba_root/Lib/_pyrepl/__pycache__/readline.cpython-314.pyc +0 -0
- micromamba_root/Lib/_pyrepl/__pycache__/simple_interact.cpython-314.pyc +0 -0
- micromamba_root/Lib/_pyrepl/__pycache__/terminfo.cpython-314.pyc +0 -0
- micromamba_root/Lib/_pyrepl/__pycache__/trace.cpython-314.pyc +0 -0
- micromamba_root/Lib/_pyrepl/__pycache__/types.cpython-314.pyc +0 -0
- micromamba_root/Lib/_pyrepl/__pycache__/unix_console.cpython-314.pyc +0 -0
- micromamba_root/Lib/_pyrepl/__pycache__/unix_eventqueue.cpython-314.pyc +0 -0
- micromamba_root/Lib/_pyrepl/__pycache__/utils.cpython-314.pyc +0 -0
- micromamba_root/Lib/_pyrepl/__pycache__/windows_console.cpython-314.pyc +0 -0
- micromamba_root/Lib/_pyrepl/__pycache__/windows_eventqueue.cpython-314.pyc +0 -0
- micromamba_root/Lib/site-packages/babel-2.18.0.dist-info/INSTALLER +1 -0
- micromamba_root/Lib/site-packages/babel-2.18.0.dist-info/METADATA +58 -0
- micromamba_root/Lib/site-packages/babel-2.18.0.dist-info/RECORD +1150 -0
- micromamba_root/Lib/site-packages/babel-2.18.0.dist-info/REQUESTED +0 -0
- micromamba_root/Lib/site-packages/babel-2.18.0.dist-info/WHEEL +5 -0
- micromamba_root/Lib/site-packages/babel-2.18.0.dist-info/direct_url.json +1 -0
- micromamba_root/Lib/site-packages/babel-2.18.0.dist-info/entry_points.txt +20 -0
- micromamba_root/Lib/site-packages/babel-2.18.0.dist-info/top_level.txt +1 -0
- micromamba_root/Lib/site-packages/babel/__init__.py +38 -0
- micromamba_root/Lib/site-packages/babel/core.py +1384 -0
- micromamba_root/Lib/site-packages/babel/dates.py +2040 -0
- micromamba_root/Lib/site-packages/babel/languages.py +78 -0
- micromamba_root/Lib/site-packages/babel/lists.py +141 -0
- micromamba_root/Lib/site-packages/babel/localedata.py +284 -0
- micromamba_root/Lib/site-packages/babel/numbers.py +1681 -0
- micromamba_root/Lib/site-packages/babel/plural.py +652 -0
- micromamba_root/Lib/site-packages/babel/py.typed +1 -0
- micromamba_root/Lib/site-packages/babel/support.py +796 -0
- micromamba_root/Lib/site-packages/babel/units.py +362 -0
- micromamba_root/Lib/site-packages/babel/util.py +318 -0
- micromamba_root/Lib/site-packages/backrefs-7.0.dist-info/INSTALLER +1 -0
- micromamba_root/Lib/site-packages/backrefs-7.0.dist-info/METADATA +69 -0
- micromamba_root/Lib/site-packages/backrefs-7.0.dist-info/RECORD +78 -0
- micromamba_root/Lib/site-packages/backrefs-7.0.dist-info/REQUESTED +0 -0
- micromamba_root/Lib/site-packages/backrefs-7.0.dist-info/WHEEL +4 -0
- micromamba_root/Lib/site-packages/backrefs-7.0.dist-info/direct_url.json +1 -0
- micromamba_root/Lib/site-packages/backrefs/__init__.py +2 -0
- micromamba_root/Lib/site-packages/backrefs/__meta__.py +197 -0
- micromamba_root/Lib/site-packages/backrefs/_bre_parse.py +1547 -0
.gitattributes
CHANGED
|
@@ -1465,3 +1465,385 @@ msvc/Windows[[:space:]]Kits/10/Lib/10.0.26100.0/ucrt/x64/ucrtd.osmode.lib filter
|
|
| 1465 |
msvc/Windows[[:space:]]Kits/10/Lib/10.0.26100.0/ucrt/x64/ucrtd.osmode_permissive.lib filter=lfs diff=lfs merge=lfs -text
|
| 1466 |
msvc/Windows[[:space:]]Kits/10/Lib/10.0.26100.0/ucrt/x86/libucrt.lib filter=lfs diff=lfs merge=lfs -text
|
| 1467 |
msvc/Windows[[:space:]]Kits/10/Lib/10.0.26100.0/ucrt/x86/libucrtd.lib filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1465 |
msvc/Windows[[:space:]]Kits/10/Lib/10.0.26100.0/ucrt/x64/ucrtd.osmode_permissive.lib filter=lfs diff=lfs merge=lfs -text
|
| 1466 |
msvc/Windows[[:space:]]Kits/10/Lib/10.0.26100.0/ucrt/x86/libucrt.lib filter=lfs diff=lfs merge=lfs -text
|
| 1467 |
msvc/Windows[[:space:]]Kits/10/Lib/10.0.26100.0/ucrt/x86/libucrtd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1468 |
+
msvc/Windows[[:space:]]Kits/10/Lib/10.0.26100.0/ucrt/x86/ucrt.lib filter=lfs diff=lfs merge=lfs -text
|
| 1469 |
+
msvc/Windows[[:space:]]Kits/10/Lib/10.0.26100.0/ucrt/x86/ucrt.osmode.lib filter=lfs diff=lfs merge=lfs -text
|
| 1470 |
+
msvc/Windows[[:space:]]Kits/10/Lib/10.0.26100.0/ucrt/x86/ucrt.osmode_permissive.lib filter=lfs diff=lfs merge=lfs -text
|
| 1471 |
+
msvc/Windows[[:space:]]Kits/10/Lib/10.0.26100.0/ucrt/x86/ucrtd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1472 |
+
msvc/Windows[[:space:]]Kits/10/Lib/10.0.26100.0/ucrt/x86/ucrtd.osmode.lib filter=lfs diff=lfs merge=lfs -text
|
| 1473 |
+
msvc/Windows[[:space:]]Kits/10/Lib/10.0.26100.0/ucrt/x86/ucrtd.osmode_permissive.lib filter=lfs diff=lfs merge=lfs -text
|
| 1474 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/accevent.exe filter=lfs diff=lfs merge=lfs -text
|
| 1475 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/appxpackaging.dll filter=lfs diff=lfs merge=lfs -text
|
| 1476 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/certmgr.exe filter=lfs diff=lfs merge=lfs -text
|
| 1477 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/cppwinrt.exe filter=lfs diff=lfs merge=lfs -text
|
| 1478 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/d3dcompiler_47.dll filter=lfs diff=lfs merge=lfs -text
|
| 1479 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/dxc.exe filter=lfs diff=lfs merge=lfs -text
|
| 1480 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/dxcapsviewer.exe filter=lfs diff=lfs merge=lfs -text
|
| 1481 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/dxcompiler.dll filter=lfs diff=lfs merge=lfs -text
|
| 1482 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/dxil.dll filter=lfs diff=lfs merge=lfs -text
|
| 1483 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/fxc.exe filter=lfs diff=lfs merge=lfs -text
|
| 1484 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/gamesaveutil.exe filter=lfs diff=lfs merge=lfs -text
|
| 1485 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/inspect.exe filter=lfs diff=lfs merge=lfs -text
|
| 1486 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/makeappx.exe filter=lfs diff=lfs merge=lfs -text
|
| 1487 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/makepri.exe filter=lfs diff=lfs merge=lfs -text
|
| 1488 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/mc.exe filter=lfs diff=lfs merge=lfs -text
|
| 1489 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/mdmerge.exe filter=lfs diff=lfs merge=lfs -text
|
| 1490 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/mfdetours.dll filter=lfs diff=lfs merge=lfs -text
|
| 1491 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/mftrace.exe filter=lfs diff=lfs merge=lfs -text
|
| 1492 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/Microsoft.Diagnostics.Tracing.EventSource.dll filter=lfs diff=lfs merge=lfs -text
|
| 1493 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/Microsoft.Msix.Utils.dll filter=lfs diff=lfs merge=lfs -text
|
| 1494 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/midl.exe filter=lfs diff=lfs merge=lfs -text
|
| 1495 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/midlc.exe filter=lfs diff=lfs merge=lfs -text
|
| 1496 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/midlrt.exe filter=lfs diff=lfs merge=lfs -text
|
| 1497 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/midlrtmd.dll filter=lfs diff=lfs merge=lfs -text
|
| 1498 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/mrmsupport.dll filter=lfs diff=lfs merge=lfs -text
|
| 1499 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/msisip.dll filter=lfs diff=lfs merge=lfs -text
|
| 1500 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/mt.exe filter=lfs diff=lfs merge=lfs -text
|
| 1501 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/rcdll.dll filter=lfs diff=lfs merge=lfs -text
|
| 1502 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/regwinmd.exe filter=lfs diff=lfs merge=lfs -text
|
| 1503 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/ServicingCommon.dll filter=lfs diff=lfs merge=lfs -text
|
| 1504 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/tedutil.dll filter=lfs diff=lfs merge=lfs -text
|
| 1505 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/topoedit.exe filter=lfs diff=lfs merge=lfs -text
|
| 1506 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/winmdidl.exe filter=lfs diff=lfs merge=lfs -text
|
| 1507 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/wstraceutil.exe filter=lfs diff=lfs merge=lfs -text
|
| 1508 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/wsutil.exe filter=lfs diff=lfs merge=lfs -text
|
| 1509 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/wsutilhelper.dll filter=lfs diff=lfs merge=lfs -text
|
| 1510 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/AccChecker/acccheckui.exe filter=lfs diff=lfs merge=lfs -text
|
| 1511 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/AccChecker/IE.Interop.MSHTML.dll filter=lfs diff=lfs merge=lfs -text
|
| 1512 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/AccChecker/Microsoft.Diagnostics.Tracing.EventSource.dll filter=lfs diff=lfs merge=lfs -text
|
| 1513 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/ucrt/ucrtbased.dll filter=lfs diff=lfs merge=lfs -text
|
| 1514 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/UIAVerify/Interop.UIAutomationClient.dll filter=lfs diff=lfs merge=lfs -text
|
| 1515 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/UIAVerify/Microsoft.UIAutomationClient.Interop.dll filter=lfs diff=lfs merge=lfs -text
|
| 1516 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/UIAVerify/UIAComWrapper.dll filter=lfs diff=lfs merge=lfs -text
|
| 1517 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/UIAVerify/VisualUIAVerifyNative.exe filter=lfs diff=lfs merge=lfs -text
|
| 1518 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/UIAVerify/VisualUIAVerifyNative.resources.dll filter=lfs diff=lfs merge=lfs -text
|
| 1519 |
+
msvc/Windows[[:space:]]Kits/10/bin/10.0.26100.0/x64/UIAVerify/WUIATestLibrary.dll filter=lfs diff=lfs merge=lfs -text
|
| 1520 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/aligned_new.lib filter=lfs diff=lfs merge=lfs -text
|
| 1521 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/clang_rt.asan_dbg_dynamic-x86_64.lib filter=lfs diff=lfs merge=lfs -text
|
| 1522 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/clang_rt.asan_dbg_nonewdelete_dynamic-x86_64.lib filter=lfs diff=lfs merge=lfs -text
|
| 1523 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/clang_rt.asan_dynamic-x86_64.lib filter=lfs diff=lfs merge=lfs -text
|
| 1524 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/clang_rt.asan_dynamic_runtime_thunk-x86_64.lib filter=lfs diff=lfs merge=lfs -text
|
| 1525 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/clang_rt.asan_nonewdelete_dynamic-x86_64.lib filter=lfs diff=lfs merge=lfs -text
|
| 1526 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/clang_rt.asan_static_runtime_thunk-x86_64.lib filter=lfs diff=lfs merge=lfs -text
|
| 1527 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/clang_rt.builtins-x86_64.lib filter=lfs diff=lfs merge=lfs -text
|
| 1528 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/clang_rt.fuzzer_MD-x86_64.lib filter=lfs diff=lfs merge=lfs -text
|
| 1529 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/clang_rt.fuzzer_MDd-x86_64.lib filter=lfs diff=lfs merge=lfs -text
|
| 1530 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/clang_rt.fuzzer_MT-x86_64.lib filter=lfs diff=lfs merge=lfs -text
|
| 1531 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/clang_rt.fuzzer_MTd-x86_64.lib filter=lfs diff=lfs merge=lfs -text
|
| 1532 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/clang_rt.fuzzer_no_main_MD-x86_64.lib filter=lfs diff=lfs merge=lfs -text
|
| 1533 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/clang_rt.fuzzer_no_main_MDd-x86_64.lib filter=lfs diff=lfs merge=lfs -text
|
| 1534 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/clang_rt.fuzzer_no_main_MT-x86_64.lib filter=lfs diff=lfs merge=lfs -text
|
| 1535 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/clang_rt.fuzzer_no_main_MTd-x86_64.lib filter=lfs diff=lfs merge=lfs -text
|
| 1536 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/clang_rt.profile-x86_64.lib filter=lfs diff=lfs merge=lfs -text
|
| 1537 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/clang_rt.stats-x86_64.lib filter=lfs diff=lfs merge=lfs -text
|
| 1538 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/clang_rt.ubsan_standalone-x86_64.lib filter=lfs diff=lfs merge=lfs -text
|
| 1539 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/clang_rt.ubsan_standalone_cxx-x86_64.lib filter=lfs diff=lfs merge=lfs -text
|
| 1540 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/comsupp.lib filter=lfs diff=lfs merge=lfs -text
|
| 1541 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/comsuppd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1542 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/comsuppw.lib filter=lfs diff=lfs merge=lfs -text
|
| 1543 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/comsuppwd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1544 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/concrt.lib filter=lfs diff=lfs merge=lfs -text
|
| 1545 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/concrtd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1546 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/delayimp.lib filter=lfs diff=lfs merge=lfs -text
|
| 1547 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/exe_initialize_mta.lib filter=lfs diff=lfs merge=lfs -text
|
| 1548 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/legacy_stdio_definitions.lib filter=lfs diff=lfs merge=lfs -text
|
| 1549 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libcmt.amd64.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1550 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libcmt.lib filter=lfs diff=lfs merge=lfs -text
|
| 1551 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libcmtd.amd64.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1552 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libcmtd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1553 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libconcrt.amd64.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1554 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libconcrt.lib filter=lfs diff=lfs merge=lfs -text
|
| 1555 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libconcrt1.amd64.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1556 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libconcrt1.lib filter=lfs diff=lfs merge=lfs -text
|
| 1557 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libconcrtd.amd64.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1558 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libconcrtd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1559 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libconcrtd0.amd64.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1560 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libconcrtd0.lib filter=lfs diff=lfs merge=lfs -text
|
| 1561 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libconcrtd1.amd64.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1562 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libconcrtd1.lib filter=lfs diff=lfs merge=lfs -text
|
| 1563 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libcpmt.amd64.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1564 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libcpmt.lib filter=lfs diff=lfs merge=lfs -text
|
| 1565 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libcpmt1.amd64.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1566 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libcpmt1.lib filter=lfs diff=lfs merge=lfs -text
|
| 1567 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libcpmtd.amd64.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1568 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libcpmtd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1569 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libcpmtd0.amd64.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1570 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libcpmtd0.lib filter=lfs diff=lfs merge=lfs -text
|
| 1571 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libcpmtd1.amd64.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1572 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libcpmtd1.lib filter=lfs diff=lfs merge=lfs -text
|
| 1573 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libomp.lib filter=lfs diff=lfs merge=lfs -text
|
| 1574 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libompd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1575 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libsancov.lib filter=lfs diff=lfs merge=lfs -text
|
| 1576 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libsancovd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1577 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libvcasan.lib filter=lfs diff=lfs merge=lfs -text
|
| 1578 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libvcasand.lib filter=lfs diff=lfs merge=lfs -text
|
| 1579 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libvcruntime.amd64.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1580 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libvcruntime.lib filter=lfs diff=lfs merge=lfs -text
|
| 1581 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libvcruntimed.amd64.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1582 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/libvcruntimed.lib filter=lfs diff=lfs merge=lfs -text
|
| 1583 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/msvcmrt.lib filter=lfs diff=lfs merge=lfs -text
|
| 1584 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/msvcmrtd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1585 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/msvcmrtd_netcore.lib filter=lfs diff=lfs merge=lfs -text
|
| 1586 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/msvcmrt_netcore.lib filter=lfs diff=lfs merge=lfs -text
|
| 1587 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/msvcprt.lib filter=lfs diff=lfs merge=lfs -text
|
| 1588 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/msvcprtd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1589 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/msvcrt.lib filter=lfs diff=lfs merge=lfs -text
|
| 1590 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/msvcrtd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1591 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/oldnames.lib filter=lfs diff=lfs merge=lfs -text
|
| 1592 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/ptrustm.lib filter=lfs diff=lfs merge=lfs -text
|
| 1593 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/ptrustmd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1594 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/sancov.lib filter=lfs diff=lfs merge=lfs -text
|
| 1595 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/sancovd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1596 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/vcasan.lib filter=lfs diff=lfs merge=lfs -text
|
| 1597 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/vcasand.lib filter=lfs diff=lfs merge=lfs -text
|
| 1598 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/vccorlib.lib filter=lfs diff=lfs merge=lfs -text
|
| 1599 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/vccorlibd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1600 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/vcruntime.lib filter=lfs diff=lfs merge=lfs -text
|
| 1601 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x64/vcruntimed.lib filter=lfs diff=lfs merge=lfs -text
|
| 1602 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/aligned_new.lib filter=lfs diff=lfs merge=lfs -text
|
| 1603 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/clang_rt.asan_dbg_dynamic-i386.lib filter=lfs diff=lfs merge=lfs -text
|
| 1604 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/clang_rt.asan_dbg_nonewdelete_dynamic-i386.lib filter=lfs diff=lfs merge=lfs -text
|
| 1605 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/clang_rt.asan_dynamic-i386.lib filter=lfs diff=lfs merge=lfs -text
|
| 1606 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/clang_rt.asan_dynamic_runtime_thunk-i386.lib filter=lfs diff=lfs merge=lfs -text
|
| 1607 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/clang_rt.asan_nonewdelete_dynamic-i386.lib filter=lfs diff=lfs merge=lfs -text
|
| 1608 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/clang_rt.asan_static_runtime_thunk-i386.lib filter=lfs diff=lfs merge=lfs -text
|
| 1609 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/clang_rt.builtins-i386.lib filter=lfs diff=lfs merge=lfs -text
|
| 1610 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/clang_rt.fuzzer_MD-i386.lib filter=lfs diff=lfs merge=lfs -text
|
| 1611 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/clang_rt.fuzzer_MDd-i386.lib filter=lfs diff=lfs merge=lfs -text
|
| 1612 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/clang_rt.fuzzer_MT-i386.lib filter=lfs diff=lfs merge=lfs -text
|
| 1613 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/clang_rt.fuzzer_MTd-i386.lib filter=lfs diff=lfs merge=lfs -text
|
| 1614 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/clang_rt.fuzzer_no_main_MD-i386.lib filter=lfs diff=lfs merge=lfs -text
|
| 1615 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/clang_rt.fuzzer_no_main_MDd-i386.lib filter=lfs diff=lfs merge=lfs -text
|
| 1616 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/clang_rt.fuzzer_no_main_MT-i386.lib filter=lfs diff=lfs merge=lfs -text
|
| 1617 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/clang_rt.fuzzer_no_main_MTd-i386.lib filter=lfs diff=lfs merge=lfs -text
|
| 1618 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/clang_rt.profile-i386.lib filter=lfs diff=lfs merge=lfs -text
|
| 1619 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/clang_rt.stats-i386.lib filter=lfs diff=lfs merge=lfs -text
|
| 1620 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/clang_rt.ubsan_standalone-i386.lib filter=lfs diff=lfs merge=lfs -text
|
| 1621 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/clang_rt.ubsan_standalone_cxx-i386.lib filter=lfs diff=lfs merge=lfs -text
|
| 1622 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/comsupp.lib filter=lfs diff=lfs merge=lfs -text
|
| 1623 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/comsuppd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1624 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/comsuppw.lib filter=lfs diff=lfs merge=lfs -text
|
| 1625 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/comsuppwd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1626 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/concrt.lib filter=lfs diff=lfs merge=lfs -text
|
| 1627 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/concrtd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1628 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/delayimp.lib filter=lfs diff=lfs merge=lfs -text
|
| 1629 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/exe_initialize_mta.lib filter=lfs diff=lfs merge=lfs -text
|
| 1630 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/legacy_stdio_definitions.lib filter=lfs diff=lfs merge=lfs -text
|
| 1631 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libcmt.i386.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1632 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libcmt.lib filter=lfs diff=lfs merge=lfs -text
|
| 1633 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libcmtd.i386.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1634 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libcmtd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1635 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libconcrt.i386.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1636 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libconcrt.lib filter=lfs diff=lfs merge=lfs -text
|
| 1637 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libconcrt1.i386.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1638 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libconcrt1.lib filter=lfs diff=lfs merge=lfs -text
|
| 1639 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libconcrtd.i386.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1640 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libconcrtd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1641 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libconcrtd0.i386.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1642 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libconcrtd0.lib filter=lfs diff=lfs merge=lfs -text
|
| 1643 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libconcrtd1.i386.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1644 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libconcrtd1.lib filter=lfs diff=lfs merge=lfs -text
|
| 1645 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libcpmt.i386.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1646 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libcpmt.lib filter=lfs diff=lfs merge=lfs -text
|
| 1647 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libcpmt1.i386.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1648 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libcpmt1.lib filter=lfs diff=lfs merge=lfs -text
|
| 1649 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libcpmtd.i386.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1650 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libcpmtd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1651 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libcpmtd0.i386.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1652 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libcpmtd0.lib filter=lfs diff=lfs merge=lfs -text
|
| 1653 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libcpmtd1.i386.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1654 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libcpmtd1.lib filter=lfs diff=lfs merge=lfs -text
|
| 1655 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libomp.lib filter=lfs diff=lfs merge=lfs -text
|
| 1656 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libompd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1657 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libsancov.lib filter=lfs diff=lfs merge=lfs -text
|
| 1658 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libsancovd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1659 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libvcasan.lib filter=lfs diff=lfs merge=lfs -text
|
| 1660 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libvcasand.lib filter=lfs diff=lfs merge=lfs -text
|
| 1661 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libvcruntime.i386.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1662 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libvcruntime.lib filter=lfs diff=lfs merge=lfs -text
|
| 1663 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libvcruntimed.i386.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1664 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/libvcruntimed.lib filter=lfs diff=lfs merge=lfs -text
|
| 1665 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/msvcmrt.lib filter=lfs diff=lfs merge=lfs -text
|
| 1666 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/msvcmrtd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1667 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/msvcmrtd_netcore.lib filter=lfs diff=lfs merge=lfs -text
|
| 1668 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/msvcmrt_netcore.lib filter=lfs diff=lfs merge=lfs -text
|
| 1669 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/msvcprt.lib filter=lfs diff=lfs merge=lfs -text
|
| 1670 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/msvcprtd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1671 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/msvcrt.lib filter=lfs diff=lfs merge=lfs -text
|
| 1672 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/msvcrtd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1673 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/oldnames.lib filter=lfs diff=lfs merge=lfs -text
|
| 1674 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/ptrustm.lib filter=lfs diff=lfs merge=lfs -text
|
| 1675 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/ptrustmd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1676 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/sancov.lib filter=lfs diff=lfs merge=lfs -text
|
| 1677 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/sancovd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1678 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/vcasan.lib filter=lfs diff=lfs merge=lfs -text
|
| 1679 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/vcasand.lib filter=lfs diff=lfs merge=lfs -text
|
| 1680 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/vccorlib.lib filter=lfs diff=lfs merge=lfs -text
|
| 1681 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/vccorlibd.lib filter=lfs diff=lfs merge=lfs -text
|
| 1682 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/vcruntime.lib filter=lfs diff=lfs merge=lfs -text
|
| 1683 |
+
msvc/VC/Tools/MSVC/14.50.35717/lib/x86/vcruntimed.lib filter=lfs diff=lfs merge=lfs -text
|
| 1684 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/atlprov.dll filter=lfs diff=lfs merge=lfs -text
|
| 1685 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/bscmake.exe filter=lfs diff=lfs merge=lfs -text
|
| 1686 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/c1.dll filter=lfs diff=lfs merge=lfs -text
|
| 1687 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/c1xx.dll filter=lfs diff=lfs merge=lfs -text
|
| 1688 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/c2.dll filter=lfs diff=lfs merge=lfs -text
|
| 1689 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/c2dd.dll filter=lfs diff=lfs merge=lfs -text
|
| 1690 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/cl.exe filter=lfs diff=lfs merge=lfs -text
|
| 1691 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/clang_rt.asan_dbg_dynamic-x86_64.dll filter=lfs diff=lfs merge=lfs -text
|
| 1692 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/clang_rt.asan_dbg_dynamic-x86_64.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1693 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/clang_rt.asan_dynamic-x86_64.dll filter=lfs diff=lfs merge=lfs -text
|
| 1694 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/clang_rt.asan_dynamic-x86_64.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1695 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/concrt140d.dll filter=lfs diff=lfs merge=lfs -text
|
| 1696 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/CppBuildInsights.dll filter=lfs diff=lfs merge=lfs -text
|
| 1697 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/d3dcompiler_47.dll filter=lfs diff=lfs merge=lfs -text
|
| 1698 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/dpcmi.dll filter=lfs diff=lfs merge=lfs -text
|
| 1699 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/ifc.exe filter=lfs diff=lfs merge=lfs -text
|
| 1700 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/KernelTraceControl.dll filter=lfs diff=lfs merge=lfs -text
|
| 1701 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/libomp140.x86_64.dll filter=lfs diff=lfs merge=lfs -text
|
| 1702 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/libomp140d.x86_64.dll filter=lfs diff=lfs merge=lfs -text
|
| 1703 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/link.exe filter=lfs diff=lfs merge=lfs -text
|
| 1704 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/llvm-symbolizer.exe filter=lfs diff=lfs merge=lfs -text
|
| 1705 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/Microsoft.Diagnostics.Tracing.EventSource.dll filter=lfs diff=lfs merge=lfs -text
|
| 1706 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/Microsoft.VisualStudio.Telemetry.dll filter=lfs diff=lfs merge=lfs -text
|
| 1707 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/ml64.exe filter=lfs diff=lfs merge=lfs -text
|
| 1708 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/msdia140.dll filter=lfs diff=lfs merge=lfs -text
|
| 1709 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/msobj140.dll filter=lfs diff=lfs merge=lfs -text
|
| 1710 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/mspdb140.dll filter=lfs diff=lfs merge=lfs -text
|
| 1711 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/mspdbcmf.exe filter=lfs diff=lfs merge=lfs -text
|
| 1712 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/mspdbcore.dll filter=lfs diff=lfs merge=lfs -text
|
| 1713 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/mspdbsrv.exe filter=lfs diff=lfs merge=lfs -text
|
| 1714 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/mspdbst.dll filter=lfs diff=lfs merge=lfs -text
|
| 1715 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/mspft140.dll filter=lfs diff=lfs merge=lfs -text
|
| 1716 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/msvcdis140.dll filter=lfs diff=lfs merge=lfs -text
|
| 1717 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/msvcp140.dll filter=lfs diff=lfs merge=lfs -text
|
| 1718 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/msvcp140d.dll filter=lfs diff=lfs merge=lfs -text
|
| 1719 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/msvcp140_2.dll filter=lfs diff=lfs merge=lfs -text
|
| 1720 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/msvcp140_2d.dll filter=lfs diff=lfs merge=lfs -text
|
| 1721 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/Newtonsoft.Json.dll filter=lfs diff=lfs merge=lfs -text
|
| 1722 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/nmake.exe filter=lfs diff=lfs merge=lfs -text
|
| 1723 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/System.Memory.dll filter=lfs diff=lfs merge=lfs -text
|
| 1724 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/tbbmalloc.dll filter=lfs diff=lfs merge=lfs -text
|
| 1725 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/vcamp140d.dll filter=lfs diff=lfs merge=lfs -text
|
| 1726 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/vccorlib140d.dll filter=lfs diff=lfs merge=lfs -text
|
| 1727 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/vcmeta.dll filter=lfs diff=lfs merge=lfs -text
|
| 1728 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/vcomp140d.dll filter=lfs diff=lfs merge=lfs -text
|
| 1729 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/vcperf.exe filter=lfs diff=lfs merge=lfs -text
|
| 1730 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/vcruntime140.dll filter=lfs diff=lfs merge=lfs -text
|
| 1731 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/vcruntime140d.dll filter=lfs diff=lfs merge=lfs -text
|
| 1732 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/atlprov.dll filter=lfs diff=lfs merge=lfs -text
|
| 1733 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/bscmake.exe filter=lfs diff=lfs merge=lfs -text
|
| 1734 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/c1.dll filter=lfs diff=lfs merge=lfs -text
|
| 1735 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/c1xx.dll filter=lfs diff=lfs merge=lfs -text
|
| 1736 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/c2.dll filter=lfs diff=lfs merge=lfs -text
|
| 1737 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/cl.exe filter=lfs diff=lfs merge=lfs -text
|
| 1738 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/clang_rt.asan_dbg_dynamic-i386.dll filter=lfs diff=lfs merge=lfs -text
|
| 1739 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/clang_rt.asan_dbg_dynamic-i386.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1740 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/clang_rt.asan_dynamic-i386.dll filter=lfs diff=lfs merge=lfs -text
|
| 1741 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/clang_rt.asan_dynamic-i386.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1742 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/concrt140d.dll filter=lfs diff=lfs merge=lfs -text
|
| 1743 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/d3dcompiler_47.dll filter=lfs diff=lfs merge=lfs -text
|
| 1744 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/dpcmi.dll filter=lfs diff=lfs merge=lfs -text
|
| 1745 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/ifc.exe filter=lfs diff=lfs merge=lfs -text
|
| 1746 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/libomp140.i386.dll filter=lfs diff=lfs merge=lfs -text
|
| 1747 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/libomp140d.i386.dll filter=lfs diff=lfs merge=lfs -text
|
| 1748 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/link.exe filter=lfs diff=lfs merge=lfs -text
|
| 1749 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/llvm-symbolizer.exe filter=lfs diff=lfs merge=lfs -text
|
| 1750 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/Microsoft.Diagnostics.Tracing.EventSource.dll filter=lfs diff=lfs merge=lfs -text
|
| 1751 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/Microsoft.VisualStudio.Telemetry.dll filter=lfs diff=lfs merge=lfs -text
|
| 1752 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/ml.exe filter=lfs diff=lfs merge=lfs -text
|
| 1753 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/msdia140.dll filter=lfs diff=lfs merge=lfs -text
|
| 1754 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/msobj140.dll filter=lfs diff=lfs merge=lfs -text
|
| 1755 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/mspdb140.dll filter=lfs diff=lfs merge=lfs -text
|
| 1756 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/mspdbcmf.exe filter=lfs diff=lfs merge=lfs -text
|
| 1757 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/mspdbcore.dll filter=lfs diff=lfs merge=lfs -text
|
| 1758 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/mspdbsrv.exe filter=lfs diff=lfs merge=lfs -text
|
| 1759 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/mspdbst.dll filter=lfs diff=lfs merge=lfs -text
|
| 1760 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/mspft140.dll filter=lfs diff=lfs merge=lfs -text
|
| 1761 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/msvcdis140.dll filter=lfs diff=lfs merge=lfs -text
|
| 1762 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/msvcp140.dll filter=lfs diff=lfs merge=lfs -text
|
| 1763 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/msvcp140d.dll filter=lfs diff=lfs merge=lfs -text
|
| 1764 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/msvcp140_2.dll filter=lfs diff=lfs merge=lfs -text
|
| 1765 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/msvcp140_2d.dll filter=lfs diff=lfs merge=lfs -text
|
| 1766 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/Newtonsoft.Json.dll filter=lfs diff=lfs merge=lfs -text
|
| 1767 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/nmake.exe filter=lfs diff=lfs merge=lfs -text
|
| 1768 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/System.Memory.dll filter=lfs diff=lfs merge=lfs -text
|
| 1769 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/tbbmalloc.dll filter=lfs diff=lfs merge=lfs -text
|
| 1770 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/vcamp140d.dll filter=lfs diff=lfs merge=lfs -text
|
| 1771 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/vccorlib140d.dll filter=lfs diff=lfs merge=lfs -text
|
| 1772 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/vcmeta.dll filter=lfs diff=lfs merge=lfs -text
|
| 1773 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/vcomp140d.dll filter=lfs diff=lfs merge=lfs -text
|
| 1774 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/vcruntime140.dll filter=lfs diff=lfs merge=lfs -text
|
| 1775 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/vcruntime140d.dll filter=lfs diff=lfs merge=lfs -text
|
| 1776 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/1033/clui.dll filter=lfs diff=lfs merge=lfs -text
|
| 1777 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/1033/linkui.dll filter=lfs diff=lfs merge=lfs -text
|
| 1778 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x86/1033/mspft140ui.dll filter=lfs diff=lfs merge=lfs -text
|
| 1779 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/1033/clui.dll filter=lfs diff=lfs merge=lfs -text
|
| 1780 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/1033/linkui.dll filter=lfs diff=lfs merge=lfs -text
|
| 1781 |
+
msvc/VC/Tools/MSVC/14.50.35717/bin/Hostx64/x64/1033/mspft140ui.dll filter=lfs diff=lfs merge=lfs -text
|
| 1782 |
+
msbuild_packages/Microsoft.Build.17.10.4/Microsoft.Build.17.10.4.nupkg filter=lfs diff=lfs merge=lfs -text
|
| 1783 |
+
msbuild_packages/Microsoft.Build.Framework.17.10.4/Microsoft.Build.Framework.17.10.4.nupkg filter=lfs diff=lfs merge=lfs -text
|
| 1784 |
+
msbuild_packages/Microsoft.Build.Runtime.17.10.4/Microsoft.Build.Runtime.17.10.4.nupkg filter=lfs diff=lfs merge=lfs -text
|
| 1785 |
+
msbuild_packages/Microsoft.Build.Tasks.Core.17.10.4/Microsoft.Build.Tasks.Core.17.10.4.nupkg filter=lfs diff=lfs merge=lfs -text
|
| 1786 |
+
msbuild_packages/Microsoft.Build.Utilities.Core.17.10.4/Microsoft.Build.Utilities.Core.17.10.4.nupkg filter=lfs diff=lfs merge=lfs -text
|
| 1787 |
+
msbuild_packages/Microsoft.IO.Redist.6.0.0/Microsoft.IO.Redist.6.0.0.nupkg filter=lfs diff=lfs merge=lfs -text
|
| 1788 |
+
msbuild_packages/Microsoft.NET.StringTools.17.10.4/Microsoft.NET.StringTools.17.10.4.nupkg filter=lfs diff=lfs merge=lfs -text
|
| 1789 |
+
msbuild_packages/System.Collections.Immutable.8.0.0/System.Collections.Immutable.8.0.0.nupkg filter=lfs diff=lfs merge=lfs -text
|
| 1790 |
+
msbuild_packages/System.Configuration.ConfigurationManager.8.0.0/System.Configuration.ConfigurationManager.8.0.0.nupkg filter=lfs diff=lfs merge=lfs -text
|
| 1791 |
+
msbuild_packages/System.Memory.4.5.5/System.Memory.4.5.5.nupkg filter=lfs diff=lfs merge=lfs -text
|
| 1792 |
+
msbuild_packages/System.Numerics.Vectors.4.5.0/System.Numerics.Vectors.4.5.0.nupkg filter=lfs diff=lfs merge=lfs -text
|
| 1793 |
+
msbuild_packages/System.Reflection.Metadata.8.0.0/System.Reflection.Metadata.8.0.0.nupkg filter=lfs diff=lfs merge=lfs -text
|
| 1794 |
+
msbuild_packages/System.Reflection.MetadataLoadContext.8.0.0/System.Reflection.MetadataLoadContext.8.0.0.nupkg filter=lfs diff=lfs merge=lfs -text
|
| 1795 |
+
msbuild_packages/System.Resources.Extensions.8.0.0/System.Resources.Extensions.8.0.0.nupkg filter=lfs diff=lfs merge=lfs -text
|
| 1796 |
+
msbuild_packages/System.Security.Principal.Windows.5.0.0/System.Security.Principal.Windows.5.0.0.nupkg filter=lfs diff=lfs merge=lfs -text
|
| 1797 |
+
msbuild_packages/System.Text.Encodings.Web.8.0.0/System.Text.Encodings.Web.8.0.0.nupkg filter=lfs diff=lfs merge=lfs -text
|
| 1798 |
+
msbuild_packages/System.Text.Json.8.0.0/System.Text.Json.8.0.0.nupkg filter=lfs diff=lfs merge=lfs -text
|
| 1799 |
+
msbuild_packages/System.Threading.Tasks.Dataflow.8.0.0/System.Threading.Tasks.Dataflow.8.0.0.nupkg filter=lfs diff=lfs merge=lfs -text
|
| 1800 |
+
msbuild_packages/System.ValueTuple.4.5.0/System.ValueTuple.4.5.0.nupkg filter=lfs diff=lfs merge=lfs -text
|
| 1801 |
+
msbuild_packages/System.Threading.Tasks.Dataflow.8.0.0/lib/net462/System.Threading.Tasks.Dataflow.dll filter=lfs diff=lfs merge=lfs -text
|
| 1802 |
+
msbuild_packages/System.Threading.Tasks.Dataflow.8.0.0/lib/net6.0/System.Threading.Tasks.Dataflow.dll filter=lfs diff=lfs merge=lfs -text
|
| 1803 |
+
msbuild_packages/System.Threading.Tasks.Dataflow.8.0.0/lib/net7.0/System.Threading.Tasks.Dataflow.dll filter=lfs diff=lfs merge=lfs -text
|
| 1804 |
+
msbuild_packages/System.Threading.Tasks.Dataflow.8.0.0/lib/net8.0/System.Threading.Tasks.Dataflow.dll filter=lfs diff=lfs merge=lfs -text
|
| 1805 |
+
msbuild_packages/System.Threading.Tasks.Dataflow.8.0.0/lib/netstandard2.0/System.Threading.Tasks.Dataflow.dll filter=lfs diff=lfs merge=lfs -text
|
| 1806 |
+
msbuild_packages/System.Threading.Tasks.Dataflow.8.0.0/lib/netstandard2.1/System.Threading.Tasks.Dataflow.dll filter=lfs diff=lfs merge=lfs -text
|
| 1807 |
+
msbuild_packages/System.Text.Json.8.0.0/lib/net462/System.Text.Json.dll filter=lfs diff=lfs merge=lfs -text
|
| 1808 |
+
msbuild_packages/System.Text.Json.8.0.0/lib/net6.0/System.Text.Json.dll filter=lfs diff=lfs merge=lfs -text
|
| 1809 |
+
msbuild_packages/System.Text.Json.8.0.0/lib/net7.0/System.Text.Json.dll filter=lfs diff=lfs merge=lfs -text
|
| 1810 |
+
msbuild_packages/System.Text.Json.8.0.0/lib/net8.0/System.Text.Json.dll filter=lfs diff=lfs merge=lfs -text
|
| 1811 |
+
msbuild_packages/System.Text.Json.8.0.0/lib/netstandard2.0/System.Text.Json.dll filter=lfs diff=lfs merge=lfs -text
|
| 1812 |
+
msbuild_packages/System.Text.Json.8.0.0/analyzers/dotnet/roslyn4.4/cs/System.Text.Json.SourceGeneration.dll filter=lfs diff=lfs merge=lfs -text
|
| 1813 |
+
msbuild_packages/System.Text.Json.8.0.0/analyzers/dotnet/roslyn4.0/cs/System.Text.Json.SourceGeneration.dll filter=lfs diff=lfs merge=lfs -text
|
| 1814 |
+
msbuild_packages/System.Text.Json.8.0.0/analyzers/dotnet/roslyn3.11/cs/System.Text.Json.SourceGeneration.dll filter=lfs diff=lfs merge=lfs -text
|
| 1815 |
+
msbuild_packages/System.Reflection.MetadataLoadContext.8.0.0/lib/net462/System.Reflection.MetadataLoadContext.dll filter=lfs diff=lfs merge=lfs -text
|
| 1816 |
+
msbuild_packages/System.Reflection.MetadataLoadContext.8.0.0/lib/net6.0/System.Reflection.MetadataLoadContext.dll filter=lfs diff=lfs merge=lfs -text
|
| 1817 |
+
msbuild_packages/System.Reflection.MetadataLoadContext.8.0.0/lib/net7.0/System.Reflection.MetadataLoadContext.dll filter=lfs diff=lfs merge=lfs -text
|
| 1818 |
+
msbuild_packages/System.Reflection.MetadataLoadContext.8.0.0/lib/net8.0/System.Reflection.MetadataLoadContext.dll filter=lfs diff=lfs merge=lfs -text
|
| 1819 |
+
msbuild_packages/System.Reflection.MetadataLoadContext.8.0.0/lib/netstandard2.0/System.Reflection.MetadataLoadContext.dll filter=lfs diff=lfs merge=lfs -text
|
| 1820 |
+
msbuild_packages/System.Reflection.Metadata.8.0.0/lib/net462/System.Reflection.Metadata.dll filter=lfs diff=lfs merge=lfs -text
|
| 1821 |
+
msbuild_packages/System.Reflection.Metadata.8.0.0/lib/net6.0/System.Reflection.Metadata.dll filter=lfs diff=lfs merge=lfs -text
|
| 1822 |
+
msbuild_packages/System.Reflection.Metadata.8.0.0/lib/net7.0/System.Reflection.Metadata.dll filter=lfs diff=lfs merge=lfs -text
|
| 1823 |
+
msbuild_packages/System.Reflection.Metadata.8.0.0/lib/net8.0/System.Reflection.Metadata.dll filter=lfs diff=lfs merge=lfs -text
|
| 1824 |
+
msbuild_packages/System.Reflection.Metadata.8.0.0/lib/netstandard2.0/System.Reflection.Metadata.dll filter=lfs diff=lfs merge=lfs -text
|
| 1825 |
+
msbuild_packages/System.Numerics.Vectors.4.5.0/lib/net46/System.Numerics.Vectors.dll filter=lfs diff=lfs merge=lfs -text
|
| 1826 |
+
msbuild_packages/System.Numerics.Vectors.4.5.0/lib/netstandard1.0/System.Numerics.Vectors.dll filter=lfs diff=lfs merge=lfs -text
|
| 1827 |
+
msbuild_packages/System.Numerics.Vectors.4.5.0/lib/netstandard2.0/System.Numerics.Vectors.dll filter=lfs diff=lfs merge=lfs -text
|
| 1828 |
+
msbuild_packages/System.Numerics.Vectors.4.5.0/lib/portable-net45+win8+wp8+wpa81/System.Numerics.Vectors.dll filter=lfs diff=lfs merge=lfs -text
|
| 1829 |
+
msbuild_packages/System.Memory.4.5.5/lib/net461/System.Memory.dll filter=lfs diff=lfs merge=lfs -text
|
| 1830 |
+
msbuild_packages/System.Memory.4.5.5/lib/netstandard1.1/System.Memory.dll filter=lfs diff=lfs merge=lfs -text
|
| 1831 |
+
msbuild_packages/System.Memory.4.5.5/lib/netstandard2.0/System.Memory.dll filter=lfs diff=lfs merge=lfs -text
|
| 1832 |
+
msbuild_packages/System.Configuration.ConfigurationManager.8.0.0/lib/net6.0/System.Configuration.ConfigurationManager.dll filter=lfs diff=lfs merge=lfs -text
|
| 1833 |
+
msbuild_packages/System.Configuration.ConfigurationManager.8.0.0/lib/net7.0/System.Configuration.ConfigurationManager.dll filter=lfs diff=lfs merge=lfs -text
|
| 1834 |
+
msbuild_packages/System.Configuration.ConfigurationManager.8.0.0/lib/net8.0/System.Configuration.ConfigurationManager.dll filter=lfs diff=lfs merge=lfs -text
|
| 1835 |
+
msbuild_packages/System.Configuration.ConfigurationManager.8.0.0/lib/netstandard2.0/System.Configuration.ConfigurationManager.dll filter=lfs diff=lfs merge=lfs -text
|
| 1836 |
+
msbuild_packages/System.Collections.Immutable.8.0.0/lib/net462/System.Collections.Immutable.dll filter=lfs diff=lfs merge=lfs -text
|
| 1837 |
+
msbuild_packages/System.Collections.Immutable.8.0.0/lib/net6.0/System.Collections.Immutable.dll filter=lfs diff=lfs merge=lfs -text
|
| 1838 |
+
msbuild_packages/System.Collections.Immutable.8.0.0/lib/net7.0/System.Collections.Immutable.dll filter=lfs diff=lfs merge=lfs -text
|
| 1839 |
+
msbuild_packages/System.Collections.Immutable.8.0.0/lib/net8.0/System.Collections.Immutable.dll filter=lfs diff=lfs merge=lfs -text
|
| 1840 |
+
msbuild_packages/System.Collections.Immutable.8.0.0/lib/netstandard2.0/System.Collections.Immutable.dll filter=lfs diff=lfs merge=lfs -text
|
| 1841 |
+
msbuild_packages/Microsoft.IO.Redist.6.0.0/lib/net472/Microsoft.IO.Redist.dll filter=lfs diff=lfs merge=lfs -text
|
| 1842 |
+
msbuild_packages/Microsoft.Build.Utilities.Core.17.10.4/ref/net472/Microsoft.Build.Utilities.Core.dll filter=lfs diff=lfs merge=lfs -text
|
| 1843 |
+
msbuild_packages/Microsoft.Build.Utilities.Core.17.10.4/ref/net8.0/Microsoft.Build.Utilities.Core.dll filter=lfs diff=lfs merge=lfs -text
|
| 1844 |
+
msbuild_packages/Microsoft.Build.Utilities.Core.17.10.4/lib/net472/Microsoft.Build.Utilities.Core.dll filter=lfs diff=lfs merge=lfs -text
|
| 1845 |
+
msbuild_packages/Microsoft.Build.Utilities.Core.17.10.4/lib/net472/Microsoft.Build.Utilities.Core.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1846 |
+
msbuild_packages/Microsoft.Build.Utilities.Core.17.10.4/lib/net8.0/Microsoft.Build.Utilities.Core.dll filter=lfs diff=lfs merge=lfs -text
|
| 1847 |
+
msbuild_packages/Microsoft.Build.Utilities.Core.17.10.4/lib/net8.0/Microsoft.Build.Utilities.Core.pdb filter=lfs diff=lfs merge=lfs -text
|
| 1848 |
+
msbuild_packages/Microsoft.Build.Tasks.Core.17.10.4/ref/net472/Microsoft.Build.Tasks.Core.dll filter=lfs diff=lfs merge=lfs -text
|
| 1849 |
+
msbuild_packages/Microsoft.Build.Tasks.Core.17.10.4/ref/net8.0/Microsoft.Build.Tasks.Core.dll filter=lfs diff=lfs merge=lfs -text
|
micromamba_root/Lib/_pyrepl/__pycache__/__init__.cpython-314.pyc
ADDED
|
Binary file (122 Bytes). View file
|
|
|
micromamba_root/Lib/_pyrepl/__pycache__/__main__.cpython-314.pyc
ADDED
|
Binary file (311 Bytes). View file
|
|
|
micromamba_root/Lib/_pyrepl/__pycache__/_module_completer.cpython-314.pyc
ADDED
|
Binary file (28.9 kB). View file
|
|
|
micromamba_root/Lib/_pyrepl/__pycache__/_threading_handler.cpython-314.pyc
ADDED
|
Binary file (6.48 kB). View file
|
|
|
micromamba_root/Lib/_pyrepl/__pycache__/historical_reader.cpython-314.pyc
ADDED
|
Binary file (26.2 kB). View file
|
|
|
micromamba_root/Lib/_pyrepl/__pycache__/input.cpython-314.pyc
ADDED
|
Binary file (4.61 kB). View file
|
|
|
micromamba_root/Lib/_pyrepl/__pycache__/keymap.cpython-314.pyc
ADDED
|
Binary file (7.24 kB). View file
|
|
|
micromamba_root/Lib/_pyrepl/__pycache__/main.cpython-314.pyc
ADDED
|
Binary file (3.08 kB). View file
|
|
|
micromamba_root/Lib/_pyrepl/__pycache__/pager.cpython-314.pyc
ADDED
|
Binary file (11.5 kB). View file
|
|
|
micromamba_root/Lib/_pyrepl/__pycache__/reader.cpython-314.pyc
ADDED
|
Binary file (39.6 kB). View file
|
|
|
micromamba_root/Lib/_pyrepl/__pycache__/readline.cpython-314.pyc
ADDED
|
Binary file (34.8 kB). View file
|
|
|
micromamba_root/Lib/_pyrepl/__pycache__/simple_interact.cpython-314.pyc
ADDED
|
Binary file (8.64 kB). View file
|
|
|
micromamba_root/Lib/_pyrepl/__pycache__/terminfo.cpython-314.pyc
ADDED
|
Binary file (18.1 kB). View file
|
|
|
micromamba_root/Lib/_pyrepl/__pycache__/trace.cpython-314.pyc
ADDED
|
Binary file (1.7 kB). View file
|
|
|
micromamba_root/Lib/_pyrepl/__pycache__/types.cpython-314.pyc
ADDED
|
Binary file (1.77 kB). View file
|
|
|
micromamba_root/Lib/_pyrepl/__pycache__/unix_console.cpython-314.pyc
ADDED
|
Binary file (41.3 kB). View file
|
|
|
micromamba_root/Lib/_pyrepl/__pycache__/unix_eventqueue.cpython-314.pyc
ADDED
|
Binary file (2.9 kB). View file
|
|
|
micromamba_root/Lib/_pyrepl/__pycache__/utils.cpython-314.pyc
ADDED
|
Binary file (22 kB). View file
|
|
|
micromamba_root/Lib/_pyrepl/__pycache__/windows_console.cpython-314.pyc
ADDED
|
Binary file (33.1 kB). View file
|
|
|
micromamba_root/Lib/_pyrepl/__pycache__/windows_eventqueue.cpython-314.pyc
ADDED
|
Binary file (2.04 kB). View file
|
|
|
micromamba_root/Lib/site-packages/babel-2.18.0.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
conda
|
micromamba_root/Lib/site-packages/babel-2.18.0.dist-info/METADATA
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.4
|
| 2 |
+
Name: babel
|
| 3 |
+
Version: 2.18.0
|
| 4 |
+
Summary: Internationalization utilities
|
| 5 |
+
Home-page: https://babel.pocoo.org/
|
| 6 |
+
Author: Armin Ronacher
|
| 7 |
+
Author-email: armin.ronacher@active-4.com
|
| 8 |
+
Maintainer: Aarni Koskela
|
| 9 |
+
Maintainer-email: akx@iki.fi
|
| 10 |
+
License: BSD-3-Clause
|
| 11 |
+
Project-URL: Source, https://github.com/python-babel/babel
|
| 12 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 13 |
+
Classifier: Environment :: Web Environment
|
| 14 |
+
Classifier: Intended Audience :: Developers
|
| 15 |
+
Classifier: License :: OSI Approved :: BSD License
|
| 16 |
+
Classifier: Operating System :: OS Independent
|
| 17 |
+
Classifier: Programming Language :: Python
|
| 18 |
+
Classifier: Programming Language :: Python :: 3
|
| 19 |
+
Classifier: Programming Language :: Python :: 3 :: Only
|
| 20 |
+
Classifier: Programming Language :: Python :: 3.8
|
| 21 |
+
Classifier: Programming Language :: Python :: 3.9
|
| 22 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 23 |
+
Classifier: Programming Language :: Python :: 3.11
|
| 24 |
+
Classifier: Programming Language :: Python :: 3.12
|
| 25 |
+
Classifier: Programming Language :: Python :: 3.13
|
| 26 |
+
Classifier: Programming Language :: Python :: 3.14
|
| 27 |
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
| 28 |
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
| 29 |
+
Classifier: Topic :: Software Development :: Internationalization
|
| 30 |
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
| 31 |
+
Requires-Python: >=3.8
|
| 32 |
+
License-File: LICENSE
|
| 33 |
+
Requires-Dist: pytz>=2015.7; python_version < "3.9"
|
| 34 |
+
Provides-Extra: dev
|
| 35 |
+
Requires-Dist: tzdata; sys_platform == "win32" and extra == "dev"
|
| 36 |
+
Requires-Dist: backports.zoneinfo; python_version < "3.9" and extra == "dev"
|
| 37 |
+
Requires-Dist: freezegun~=1.0; extra == "dev"
|
| 38 |
+
Requires-Dist: jinja2>=3.0; extra == "dev"
|
| 39 |
+
Requires-Dist: pytest-cov; extra == "dev"
|
| 40 |
+
Requires-Dist: pytest>=6.0; extra == "dev"
|
| 41 |
+
Requires-Dist: pytz; extra == "dev"
|
| 42 |
+
Requires-Dist: setuptools; extra == "dev"
|
| 43 |
+
Dynamic: author
|
| 44 |
+
Dynamic: author-email
|
| 45 |
+
Dynamic: classifier
|
| 46 |
+
Dynamic: description
|
| 47 |
+
Dynamic: home-page
|
| 48 |
+
Dynamic: license
|
| 49 |
+
Dynamic: license-file
|
| 50 |
+
Dynamic: maintainer
|
| 51 |
+
Dynamic: maintainer-email
|
| 52 |
+
Dynamic: project-url
|
| 53 |
+
Dynamic: provides-extra
|
| 54 |
+
Dynamic: requires-dist
|
| 55 |
+
Dynamic: requires-python
|
| 56 |
+
Dynamic: summary
|
| 57 |
+
|
| 58 |
+
A collection of tools for internationalizing Python applications.
|
micromamba_root/Lib/site-packages/babel-2.18.0.dist-info/RECORD
ADDED
|
@@ -0,0 +1,1150 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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fwYGOYMi5Jhw2fU4yNgwErybb2IX5PEwBKV4ZbdBo,91
|
| 7 |
+
babel-2.18.0.dist-info/direct_url.json,sha256=PSEpCxSPo_CL_hMuFsCx0VuaPJYDtmtFh5ZI2tFfq0s,116
|
| 8 |
+
babel-2.18.0.dist-info/entry_points.txt,sha256=Y2Cr1P3E8Yt7kqzvVz4wnTvD1H3-BVD4FOkVqHIGBfc,750
|
| 9 |
+
babel-2.18.0.dist-info/licenses/LICENSE,sha256=hrrVdYx4WboGJR-PEu7oheyjE2mSPfsrh6fBPDY02HA,1531
|
| 10 |
+
babel-2.18.0.dist-info/top_level.txt,sha256=mQO3vNkqlcYs_xRaL5EpRIy1IRjMp4N9_vdwmiemPXo,6
|
| 11 |
+
babel/__init__.py,sha256=iAtaegCgnkkqd3t4mTON700DPw6YvOeVn-zdWKrGhEM,838
|
| 12 |
+
babel/__pycache__/__init__.cpython-310.pyc,,
|
| 13 |
+
babel/__pycache__/core.cpython-310.pyc,,
|
| 14 |
+
babel/__pycache__/dates.cpython-310.pyc,,
|
| 15 |
+
babel/__pycache__/languages.cpython-310.pyc,,
|
| 16 |
+
babel/__pycache__/lists.cpython-310.pyc,,
|
| 17 |
+
babel/__pycache__/localedata.cpython-310.pyc,,
|
| 18 |
+
babel/__pycache__/numbers.cpython-310.pyc,,
|
| 19 |
+
babel/__pycache__/plural.cpython-310.pyc,,
|
| 20 |
+
babel/__pycache__/support.cpython-310.pyc,,
|
| 21 |
+
babel/__pycache__/units.cpython-310.pyc,,
|
| 22 |
+
babel/__pycache__/util.cpython-310.pyc,,
|
| 23 |
+
babel/core.py,sha256=47mzcxFpj3j16ZV7VhvZOdJQWBo4rlutQBD0oqM6G7g,45775
|
| 24 |
+
babel/dates.py,sha256=jRsuCS09RAsW8gqixQk23Ffn69FieZU85fDNTiAzL-8,76060
|
| 25 |
+
babel/global.dat,sha256=o4ncdOHrpbYBw8e0F8jQe55B8Zk3DRDMLMcMdxdxFW4,461219
|
| 26 |
+
babel/languages.py,sha256=vySUM88KPgjZIfp8F98rzg0eBWUxBp4VSv3daVZzQrI,2866
|
| 27 |
+
babel/lists.py,sha256=AGtv7uAV6lz4bs4F9OBZ1zcMctNsC_w8_ClJJT7D4LA,4380
|
| 28 |
+
babel/locale-data/LICENSE.unicode,sha256=tMCujvBPcFn5bOW74EZ_n-b22Bu-E1F3Ad_rlh-00LY,2033
|
| 29 |
+
babel/locale-data/aa.dat,sha256=CI5kOVaXWX2CQoHT6AXhrOMwFPCiQyd7Wke2QBJ1UtE,2795
|
| 30 |
+
babel/locale-data/aa_DJ.dat,sha256=VKjSgKVsftG91nj0-AQMYFuF_p4YAGfRkgAvycB2EYU,1112
|
| 31 |
+
babel/locale-data/aa_ER.dat,sha256=6b6qROwoeOq0-batM1Z7Ji2gvGDogl3ODcftt1Jkm9g,637
|
| 32 |
+
babel/locale-data/aa_ET.dat,sha256=piwFu94H7e-jPwd4ZaWiDc-j2nAH_GiC5UZ2IxMx7bs,635
|
| 33 |
+
babel/locale-data/ab.dat,sha256=xeio1NLBNIAXcafnonWjO3w0zofwM-aKr0-RiaL7pRQ,95311
|
| 34 |
+
babel/locale-data/ab_GE.dat,sha256=b5be2Uv1YtP-bkMasJMzoQPxJPNLFqifXnCiK8rCyLE,635
|
| 35 |
+
babel/locale-data/af.dat,sha256=pO9_3BpJSQAJ3gZ_j6ZdUpGq3zqEv6CIZZ-CpJTXwr4,144732
|
| 36 |
+
babel/locale-data/af_NA.dat,sha256=zif__TyNY44mSCYOCrrglsyr_H31JhBNPwSJftg8200,1450
|
| 37 |
+
babel/locale-data/af_ZA.dat,sha256=6lT-mLg7LRtyAEhWhiF2xVtiPyzEa28U6hsFw_BMrZE,635
|
| 38 |
+
babel/locale-data/agq.dat,sha256=JJbF6NFR9qwwQTrIyrLh04DFJniIqDuFsbmHDGu5ThM,16628
|
| 39 |
+
babel/locale-data/agq_CM.dat,sha256=hYtg7pRw7J6TsYHvhlEEv7DqpyXoK3KS9DAqtYtgBX0,636
|
| 40 |
+
babel/locale-data/ak.dat,sha256=L73y_ylhZy39SlEaAwA4jCqP_92qLvIlsagl-o2RlKE,116224
|
| 41 |
+
babel/locale-data/ak_GH.dat,sha256=tM-OSpXWyBwZFfKPVStWBbFv3dwNj_7AqcBz4ONrOQs,616
|
| 42 |
+
babel/locale-data/am.dat,sha256=TddfeRISFvzjTFpB-vH3gjSKs2r8iT3CYckrriibXZY,173260
|
| 43 |
+
babel/locale-data/am_ET.dat,sha256=2VZDSh5bY9vLLuTqcKYG66p5OYlvPRPX58rpNTFWPok,635
|
| 44 |
+
babel/locale-data/an.dat,sha256=a1gEztcqWoMLW3f5_jlDxcPsYY-ItHKVud7gjisrS4E,28050
|
| 45 |
+
babel/locale-data/an_ES.dat,sha256=rQuq-zKj7-fCjY-5fGGoGJT1x60pAyCEAVEswXPnHrI,653
|
| 46 |
+
babel/locale-data/ann.dat,sha256=fUenvOdPjqayLEiVDRNncK8SOBi9gAGAdxMuOATlsI0,737
|
| 47 |
+
babel/locale-data/ann_NG.dat,sha256=0i2K6cv6eCurgFgwtiCr09hYwZCA1kHkQaKnDyCD86M,617
|
| 48 |
+
babel/locale-data/apc.dat,sha256=G96W-ebLqQlTuPN3-VqSfAY-GF0K99c6uXHza5f4e2g,1564
|
| 49 |
+
babel/locale-data/apc_SY.dat,sha256=tagFeQz8BA9Pc7RMqkce1ZalfKIBjqg0SR4NlpGQaaM,679
|
| 50 |
+
babel/locale-data/ar.dat,sha256=yAijlkkaH-RgRQidvCyNBkpi9Z7OTC9cNfIbKo4n4gk,288582
|
| 51 |
+
babel/locale-data/ar_001.dat,sha256=hRKDI3wzxO5T191MfSdCn_MZ6ckM2Rz_r__0JZqS00s,1707
|
| 52 |
+
babel/locale-data/ar_AE.dat,sha256=hEbIYUoNE5mRLOVXhmkGsvT0NAcq-rxs51VIMMzG9LY,982
|
| 53 |
+
babel/locale-data/ar_BH.dat,sha256=FoQ2c3E3TDqKcioarWBvLi_MllJmSd_56r0U45_gHWw,720
|
| 54 |
+
babel/locale-data/ar_DJ.dat,sha256=qbNam_QAmhobsIUfJLCL9pe146SvcmNIE_L3cWpmkBs,698
|
| 55 |
+
babel/locale-data/ar_DZ.dat,sha256=_Y-JLC5hincnxze7sGmEpb7N4JnBh7LdFdaVPcSMDvM,1263
|
| 56 |
+
babel/locale-data/ar_EG.dat,sha256=qE3gLQ6BzLaBOPNJVgaBhPQiIL2kQ4AiD_jLl7o52IM,720
|
| 57 |
+
babel/locale-data/ar_EH.dat,sha256=a0xJdGJYzGFzfvwxZVDP7yURlTm93FQSTQ5qp3XDMYo,658
|
| 58 |
+
babel/locale-data/ar_ER.dat,sha256=l-WjJfxm7kP05-Hnr5PingHaKWJ46ScfW4KEBcwD5HM,679
|
| 59 |
+
babel/locale-data/ar_IL.dat,sha256=O3UYAjf4BB3NdcSQTn-RzNjyj4kzTBhX3q7E8-9Aihw,1264
|
| 60 |
+
babel/locale-data/ar_IQ.dat,sha256=7-DnoHqsoBDe-ZXe0rIcEotb-F_CFyChc73dwnXuUoE,1975
|
| 61 |
+
babel/locale-data/ar_JO.dat,sha256=hT1z-Me5SOjul3BHFubcqlyEk9H57fwD4EFENddiVt8,1398
|
| 62 |
+
babel/locale-data/ar_KM.dat,sha256=Zx5XtfTuRPiW6iViOjeal_Fq-18EA7GuERViMP1_mc4,1230
|
| 63 |
+
babel/locale-data/ar_KW.dat,sha256=1wSXHTcgFKwhNciVS8IvGKvkzzqOIMBFykEJEQXdhEE,720
|
| 64 |
+
babel/locale-data/ar_LB.dat,sha256=-SuXO6LdhXNi4f_PHNrlxl8iXX47perQ_oS19bwRGpI,1414
|
| 65 |
+
babel/locale-data/ar_LY.dat,sha256=2OxSGD1gkiWPcaRHd1qQv9ifG82WEjGahKqhsoFXfnY,1249
|
| 66 |
+
babel/locale-data/ar_MA.dat,sha256=hTOwsXC8tsJxBVlksxmAMlIkn4kK50juJa6TuAPFkp0,1559
|
| 67 |
+
babel/locale-data/ar_MR.dat,sha256=Kq7uT5LxvYXnGWz-cVcI6yDNximu9hZIpoKydmVse78,1359
|
| 68 |
+
babel/locale-data/ar_OM.dat,sha256=HVOqTfoH3JVTHJL-yDBiIafNfckU7CIcO_sIzXBffKw,720
|
| 69 |
+
babel/locale-data/ar_PS.dat,sha256=F-HZRPcMe_tJ8r9V01h-7mQ0UKQxQmuWuXNSi94MVMM,1336
|
| 70 |
+
babel/locale-data/ar_QA.dat,sha256=UKfLpyX856fNgeifdr22wXpDncirWJi9NxqfSnS-7fw,720
|
| 71 |
+
babel/locale-data/ar_SA.dat,sha256=8WE8HwCwO-OT_G2JBSgmPWSzyHOdIA3zajXPbBZr2Tg,24787
|
| 72 |
+
babel/locale-data/ar_SD.dat,sha256=f7aUKlrKmmC7ijTjVwn5r9m3mfZfEob1a7GHVCj4Qxk,720
|
| 73 |
+
babel/locale-data/ar_SO.dat,sha256=4LD_gds2VsvxdFHpFo56CxTFenzNdvEkMofc4oTGBTU,677
|
| 74 |
+
babel/locale-data/ar_SS.dat,sha256=T6eeWPeFejmBC7InKqg-6qmWoer1vjl6srHe_5ybkDU,700
|
| 75 |
+
babel/locale-data/ar_SY.dat,sha256=u42uhje_zt806WlUMpp5sIdi1yjw3Yv7vYbl6aELsyc,1398
|
| 76 |
+
babel/locale-data/ar_TD.dat,sha256=OG7NYtRrJiDeRt7HP-B4ta5ri-6fdSnYomppfy2A4ec,658
|
| 77 |
+
babel/locale-data/ar_TN.dat,sha256=xO974NyO5T-pRs-5b55sfQFGIwU2Y4q3VQUeqtqWf80,1201
|
| 78 |
+
babel/locale-data/ar_YE.dat,sha256=vu8wYJgzcJ1douKfKLx3-hAg1sjndD5_PTHWG_bzRL0,720
|
| 79 |
+
babel/locale-data/arn.dat,sha256=JB-QfwCOVQbVrLRlq2LMxU6SHO-V4ZaU2_0W15-0Rfs,721
|
| 80 |
+
babel/locale-data/arn_CL.dat,sha256=cf_JrdIAxFwbltVwtloNC9527Du7zaoBDM-_KmctSvE,636
|
| 81 |
+
babel/locale-data/as.dat,sha256=xoTmhieoAVjw59h2-_pLp0wjfZPVvYMV6qDSJjLrjq8,209876
|
| 82 |
+
babel/locale-data/as_IN.dat,sha256=bE-OZ0Y3d2-QtD23ztjluSsFk1_RFNYMFzKgBC3waw4,658
|
| 83 |
+
babel/locale-data/asa.dat,sha256=zzPu7L8RV8SVEKqeRiGIoWLBCJkeS0acDh0pYq87qMI,15492
|
| 84 |
+
babel/locale-data/asa_TZ.dat,sha256=U0GU10aP58LxCeqyjl69RQCZi_6tTQxm2vni6XVkoqY,617
|
| 85 |
+
babel/locale-data/ast.dat,sha256=_Qeoc0gz1ag9MkmNIuv4ufVjk0fH5xtW4M7vp8ST4hY,168961
|
| 86 |
+
babel/locale-data/ast_ES.dat,sha256=51kFxigV5COuiPiNisp-OBFYMith5rUgBmU48rGk7Hc,654
|
| 87 |
+
babel/locale-data/az.dat,sha256=2EcwMc8qIqCW_F0Ic2XjFQthkCGyfLNzJzJZU99ZcaA,173802
|
| 88 |
+
babel/locale-data/az_Arab.dat,sha256=IGBla73oKavlLHhtIW37idHxTkmQWZ-S8NE54b65d4k,7499
|
| 89 |
+
babel/locale-data/az_Arab_IQ.dat,sha256=VsM0-KQPCP4MUw-2wMsBv-F467cr2Bup3jfxx8Fc3ZE,678
|
| 90 |
+
babel/locale-data/az_Arab_IR.dat,sha256=ROb0gFTPwK5CcjpQMB7CJ662eld9sZj7IA6QMrvxgto,678
|
| 91 |
+
babel/locale-data/az_Arab_TR.dat,sha256=EV6cNf3keBNREHkfF98GGZGOZz4L5dxf8pFbujInaQY,635
|
| 92 |
+
babel/locale-data/az_Cyrl.dat,sha256=ru4QYee174toLQsGPJn-d6xe65FsLQ87vBV9AW0o4D8,35540
|
| 93 |
+
babel/locale-data/az_Cyrl_AZ.dat,sha256=GRZjR-gp6JYeLNxoiAKNdv9bkTmS1bpYnRJ0c9YIGws,635
|
| 94 |
+
babel/locale-data/az_Latn.dat,sha256=aK2ziytg5Ig6GYk9tVCq4BEyV6UYy9Ip7F1_i4Pq1jw,2258
|
| 95 |
+
babel/locale-data/az_Latn_AZ.dat,sha256=GRZjR-gp6JYeLNxoiAKNdv9bkTmS1bpYnRJ0c9YIGws,635
|
| 96 |
+
babel/locale-data/ba.dat,sha256=Ly1V4wBNM4KCDGtuy9oCug4fZzVNEFqXOI8XKhkWFOQ,732
|
| 97 |
+
babel/locale-data/ba_RU.dat,sha256=8YcwUOx3h4BcSfUIumKJ4wcFyiSgBM74SqenVIQUKi8,653
|
| 98 |
+
babel/locale-data/bal.dat,sha256=mYMTNzej_lac3GimNq9dYgLY3Q4RtXpEvUkQ-zfzVqw,12849
|
| 99 |
+
babel/locale-data/bal_Arab.dat,sha256=25CVl5rF7FqKEeHzAmt0BccVI_ODqmMP86KqQ4i6PL8,934
|
| 100 |
+
babel/locale-data/bal_Arab_PK.dat,sha256=sy4tpUtN1St5yFoTp8C6-vi2bFGPjSaG_zDbY16Q988,636
|
| 101 |
+
babel/locale-data/bal_Latn.dat,sha256=X9sEvC7SU0VUFnapzFKUq0nvc1az1c9lHmrCPHPCg4U,116909
|
| 102 |
+
babel/locale-data/bal_Latn_PK.dat,sha256=sy4tpUtN1St5yFoTp8C6-vi2bFGPjSaG_zDbY16Q988,636
|
| 103 |
+
babel/locale-data/bas.dat,sha256=hts2-gooZheGxndoyiVM9NwFrAitthfb4IPr7TtYb2U,16673
|
| 104 |
+
babel/locale-data/bas_CM.dat,sha256=WBq-_rOvkBnT5pBaCyq844LLSRReQzg2HM0u7GmhKKM,636
|
| 105 |
+
babel/locale-data/be.dat,sha256=8L6Q0C4wjbLMC9I7ltFoY1prATuRd-8nn0udprYBI6A,272322
|
| 106 |
+
babel/locale-data/be_BY.dat,sha256=yN4Rf2-HqinMscTfe4jKEYpsCEaddHce6K25ol595Ag,635
|
| 107 |
+
babel/locale-data/be_TARASK.dat,sha256=93xDxO06nuAugpWjrnx6C5k8Fs26HIAolUcUPuoHhbg,104118
|
| 108 |
+
babel/locale-data/bem.dat,sha256=zBh5HxY-hRgaQd95anmqMAPP0UVzSV7JdcuqtJ78t1c,5782
|
| 109 |
+
babel/locale-data/bem_ZM.dat,sha256=nQvsLK0FOSlgf6wspQdbj00IveO62c2Mvxjzn4eHGSs,617
|
| 110 |
+
babel/locale-data/bew.dat,sha256=mfKR23PSPyS0AHxbaSuMvufZZQlMICxDGuPv78MtDbU,122095
|
| 111 |
+
babel/locale-data/bew_ID.dat,sha256=JWKbnUQc4ZsJYTcBFypK3gSyFRK6Kp8UFEqdytnPMnM,636
|
| 112 |
+
babel/locale-data/bez.dat,sha256=_saESrmbxsbQnGLACykFIs-aLUC-N7IigpyPWGLBebI,16300
|
| 113 |
+
babel/locale-data/bez_TZ.dat,sha256=OwcKelhUxQWu-8Jm9nf2vCay6-8LQvg-ueZSN_mrGz0,617
|
| 114 |
+
babel/locale-data/bg.dat,sha256=ofd_Tv4onIP1cE1pVO-171ySR9JJXuHKzpWqc-vtLP8,227940
|
| 115 |
+
babel/locale-data/bg_BG.dat,sha256=CERFyuC4Dw9BfAZapqaq69iKAp7rBXWNCkLWAL5tAhQ,653
|
| 116 |
+
babel/locale-data/bgc.dat,sha256=gW0lkQNX_h1SATbqzIqe0twmGqqfigkbqo7gvBCG1AI,2493
|
| 117 |
+
babel/locale-data/bgc_IN.dat,sha256=hO39nPiyUx1kfCdagpCQ8lzPLycjdfk59jFQgsd3Qec,659
|
| 118 |
+
babel/locale-data/bgn.dat,sha256=8RKzmGYGYkn5IF7NHRgPtaI9ozwCeEKoUE4aXQpItKY,28964
|
| 119 |
+
babel/locale-data/bgn_AE.dat,sha256=5jo7AWXMNdiiEf-RqzB5xRVj0R89NFdwq5RAIEAeeRE,636
|
| 120 |
+
babel/locale-data/bgn_AF.dat,sha256=UXCb78n57adZBdKHEGnhbmeVYppzlSscVOWnQNxfJOQ,679
|
| 121 |
+
babel/locale-data/bgn_IR.dat,sha256=iXxyPD5Z-ouDWFpOE2atoi6-HHGoD6PNaT9c-TH6x7o,679
|
| 122 |
+
babel/locale-data/bgn_OM.dat,sha256=3O0CzFrjWxOQFdN6-lDhCxRngoXfadd_dwYoVyjK9jA,679
|
| 123 |
+
babel/locale-data/bgn_PK.dat,sha256=gdVUcc-isHd9lf0S-AmFoPIMwDZ8ay6NY4o1udWI6Yo,636
|
| 124 |
+
babel/locale-data/bho.dat,sha256=JQAEhmajFwUOKB7ACN1-ZPcoKcXJaq0-FhsFCVcvn_8,2875
|
| 125 |
+
babel/locale-data/bho_IN.dat,sha256=UcL_aZq35dOHME0Fux9zyt9B6BOTxyR5UvaGWKLs1jE,659
|
| 126 |
+
babel/locale-data/blo.dat,sha256=I0gfsGv80xf7do-oxzjkh2or934YxYgDMkM9RHf7UXk,168499
|
| 127 |
+
babel/locale-data/blo_BJ.dat,sha256=LM79oUzVI4JtLYEUklfbQxoweFAslN9jS-Ex-dya0mE,617
|
| 128 |
+
babel/locale-data/blt.dat,sha256=6G2E9osBy9OrG1iUKLD9cwcRk3IV7fT11iI8zFkLaeo,723
|
| 129 |
+
babel/locale-data/blt_VN.dat,sha256=vpTQEJYssmuBUn_pYqx7ZtYONNNz02_oBYlDMdWqKAc,636
|
| 130 |
+
babel/locale-data/bm.dat,sha256=K0dLlxoDfJb4QLwa_D0SXfrbD53Xed_EJ21843fY9hY,15798
|
| 131 |
+
babel/locale-data/bm_ML.dat,sha256=PAGrUwc1S6q32DDHTu5LkePFXe_M_i_WxIY4oLuUnzw,616
|
| 132 |
+
babel/locale-data/bm_Nkoo.dat,sha256=UiQ-oKSXYmbnUj9nNXi-9Afx2taBc5EiN-JM1huGOno,2805
|
| 133 |
+
babel/locale-data/bm_Nkoo_ML.dat,sha256=PAGrUwc1S6q32DDHTu5LkePFXe_M_i_WxIY4oLuUnzw,616
|
| 134 |
+
babel/locale-data/bn.dat,sha256=00cRKYrwyk5snhrekLj0TQBVzZlV_PjQ0aLlsApgwxw,219185
|
| 135 |
+
babel/locale-data/bn_BD.dat,sha256=mVW90kQmhDcwzKmkmgNAt5iMq1pLWmNndNID9fspVjY,635
|
| 136 |
+
babel/locale-data/bn_IN.dat,sha256=Y4d5tMv6rG2A1fTcfN7-cMeZ1iH8XuqdZgpEBUy_FTg,4035
|
| 137 |
+
babel/locale-data/bo.dat,sha256=2eVqnOFPv04Ix-1FVPHlDQ9UVTQC1JtC7-5lQ89aX7A,20102
|
| 138 |
+
babel/locale-data/bo_CN.dat,sha256=xOnyre81Z1IHnWV5mJH0x313h-ZWu84hIXcMuB50IT0,635
|
| 139 |
+
babel/locale-data/bo_IN.dat,sha256=GvYCgtrOD5zYYsfMtVmkCv8-y6His8Lg7iuytEGjnMI,1307
|
| 140 |
+
babel/locale-data/br.dat,sha256=rBs1Bp9H6Q4ECO2mouoJmnCW0ux5CLPx1zy32GvpkCo,272612
|
| 141 |
+
babel/locale-data/br_FR.dat,sha256=3oVDdZd7Xf4Q-hwmYraF42SM_3NtvSoiZlmlh6gSNOs,653
|
| 142 |
+
babel/locale-data/brx.dat,sha256=0L8rfQwjwtj3y5M5zzdEB10way4I9P2m8A2E0mTIcac,160164
|
| 143 |
+
babel/locale-data/brx_IN.dat,sha256=NKuJh0cEhRQasy6JAGUi5HbqdnhhEFTQ_7osgtdG5Iw,659
|
| 144 |
+
babel/locale-data/bs.dat,sha256=YVLbXGLHf6QZ9vYnCjxjO3uBImuYnoxR-cEuBPVbP_w,213968
|
| 145 |
+
babel/locale-data/bs_Cyrl.dat,sha256=oqFwEFFfYqyzkVvswj8CR2B_RCb51Myv8jQaDDjz0u8,219235
|
| 146 |
+
babel/locale-data/bs_Cyrl_BA.dat,sha256=oA7rsQckE_IxCpXXB3F3KWQwM3WZTR7WAdYxJN98oeM,635
|
| 147 |
+
babel/locale-data/bs_Latn.dat,sha256=6L9SY85hONRHO4Jz389C2Ziy7llKcDoyVNiE96ozCJ8,1990
|
| 148 |
+
babel/locale-data/bs_Latn_BA.dat,sha256=oA7rsQckE_IxCpXXB3F3KWQwM3WZTR7WAdYxJN98oeM,635
|
| 149 |
+
babel/locale-data/bss.dat,sha256=n9LaBwBIJ7adjJ63G7Q9o00llhPJtkgmeEp08nAa4D4,978
|
| 150 |
+
babel/locale-data/bss_CM.dat,sha256=TD7ixCHREfOLDsDJn8FY5YqGYH9czdEzdULCIl_0GhM,636
|
| 151 |
+
babel/locale-data/byn.dat,sha256=qT32E4jh6H_qm7HYSsAbKmaKluaLrGNXNl3F3FivncE,13403
|
| 152 |
+
babel/locale-data/byn_ER.dat,sha256=oAaZEqMJuTbMITO-ZO6gg8qjwROukzh5VgjtLp6rqD4,617
|
| 153 |
+
babel/locale-data/ca.dat,sha256=CIT0-7X7_e8RKWRrhLSmG-aBC2D51-hvRrTV-7iBav8,184038
|
| 154 |
+
babel/locale-data/ca_AD.dat,sha256=tsLumbhbbeXw627WKi-sQdSTFwNpcSRvJIEYcrOMqOM,653
|
| 155 |
+
babel/locale-data/ca_ES.dat,sha256=T-zv3FfnCJA2WUQTeBADKV82ghY-r60wk8mXtD9wbnI,653
|
| 156 |
+
babel/locale-data/ca_ES_VALENCIA.dat,sha256=7Q59_PX0VWyLsDkC-qscZ-dKJ9AFzz7kCzJz4fTdBWY,2976
|
| 157 |
+
babel/locale-data/ca_FR.dat,sha256=5HUFYUl5QRaUMwJxGLIqUhDO4_wF_crrr346wJmEOZo,672
|
| 158 |
+
babel/locale-data/ca_IT.dat,sha256=Zh2rtOq8MIDC2CQXWnhp5HOvPfXNxhRGnnZViOgc1Mg,653
|
| 159 |
+
babel/locale-data/cad.dat,sha256=XxlMk1b9CWE3wERhhQQN0wxW7iq8Mrngb05RXenmaSI,2476
|
| 160 |
+
babel/locale-data/cad_US.dat,sha256=FWV1sofgr9no5P9yBxNDLeKWoQd80XEYEilmLwamkSc,654
|
| 161 |
+
babel/locale-data/cch.dat,sha256=J4S73psT7C_cXs1VNNYow47plBodQ4PKINC59kzvfAw,2430
|
| 162 |
+
babel/locale-data/cch_NG.dat,sha256=0adhw9xNMlVEqDVKvHe4HCPtbjcw5NSo4ny_pOjl0-4,617
|
| 163 |
+
babel/locale-data/ccp.dat,sha256=Jn_O5MwN6DMGxNrXUpdrhT_z5ZOYh3-Sm5yGUcV8bII,207292
|
| 164 |
+
babel/locale-data/ccp_BD.dat,sha256=f00776fnI484B-mzW0rY22KNkzV6wtmk7uxrSK_x9bU,636
|
| 165 |
+
babel/locale-data/ccp_IN.dat,sha256=jMJimrQrx-b96hBSLi8sOyHtYRwNZryt-he0rhwEZ2s,659
|
| 166 |
+
babel/locale-data/ce.dat,sha256=yuopW5QCq1u8E1Rs0hEOv_y1uvbem_P3lK-_AvU5zLE,135403
|
| 167 |
+
babel/locale-data/ce_RU.dat,sha256=NgNmp1uFnm2MT-s_yx_V8KuW1dSR6_SEWf4NcqrAL9o,653
|
| 168 |
+
babel/locale-data/ceb.dat,sha256=fwgJPAV6TfvyavZUW-9pKeLUacMuH03hCkSkHdIGm8I,100779
|
| 169 |
+
babel/locale-data/ceb_PH.dat,sha256=Z2zXPyNI3Yu3QcGL6lT1nIsl04vDDLFvyd9GeucDtqA,636
|
| 170 |
+
babel/locale-data/cgg.dat,sha256=vgLxp4dDUjKyHy-36IvfaPEy6IiXbDiMKShuEKJuXHU,15621
|
| 171 |
+
babel/locale-data/cgg_UG.dat,sha256=HZBma4MFuX2Q7sk-SOYk5OUkbMXWWr_tEInOqPboNYs,640
|
| 172 |
+
babel/locale-data/cho.dat,sha256=hWEL5XrIWAnqjYSb78iPaj2xh34KDcPYAMc46S7ZLuU,795
|
| 173 |
+
babel/locale-data/cho_US.dat,sha256=T3CacgkE-uKPi0CV7fbcCLTNfdjEco_A50vYciuXGGI,654
|
| 174 |
+
babel/locale-data/chr.dat,sha256=4a6eJjX1JZ-inCk-J8gHJq1QtoK3FpOXhOlQMDbHjwM,187187
|
| 175 |
+
babel/locale-data/chr_US.dat,sha256=wZE2RrJ-5jjUQa1RCJgL7hkXdsU3t91orD-ULDYMXSM,654
|
| 176 |
+
babel/locale-data/cic.dat,sha256=KgrmFl1fudc1tdR_g39YkGR6bcIedQMFnUjh831VIhM,2732
|
| 177 |
+
babel/locale-data/cic_US.dat,sha256=DvW1XJS1hEp_W_5ol0pIECeUb3RqXsyieKVS8J6caJ4,654
|
| 178 |
+
babel/locale-data/ckb.dat,sha256=s6wh2TRjabPo4G64RMoQD_J7FK77RBwsK8R0TH1xytI,35553
|
| 179 |
+
babel/locale-data/ckb_IQ.dat,sha256=Osgu1RAUf2yQpZ-nNBKMxTFJnH32ItLg0kVVzjNfmeo,679
|
| 180 |
+
babel/locale-data/ckb_IR.dat,sha256=6wWzlZWn7oDmGIdnF7UtCfIcUgQ1zvMxtAcEw4bbM-g,1231
|
| 181 |
+
babel/locale-data/co.dat,sha256=NbKZ99wTpG7Y64LnyxTQJIo5SYQaUAOybc68DN6IbUY,12637
|
| 182 |
+
babel/locale-data/co_FR.dat,sha256=DAmwXn4n1mRSsT17-DcU0vdVSI_JfVR8oGOnj7hTFHk,653
|
| 183 |
+
babel/locale-data/cop.dat,sha256=MAhXKI-x0mI10Vlgo35ZvUTsKkyx3yrzVIDMfya68rA,693
|
| 184 |
+
babel/locale-data/cop_EG.dat,sha256=ggMojdy-Ua0lFBG-khgVqDiiyDqP6v8JKJzdp4hv-kU,679
|
| 185 |
+
babel/locale-data/cs.dat,sha256=o7qnhuIqxpPIfD-oyVLsvpmhtRiIOzgJBoMaZvyvPL4,247800
|
| 186 |
+
babel/locale-data/cs_CZ.dat,sha256=keaiqSsGtB_axj8FvdYDOCDmlg2PbQMI6qnW-2mFUTY,653
|
| 187 |
+
babel/locale-data/csw.dat,sha256=a31wJpIkcegvNW9_O8LfIY4-HK0zpLn4MBUEBb9C3PQ,20303
|
| 188 |
+
babel/locale-data/csw_CA.dat,sha256=aWccZHGNU7G4JJdlGRnqyqm0ROubX0rwI9SnH_EhAxU,636
|
| 189 |
+
babel/locale-data/cu.dat,sha256=mlGQkibxBcukKPAJawHruBMuw21x1j42ebTnraxW55w,16865
|
| 190 |
+
babel/locale-data/cu_RU.dat,sha256=GcbqgE8Mlglk5EGGSVcCR-Zb8AmCqHGE8cbmAUSbpdY,653
|
| 191 |
+
babel/locale-data/cv.dat,sha256=BUqS-4RvAuycOlAm_k33eV98VCp5bIUmrWUqjhmsqls,198348
|
| 192 |
+
babel/locale-data/cv_RU.dat,sha256=oVPRtcHzmRmkAy26Bv1jLiWmm0P18ruvHlCQ5F3IFY4,653
|
| 193 |
+
babel/locale-data/cy.dat,sha256=-bN00WqRhdnCL9VdnGgtUtwbmZ7n2r96oZdLuxSP8KM,276313
|
| 194 |
+
babel/locale-data/cy_GB.dat,sha256=dyPULIteKk9gP7lGQiDtsiH5QDqNdlxMdK__2dq90dg,653
|
| 195 |
+
babel/locale-data/da.dat,sha256=Aw20nDcBvnWWpy2IYvg9S8hJVoT-gavJ_LokmwppLL4,171762
|
| 196 |
+
babel/locale-data/da_DK.dat,sha256=qNTw1H8WXsV8qGBHxu6noCUOV3BcoR63ERJF8Xc86Ls,653
|
| 197 |
+
babel/locale-data/da_GL.dat,sha256=9BNeKX1-U4NDr3pBU1ZnCGAasdYZjBMsvpdS5uTf9qs,616
|
| 198 |
+
babel/locale-data/dav.dat,sha256=LBf1uH_Q7632sBVhZgQSrdn5LU2pyIU389h4LircJM4,15690
|
| 199 |
+
babel/locale-data/dav_KE.dat,sha256=MfFFEDT6fib5be-EmziiEF0NAnEV6lXD7svYtHUtmn0,636
|
| 200 |
+
babel/locale-data/de.dat,sha256=l6ABVg2zXPX9Ws9g2-Weve05S46ii0hnbuCViS6mtmA,178630
|
| 201 |
+
babel/locale-data/de_AT.dat,sha256=OhoRvklFcyYUJXplBoK2rAITKRi6r81lwOaixIuffcA,2010
|
| 202 |
+
babel/locale-data/de_BE.dat,sha256=wvdWykhix9Slofcjm2tx2aEhMjffmMLsNrd8709NIR0,653
|
| 203 |
+
babel/locale-data/de_CH.dat,sha256=PH2rDxHA3lpTBkPMCwWjapEDJtgrkHhq2_pAdSKSiXE,4091
|
| 204 |
+
babel/locale-data/de_DE.dat,sha256=SM44YjGlqgh7bKlXvUdt53t9hnCX5o46ujI4IrGPpeI,653
|
| 205 |
+
babel/locale-data/de_IT.dat,sha256=ALPY2QGlR9-kphEk4KggHVS51fQwEDVRd7aHLIiP9fw,1448
|
| 206 |
+
babel/locale-data/de_LI.dat,sha256=FnGRiippDTTFRFswU_4PblQruAuWuPEpa8cGbXPJpbE,1413
|
| 207 |
+
babel/locale-data/de_LU.dat,sha256=QAkvLfyKmZdQVfkk2BbE2AMisK1i7yhRetcApqn4dxA,1067
|
| 208 |
+
babel/locale-data/dje.dat,sha256=6NxQgBas9S5kmjbRcbcuuIIxKaI5_MlfmSUltxJuraY,15530
|
| 209 |
+
babel/locale-data/dje_NE.dat,sha256=lU1vag_HJ4OrbYNYWFXuSdtqLwSlwBbvD6Tg-hl36e4,617
|
| 210 |
+
babel/locale-data/doi.dat,sha256=JrHDjsVlGntLL6qYf9NH52BWAGCSGeGVaHg_rgUiGkM,47442
|
| 211 |
+
babel/locale-data/doi_IN.dat,sha256=-q_oAqvdTizFG1DB_1p8sZVyjbaFFQ_FFPtNCyVn9ZA,659
|
| 212 |
+
babel/locale-data/dsb.dat,sha256=KvZxymKZ5ZbxQ-4gS_uvnNkrYMYn3D-BKz0MGAn5488,203926
|
| 213 |
+
babel/locale-data/dsb_DE.dat,sha256=Z2Dzjx7eXscEBEAb-ymvb1GKP4GVNCt5L4i-BYC_vrE,654
|
| 214 |
+
babel/locale-data/dua.dat,sha256=lmO8ssPF9bIgTU2SM_SzrGWodmsGsmbS485uZNDasq4,4827
|
| 215 |
+
babel/locale-data/dua_CM.dat,sha256=Z3vD8WEr2Wlqqt39anvKXVhz4_yBSm4t5BoAaEz9PgE,636
|
| 216 |
+
babel/locale-data/dv.dat,sha256=-1zCv4GXiRHdWjQk0qXWNPSf4FX4Zp-Ij2jwgz5BsGk,2225
|
| 217 |
+
babel/locale-data/dv_MV.dat,sha256=lvuU5gj3vDykU2ftU1_4Lza-130DB6_ZwylDrdb_GlY,635
|
| 218 |
+
babel/locale-data/dyo.dat,sha256=w71HDmFfCuKN9nUJnuqpHR9DDAmPLkwIu9E0abhYjWM,9854
|
| 219 |
+
babel/locale-data/dyo_SN.dat,sha256=Z6N-NIVcKkx6sFUm8LfN74usyZfgeI6swJL_A_XbBcc,617
|
| 220 |
+
babel/locale-data/dz.dat,sha256=dbPhCcTpoQh6szaBA4TN5eCi3sbG1UBvlQQxtMGHLEU,85026
|
| 221 |
+
babel/locale-data/dz_BT.dat,sha256=KWd6cypWse4XfXbY4BmTlxGjlnRksYNcQYi_iyXluKw,635
|
| 222 |
+
babel/locale-data/ebu.dat,sha256=S8bggVknCbVHw5x9aJQGB9kUBFNcwj9EONHRNtbaWCA,15583
|
| 223 |
+
babel/locale-data/ebu_KE.dat,sha256=GEcGqVmH0WwgP1BCsd9vnSGxGXl8ON4UPTRbyeaNDfw,636
|
| 224 |
+
babel/locale-data/ee.dat,sha256=xJ5vpKJa546rTvKKQI75-HvYmu6VjEedXENlPSeDgCg,88730
|
| 225 |
+
babel/locale-data/ee_GH.dat,sha256=SkQi-aVmtqi3S99DUTLQzZqUE4LrAIWuy25QuZqYAfI,616
|
| 226 |
+
babel/locale-data/ee_TG.dat,sha256=7y8-rDvag7_EQtEObq3fpHaRedVmuEREnQwjktmLwgk,1168
|
| 227 |
+
babel/locale-data/el.dat,sha256=pMPkYRvK3y4IF93Z-127ZF_-_P_QV-_460LgZAHCw9o,247970
|
| 228 |
+
babel/locale-data/el_CY.dat,sha256=POPjzTYMuP7Ijf1S88cAFR0ge9Id_sSRNembKdhk2aE,635
|
| 229 |
+
babel/locale-data/el_GR.dat,sha256=S32Cm-1ENgLL_lDecCDI4qDfyd3wlQ1JbUwOnW1whm8,653
|
| 230 |
+
babel/locale-data/el_POLYTON.dat,sha256=lkcs2uXW6mWXztmsAXnapnSuQ6gkns1WwsVgrg-24Uo,14964
|
| 231 |
+
babel/locale-data/en.dat,sha256=iUuuvOPD3NkEnkY0K6ipYXaJlU_dggEeerU5c1EUQZY,220701
|
| 232 |
+
babel/locale-data/en_001.dat,sha256=1h_YIMaDGBLRbF4L34EAmSTm3ihmKctA2GmzG4loU7E,31616
|
| 233 |
+
babel/locale-data/en_150.dat,sha256=cjKCV1ZLhNY4TvqJF8BXvQR1jVUBFrdjL1RKSnBa0vc,1851
|
| 234 |
+
babel/locale-data/en_AE.dat,sha256=T2jBGVJpPTUgTICdaQnAVjSsYCVkQLfjabyStaPl2CU,4164
|
| 235 |
+
babel/locale-data/en_AG.dat,sha256=POWSM98pRq9k7lqCsxr-MS9PA-zLoOVUKUcI9iXtKq4,654
|
| 236 |
+
babel/locale-data/en_AI.dat,sha256=7iwWKftqPdOdWJ7v94jsre2ZIq2cDpbVGAs_ScBztbs,1206
|
| 237 |
+
babel/locale-data/en_AS.dat,sha256=M-N7v6BuP47wkTFmv5by1w42IQCUiSqKbaVTXtnwF8Q,635
|
| 238 |
+
babel/locale-data/en_AT.dat,sha256=05-bVy1aMFWZlHMBC86A7OVy1zlhJw7hsjyvIOjxE70,1309
|
| 239 |
+
babel/locale-data/en_AU.dat,sha256=4Of5kXCe3oX5qViTn-q1ZD-50JSQ-Ly7xX_b6SFWSbY,19022
|
| 240 |
+
babel/locale-data/en_BB.dat,sha256=J8vppKlBp03jJvVuVp6Z4GMc_N0BukeQ8f8q14y8fwU,635
|
| 241 |
+
babel/locale-data/en_BE.dat,sha256=0JXHgqUIWZYe88FYC97spm2TqyIaNOwDJBt3LBmUF7A,1547
|
| 242 |
+
babel/locale-data/en_BI.dat,sha256=AbdI5FjEqQLOMbBtD3wLW_7AccuOwY9MZUFpMF1uEco,1189
|
| 243 |
+
babel/locale-data/en_BM.dat,sha256=cZE8sxf44ETY6nCxOgbvJN2RhABZrRaP8SjwsbSepuE,654
|
| 244 |
+
babel/locale-data/en_BS.dat,sha256=sGvlF2LPwG5eVA3IuH8-4S5X7BrvQ5LcgZ8gfAkkwwc,752
|
| 245 |
+
babel/locale-data/en_BW.dat,sha256=k5bc9gYBdl_8ZyCelrlS9ZenMzs8cdfl2MxeCnOAr88,2850
|
| 246 |
+
babel/locale-data/en_BZ.dat,sha256=LJsn2M0RWMbxDmGRxs2lk2ZvkgoguwPf7oLBYQydU4A,2979
|
| 247 |
+
babel/locale-data/en_CA.dat,sha256=u9gSGF_MnHeklexjpxBWfDQI-5LREnNkP7hAod_hNoY,37942
|
| 248 |
+
babel/locale-data/en_CC.dat,sha256=34a3Vb57hT2reRvwn0Ud1nXkoYQJoPmaqh1n5qflFdI,1187
|
| 249 |
+
babel/locale-data/en_CH.dat,sha256=Nfkwk2HNOccSH8Co5SWYnFdHWEDEpKNPQ2o9a67vt_k,1866
|
| 250 |
+
babel/locale-data/en_CK.dat,sha256=gvU21BSAugpjE7CT3xnpHML6oRgHPaBoq7W11YbG-1U,1187
|
| 251 |
+
babel/locale-data/en_CM.dat,sha256=r_7Yzep6S0ZOFvk_TORm5Qhi55yjehVQAotaLnn7igQ,1437
|
| 252 |
+
babel/locale-data/en_CX.dat,sha256=lKYbIRS6r-WMUd1ewX7Q4TpX0PBVcsYN7Cs263_xosM,1187
|
| 253 |
+
babel/locale-data/en_CY.dat,sha256=kQZfhQdPfdBeePOngn-4CpA3ZJ7Th-lmZ-jOrBe115o,635
|
| 254 |
+
babel/locale-data/en_CZ.dat,sha256=PNwk-yPyyA7DZbmrwm_Bcrhw1jNmFF8WNWtHMXwdVsk,713
|
| 255 |
+
babel/locale-data/en_DE.dat,sha256=oI3TmMDoQZsGddvDb0fbbwd_LdTeFbFPdFkZhst2q7Y,1027
|
| 256 |
+
babel/locale-data/en_DG.dat,sha256=xtjjxkuFB7I4p3n0f4Evz631RtMQhIzpoYwUzOzICqA,1168
|
| 257 |
+
babel/locale-data/en_DK.dat,sha256=pE7x4MDJvZGFnqQqXMCDWoMV3Ovu2qH-QO2oYNvgL4Y,2425
|
| 258 |
+
babel/locale-data/en_DM.dat,sha256=gbriVhXcdXi5GWmpgWdGB1LUwI2yquuLk1khkzpo1UU,654
|
| 259 |
+
babel/locale-data/en_Dsrt.dat,sha256=16L4-KZ6QNunAmMFJ8bSRppOC16aaHl1rtQN8zOCbbQ,38658
|
| 260 |
+
babel/locale-data/en_Dsrt_US.dat,sha256=p8c_L5tEvzYmacz0tmq58Wsbfp9wMV_PBgz5R_v7I-k,653
|
| 261 |
+
babel/locale-data/en_ER.dat,sha256=U1vYaQVwnVgfmO9l2_GjBnAhHrShbiHU_E-hAclDvck,887
|
| 262 |
+
babel/locale-data/en_ES.dat,sha256=UzffO5tH8bSTRY69w0_Smf0vvOrwID6yIjLHdVUphFo,712
|
| 263 |
+
babel/locale-data/en_FI.dat,sha256=i4gKdljmc9cXO-E1IT6JGmq2JsRRH71sKe3yUmkhIa8,2357
|
| 264 |
+
babel/locale-data/en_FJ.dat,sha256=k-hXekogcQzt00qXdcWODsHbg7Vh9U8Vx84bERd8CHM,672
|
| 265 |
+
babel/locale-data/en_FK.dat,sha256=r6OGl7mX4ep5aeFMlhog6Xr--kDKFEVhDcepSJBYZWw,1210
|
| 266 |
+
babel/locale-data/en_FM.dat,sha256=88mCYM5_VDSYpJ_mV4AStjiDpKAo_1W7GbmKcI9f_sk,616
|
| 267 |
+
babel/locale-data/en_FR.dat,sha256=BTiA_ltFmx1GIjAZJ6bCZ2cuucYc--keQ26NCyLcibI,714
|
| 268 |
+
babel/locale-data/en_GB.dat,sha256=2qd2bKhxJeiwIneKwRmH89UCmnYfBdpOFvL02en-YKU,3440
|
| 269 |
+
babel/locale-data/en_GD.dat,sha256=c2ap41e5x-OY5dEYZ5wD4ByRbEzlx0845R1lPBLnJus,635
|
| 270 |
+
babel/locale-data/en_GG.dat,sha256=qhfvbRdldEA4467X0_8N09HwT1ZRPJJtb7Evpvbbarg,1273
|
| 271 |
+
babel/locale-data/en_GH.dat,sha256=bBpzsHl9QhNAQ7hrUtKb6TwGvZYibXQwXfuJVgLMlZ0,889
|
| 272 |
+
babel/locale-data/en_GI.dat,sha256=veSOVDagnkTwyqxP4u5mOkRG8_W4MCZ5ptMBoGOg9SE,1228
|
| 273 |
+
babel/locale-data/en_GM.dat,sha256=jfHQeiMTDNgnIpx3WZ9hOpCR_LXCYLLrVN4SUakudi8,885
|
| 274 |
+
babel/locale-data/en_GS.dat,sha256=4qjeVJPA9Crph3uHpcywYtsNR8S8ok5l38qtEHsIk10,1168
|
| 275 |
+
babel/locale-data/en_GU.dat,sha256=WDR_uybAkUii6RHT2x62pzCLvX4bMstibEztBvLSuxI,715
|
| 276 |
+
babel/locale-data/en_GY.dat,sha256=TDiVa4YSapsK9rjQN3ATnrj3m267l35pqRLI7r5bLFc,694
|
| 277 |
+
babel/locale-data/en_HK.dat,sha256=meLPc5_3zahna_xycXEf75TrW5_4BHuqMQcMyoo1eYQ,2315
|
| 278 |
+
babel/locale-data/en_HU.dat,sha256=6D4ZyheEpHTHE64XVpU6t8ddSWyYT4Hhfo1HEHzimZ8,713
|
| 279 |
+
babel/locale-data/en_ID.dat,sha256=b8R7owdV-fl30WrUhFz-1YGHiFweaoYs_bBFr9pGhD0,3172
|
| 280 |
+
babel/locale-data/en_IE.dat,sha256=ZNe5XFbdM4UnYu6KaGYHggQqzIVCWwWof5C5ktTsHn4,2094
|
| 281 |
+
babel/locale-data/en_IL.dat,sha256=O4-JPTBiiLezF-iUSDu73id-0VWlSiE0ie8z9qRaxq8,1424
|
| 282 |
+
babel/locale-data/en_IM.dat,sha256=u3JX9jrrsW_G5RQXHsQIGl6ikVduckeldeS_FjKG5Y0,1273
|
| 283 |
+
babel/locale-data/en_IN.dat,sha256=2d4aWIy6Q72ExhZHnku5HKbKmSSavvB7zkflqlBsRQA,14809
|
| 284 |
+
babel/locale-data/en_IO.dat,sha256=TOM0TxdcWcu1wyBXJxsrE-uCIZsbYTCmUkTdfCaOO-E,1168
|
| 285 |
+
babel/locale-data/en_IT.dat,sha256=zp8h2lM7v7DPs_9F1CphO3UVNIYsdf1_8Kj9PPiafoo,712
|
| 286 |
+
babel/locale-data/en_JE.dat,sha256=IxL3Ry70pMOXDbCwU6LZllHXZmg8XHbjocavEWvb9jY,1273
|
| 287 |
+
babel/locale-data/en_JM.dat,sha256=Z9GFZ6aFGEvIEzlbOlA5bBBvxgcxXx6s_7AxPMp2Yg4,1666
|
| 288 |
+
babel/locale-data/en_KE.dat,sha256=oJa3lUdjavkdhkMK_bcnJ08waK9lfIRs8mFkG0JYf-4,1458
|
| 289 |
+
babel/locale-data/en_KI.dat,sha256=3yfkrwv7Yd9yxDNnXz9Sv8ghbDvqczZTAELr3uGNYn0,635
|
| 290 |
+
babel/locale-data/en_KN.dat,sha256=cFebccXOrQo2X1zmHoHYB2vzXynoroYImJTMnK9j3h0,635
|
| 291 |
+
babel/locale-data/en_KY.dat,sha256=slmSWk0IEz_UK7PfHX4KyHlf_iBRfuoOWVuEB0aKaYI,733
|
| 292 |
+
babel/locale-data/en_LC.dat,sha256=jUYdKd248Jkj5XVxXXbvXnfxu4BH_3s4Ld-O67qbPkE,635
|
| 293 |
+
babel/locale-data/en_LR.dat,sha256=ribT8_azFjDC8uzIsOwkGTjfgEiFlSG_wAb_wG1Fmnw,885
|
| 294 |
+
babel/locale-data/en_LS.dat,sha256=2HtV3gUrynDl2mVvqywMfff8VnVjz2ryoNS7D2n5T9c,885
|
| 295 |
+
babel/locale-data/en_MG.dat,sha256=dtMrsBqOpwQExs7dVukbUzWojz_6swx5Ng6OXdKxsSs,1438
|
| 296 |
+
babel/locale-data/en_MH.dat,sha256=NZjQknLyokLgJRNPicAZ55_VoRCATz_WvAxMo_I-HOg,1368
|
| 297 |
+
babel/locale-data/en_MO.dat,sha256=UJVR7td-vlRY_a36ZWbxr_PcK6egIUQSKoky3DeAmEA,830
|
| 298 |
+
babel/locale-data/en_MP.dat,sha256=Sd2vA3CdR_GBw1vQQQBfKIY0asJGsVUwZ6gD-h7Or8o,1349
|
| 299 |
+
babel/locale-data/en_MS.dat,sha256=BXrA3odGnWSeR6404L85ErqMKxTnRCZ16UWL2RpD7TY,1187
|
| 300 |
+
babel/locale-data/en_MT.dat,sha256=sODJaESHndxdT9SYZcnESDA6G6oln6n9NCojeHhKvJg,1990
|
| 301 |
+
babel/locale-data/en_MU.dat,sha256=SefoZho0XzSzzU_Y_-udWPCuRgz8ujdUVkL7hhzZO8Q,1438
|
| 302 |
+
babel/locale-data/en_MV.dat,sha256=Spp5zsOCHzCeZOyUdYqXoqmSoIJ0pxRR3b3nI27jvTs,2034
|
| 303 |
+
babel/locale-data/en_MW.dat,sha256=5d20Ih8j6iwBY545I4nObBWdv9FL37nE-ggfpGeXSVs,886
|
| 304 |
+
babel/locale-data/en_MY.dat,sha256=nUwwM17W9W78nnbXGmrx2zComZQ9Fg_pu3va9wPZzvY,716
|
| 305 |
+
babel/locale-data/en_NA.dat,sha256=-yNAAmx38RoVJt3YRH7Tp1xO9o3GsSVDU6uF_GKhGb0,885
|
| 306 |
+
babel/locale-data/en_NF.dat,sha256=6LqhwHyOnkQA4TNvseuiE1a5Ov7DV3y46CZ0ENcibXE,1187
|
| 307 |
+
babel/locale-data/en_NG.dat,sha256=dvbDZYdlkmhF-IU8M6s2p_kHswy8HhdmR3LLc4EhePI,1439
|
| 308 |
+
babel/locale-data/en_NL.dat,sha256=dDCtXReh9uMfUOVqGWaWjfV1-dLe5_yj-o_HrKZGMeM,1192
|
| 309 |
+
babel/locale-data/en_NO.dat,sha256=7PJnnryBa2El81rK1pzjj1XT6PADpW-P9HnL7bRyKzs,1010
|
| 310 |
+
babel/locale-data/en_NR.dat,sha256=ZiUNBY0c1T3LQP-qGmtuxLW2Jfc-lcVTuWpB2jxfAGI,1187
|
| 311 |
+
babel/locale-data/en_NU.dat,sha256=jU4HXz_3l5k-luPPsjZmZBsdOVB5ZfkN1Xuk5i2pduc,1187
|
| 312 |
+
babel/locale-data/en_NZ.dat,sha256=z_qul-H3zQn0Q_lrrHceySj1m2TQaaJZd3QMXE31CcA,2340
|
| 313 |
+
babel/locale-data/en_PG.dat,sha256=WV6D2yT-4GX6ftbnUkK-ihfNg8Y-ImX1Af56okx8LTA,635
|
| 314 |
+
babel/locale-data/en_PH.dat,sha256=oPz_wDvxfCHBpkBUaZ0RiwtPrLtx-9IigR0TIK1b-IM,635
|
| 315 |
+
babel/locale-data/en_PK.dat,sha256=KS_KXItkhkUULbKd9mHdWD9ok4WjZbVSXhU8e5u8blo,2074
|
| 316 |
+
babel/locale-data/en_PL.dat,sha256=us143U1tPhG6MUHpeixIX-yOMwEilDV-tUaQ1XgsjMQ,1038
|
| 317 |
+
babel/locale-data/en_PN.dat,sha256=qpEWWX0fvhzV6gcX_SHNbJW7E-5FikKwXrQAP9BWmXc,1187
|
| 318 |
+
babel/locale-data/en_PR.dat,sha256=bpAu9yoeKxzQTF5Be7AfXtyE3wax0eP0m-Eu-Cr0jKE,635
|
| 319 |
+
babel/locale-data/en_PT.dat,sha256=D1S2jptkyX0igfFWctmR1yCVruIR7IZaJKevAIrPRS8,1039
|
| 320 |
+
babel/locale-data/en_PW.dat,sha256=--3_iiNqupR9R3ccq5foj9HzkADBEwBYdKE_AxLZD3w,714
|
| 321 |
+
babel/locale-data/en_RO.dat,sha256=5_EIBj1QkBAnG-yAK1C2PVjeJh2a33SjlAaTglysxEc,1020
|
| 322 |
+
babel/locale-data/en_RW.dat,sha256=Et3hOZwaSDECrCzypgYq1QxKxxnB3XYziIeEe_WiY7c,1438
|
| 323 |
+
babel/locale-data/en_SB.dat,sha256=h9TJ69YThzzLGTh49BBEmRBxSiZhZpQrVJif0QglLVs,635
|
| 324 |
+
babel/locale-data/en_SC.dat,sha256=omYtCZBrLl8fHuT6XInezdetV7WqWZVYriJRnlWKbTg,1188
|
| 325 |
+
babel/locale-data/en_SD.dat,sha256=ozd3rV_icr8p2H9V6StOSMkoHBPNBsXsay1GMRWZ1zs,928
|
| 326 |
+
babel/locale-data/en_SE.dat,sha256=96guhEOzGr2Lcbd3xZ4j7HTj-0H0oaGMQIbI9a_5g48,1502
|
| 327 |
+
babel/locale-data/en_SG.dat,sha256=u9U5CLnqs0iJmSnMsPBHF71HQLpFM3siADzZeC7iaJ0,2096
|
| 328 |
+
babel/locale-data/en_SH.dat,sha256=rBm_0zxjHnEVzs_CPCyuz5LpI9isA2S6copUuNbxCcM,1210
|
| 329 |
+
babel/locale-data/en_SI.dat,sha256=kkeEkPnW48iNoiwNZb0KV29DPU0oVNuENTi_Wmp2ALc,1046
|
| 330 |
+
babel/locale-data/en_SK.dat,sha256=r6hAr3NnR-tbXF7eA4QVgwe493o_wH-QzcA4xdlYoRU,1065
|
| 331 |
+
babel/locale-data/en_SL.dat,sha256=4hJLAAnyuEVVQZ13NC7wZ0JYJQ3rvX0SsOAp0OoW7_U,886
|
| 332 |
+
babel/locale-data/en_SS.dat,sha256=C4kpyEFjyKT9-6wt2pGl4125aN0Bp0wpcYBrr62nPOc,908
|
| 333 |
+
babel/locale-data/en_SX.dat,sha256=7vESruRIiaBqWxuSRpIE2U6PgWwJ9mxgbjjH_XAraa0,1190
|
| 334 |
+
babel/locale-data/en_SZ.dat,sha256=A9wkzZ5cFffcEf1FobYRPxR1EAFwqQvqELsqRpNleOg,885
|
| 335 |
+
babel/locale-data/en_Shaw.dat,sha256=wU9fC6w85YCi9jeUFo-zofJuR14QaSehUJxcCOGfQik,4776
|
| 336 |
+
babel/locale-data/en_Shaw_GB.dat,sha256=uAIWlJ5gr_NR6lncmMaBrjXUPhZ33rGsXoHz8hrd_E0,653
|
| 337 |
+
babel/locale-data/en_TC.dat,sha256=UWqEc9zpN3NdS1dymbUv2iGKhLkH65Kk9uNFxdXGnOw,616
|
| 338 |
+
babel/locale-data/en_TK.dat,sha256=qz4RHtHQ6cNjB8xW8_BIHdzW1cEcQuyJfdqFIybXAs0,1187
|
| 339 |
+
babel/locale-data/en_TO.dat,sha256=OehJQf8kvWi7A-Rwo2hPjs1Z9pTdg7_Hyx_ewWxbLQ8,636
|
| 340 |
+
babel/locale-data/en_TT.dat,sha256=L23iDn_zvh16iPE5uBlLCRvECSozqyzU9W2OcSjYogE,654
|
| 341 |
+
babel/locale-data/en_TV.dat,sha256=3sj3NCjQg-9UOdTz7wDJRpjx57bI0bntpmx0T50OK9E,1187
|
| 342 |
+
babel/locale-data/en_TZ.dat,sha256=5Q87mjSEaCMmWeWwtesb9lJw2tIWOsvyScG1CqSpWvs,1439
|
| 343 |
+
babel/locale-data/en_UG.dat,sha256=aQLfdbfozsYhK3EG9JXVxsmT4B7UvfSzNBo7kO2WSsc,1462
|
| 344 |
+
babel/locale-data/en_UM.dat,sha256=qd26Sl5bJTEgHU25hvskp4LMxvRJByLOSvUikqz0J4I,653
|
| 345 |
+
babel/locale-data/en_US.dat,sha256=p8c_L5tEvzYmacz0tmq58Wsbfp9wMV_PBgz5R_v7I-k,653
|
| 346 |
+
babel/locale-data/en_US_POSIX.dat,sha256=U8r77o6qQID3Sd5FiZqukSpQnq4LV1BDwHUeuNZjW10,1321
|
| 347 |
+
babel/locale-data/en_VC.dat,sha256=ES4c4Xt6OvJDhxoAZpWR2HFbtyENOl9CrV7XFCBs-MY,635
|
| 348 |
+
babel/locale-data/en_VG.dat,sha256=sqiVUOEtDV2pAc5DzGl76qV1mL5K-UWhMRzG-Ff6r30,616
|
| 349 |
+
babel/locale-data/en_VI.dat,sha256=AGffygfBAafQMxKAAoxt6kwmbES4R_ybbXRV2tHpy04,653
|
| 350 |
+
babel/locale-data/en_VU.dat,sha256=ji2cRB8B-c8uJR7L56HzbkiTR8eJZziVTMcEzuiK2g0,636
|
| 351 |
+
babel/locale-data/en_WS.dat,sha256=gowKsveED3UIWyLgnSWxyE6qq87lH2dMgOVLDGCEcBk,656
|
| 352 |
+
babel/locale-data/en_ZA.dat,sha256=uoSLsVWiMu6x-DYwISGhEwveg0kVsDwgnIhq2Jn0hXo,3411
|
| 353 |
+
babel/locale-data/en_ZM.dat,sha256=8y814a5GtYcC5gvh3YBlcYf5Imr0yNEIV_v8jH3SXqk,885
|
| 354 |
+
babel/locale-data/en_ZW.dat,sha256=GUDDEesQRkUuLyyDlnJ3MGlGzG-kDPxt8OTIqVRKDyw,3320
|
| 355 |
+
babel/locale-data/eo.dat,sha256=kSIbuCrTJF0ZuNV8FzhyheJT33iKwteIHLaYgdfPO4I,101326
|
| 356 |
+
babel/locale-data/eo_001.dat,sha256=3-tP9zaTDfbBBjpd2qKVIhS7WWbmtVKGGW_BmGIhrHQ,850
|
| 357 |
+
babel/locale-data/es.dat,sha256=c62rMW3rHT7taFSTKPt8je50jtFex4sL8nvuVey9224,191377
|
| 358 |
+
babel/locale-data/es_419.dat,sha256=s-JLmJhGKoIbnsjZm-6UXnDsAsgFhIKk9OJk7SPR_oI,27973
|
| 359 |
+
babel/locale-data/es_AR.dat,sha256=rFeyqcUDLb3yYYWMuCP8R4O1n4rT1XCeayaIaoPaOPY,7087
|
| 360 |
+
babel/locale-data/es_BO.dat,sha256=9zgEUshMb69M3LZS_3TOk4kGOt73fnB2UWWR7HPFAgk,1477
|
| 361 |
+
babel/locale-data/es_BR.dat,sha256=oCD_7IoQ5w-C-YXpQ_wBcS0wUkcY268QDcg5y7Vo7KU,1207
|
| 362 |
+
babel/locale-data/es_BZ.dat,sha256=Z3ZskA42UBcpOPDI66F6YBTvzt-g61PmxhiEpdGXpwA,1206
|
| 363 |
+
babel/locale-data/es_CL.dat,sha256=tpiiCMc68Ab3YYDqi_zh0dw_IfsZmLciylujbf72XqQ,4848
|
| 364 |
+
babel/locale-data/es_CO.dat,sha256=_ZNmqQnEj8EoNse4lJuK0Qrg1ZnPSgUVCPCNo7K6FE4,7436
|
| 365 |
+
babel/locale-data/es_CR.dat,sha256=GknsR2O3LbFhHagGvUvgNgBVCVbXZxk-yzivTPR-Q_0,1308
|
| 366 |
+
babel/locale-data/es_CU.dat,sha256=N-TqpCs34sjlEMeJgvrfOSpmnnlGxuuGtSBSaUKDbvg,656
|
| 367 |
+
babel/locale-data/es_DO.dat,sha256=HMY1U9RiyiBlQKc_kUERQ-GHqWCgjaqrBY0mKUE9Gp4,2700
|
| 368 |
+
babel/locale-data/es_EA.dat,sha256=V4UU6BM3pjbuEleLA_MaJtWl8IejNcHzUM660pfKa80,616
|
| 369 |
+
babel/locale-data/es_EC.dat,sha256=i6oUe_5GL6b8ZnbnORW1csbq1-qgo6VN0Z6x9G2xIWk,2941
|
| 370 |
+
babel/locale-data/es_ES.dat,sha256=fd1TSjdlf2lSMxwi0NhYGR2eyiABBaSJvhLlwLO46j0,653
|
| 371 |
+
babel/locale-data/es_GQ.dat,sha256=a7A-hqM9wNt51_CdpjzU8aT9KEeMz165-MyhkWyqJOM,638
|
| 372 |
+
babel/locale-data/es_GT.dat,sha256=zk_WqHmzYsoIAiErSYC9G62MlbgAuySSTAPZLtOX__c,4132
|
| 373 |
+
babel/locale-data/es_HN.dat,sha256=71FLaDfVW5pgllY-BoQoPaDjJ4lvhs_Fi9EBmJQjZj0,3051
|
| 374 |
+
babel/locale-data/es_IC.dat,sha256=hwey8h4GM8i25i-YZR_K-jvCij95wZqr0zdTIKauP58,616
|
| 375 |
+
babel/locale-data/es_MX.dat,sha256=6jxhdWleuQwI_O1FZOl2I5DEwUs3oXjAhJhyBmBCMGM,25204
|
| 376 |
+
babel/locale-data/es_NI.dat,sha256=cF62A52GuQD-QU9-jBmK_8AJ5pZ1W_nJ7NwraSAhMvA,1227
|
| 377 |
+
babel/locale-data/es_PA.dat,sha256=fBNNQGv937Iu4OPHxSuYtPu8M-u6xhUmG0LtMbxDC0E,2775
|
| 378 |
+
babel/locale-data/es_PE.dat,sha256=G6ZcerCUvlSGQmeysFNtMNJEZwPAerVqwOG2hHUpZ_U,7244
|
| 379 |
+
babel/locale-data/es_PH.dat,sha256=fEMZmVPQb97bBjEtCVMLn9JUtosTePmRuQqhpfNYkZQ,1248
|
| 380 |
+
babel/locale-data/es_PR.dat,sha256=wPOPeV-O9rnLzNHObqs9JEUo2ouyqmaiXqtsxHtKpWM,3307
|
| 381 |
+
babel/locale-data/es_PY.dat,sha256=KXiw-rkQCdcoeTv0t0SnA8ioZrHQYfPxen8491aSq80,4442
|
| 382 |
+
babel/locale-data/es_SV.dat,sha256=JM9uw_EVtB6J8bH_Nz0GL_yr6ehay4uAPm4OJIiUmfw,1260
|
| 383 |
+
babel/locale-data/es_US.dat,sha256=ifZ5PL9mZhnqv3E6uRoRS2Sqlkgyz53m2RJs9wDcpMY,22533
|
| 384 |
+
babel/locale-data/es_UY.dat,sha256=31KdHVEWnE6fWuHa7KOdTLcmlWXn8M5liZZMDWlaVrk,2703
|
| 385 |
+
babel/locale-data/es_VE.dat,sha256=kyxdQ51DhLNf6dQauAPw4vOlpjftw9CQgc3yH_uAoKc,2509
|
| 386 |
+
babel/locale-data/et.dat,sha256=eTq6nG039wKW81vnFtx-qzaWVo0wiUey2Y2ZUQLl49k,175652
|
| 387 |
+
babel/locale-data/et_EE.dat,sha256=JpcyzIDpGwHlLSiInuYO3HfxkMEFsDPBeMc-B8Rj3MM,653
|
| 388 |
+
babel/locale-data/eu.dat,sha256=lEQD4nzng6_Fmu8zQtkrvoFWV5AvUaCpOaAlv7vknt4,178023
|
| 389 |
+
babel/locale-data/eu_ES.dat,sha256=ABS9lrwjRkWenVB4fNrwKpr0mOuMF_eOlOrSrobcDl4,653
|
| 390 |
+
babel/locale-data/ewo.dat,sha256=tHyC9Uj5Gkz_nGEiTCFjXn3veej5z1GUhr-j-Dl2vgE,16881
|
| 391 |
+
babel/locale-data/ewo_CM.dat,sha256=likxlZJqzYOVxcG4oSUQLTiH5DjGjdAFsJPIjnnj2Iw,636
|
| 392 |
+
babel/locale-data/fa.dat,sha256=ci_F95dki3wTXhl10yqZP7IomDg1FHIOArxqTEMUEyk,192269
|
| 393 |
+
babel/locale-data/fa_AF.dat,sha256=3lXNqz0r7fjXSYzqZBKGD5gtS0cPs-lx1ExY_s1ucfk,8639
|
| 394 |
+
babel/locale-data/fa_IR.dat,sha256=nPuexwzRHDb9TFMjILK_V43sVIzbcn_fgp0msY3eFQ8,678
|
| 395 |
+
babel/locale-data/ff.dat,sha256=gT8MoHYFJcGDoVjBCYPzsrkMTKylOjXkE64Sc0L-rvM,15911
|
| 396 |
+
babel/locale-data/ff_Adlm.dat,sha256=GbwYyVBbA8SAJP-1BYMW4b3HXivgi8HvRDzIaKuJtvg,326252
|
| 397 |
+
babel/locale-data/ff_Adlm_BF.dat,sha256=eYQLbHvxtEqcJCMbXSkqN2dRSuYHVc6Tg9kOUKayJQs,637
|
| 398 |
+
babel/locale-data/ff_Adlm_CM.dat,sha256=b3VqkcWqXc7s1hCxN60dd-yBRXkcXfMMQ0uAJKmSsg8,656
|
| 399 |
+
babel/locale-data/ff_Adlm_GH.dat,sha256=r1CRe9Z8kZ3B3PDxmZQbvgpsEcY3OjJek9Z_S8FBb5Y,1236
|
| 400 |
+
babel/locale-data/ff_Adlm_GM.dat,sha256=ZM17aBc8xznEjoP4f7HRCHaKn-DIxCSDGkL6GvDYvDw,1232
|
| 401 |
+
babel/locale-data/ff_Adlm_GN.dat,sha256=HWkLsTj8Sd0fWYuYysHhShl08hg0iAvSXhPjy-rUjB0,616
|
| 402 |
+
babel/locale-data/ff_Adlm_GW.dat,sha256=vIUl_C4PZSWmypeEmnsAUbGN2dSquM3nEOdBs22_qNE,637
|
| 403 |
+
babel/locale-data/ff_Adlm_LR.dat,sha256=277rY6zAWlxetFe0D0JpVEY9MNcQiJU9kt1jRoiXE7g,1232
|
| 404 |
+
babel/locale-data/ff_Adlm_MR.dat,sha256=qz618w1XY_zwZ27nB6LBgbzsjsh4UinfnuOVx2bqLgk,1233
|
| 405 |
+
babel/locale-data/ff_Adlm_NE.dat,sha256=waY1EIQKuOkVzrtJ-t-5VY7cK2uKL0SIBO0PQbx4x9Y,637
|
| 406 |
+
babel/locale-data/ff_Adlm_NG.dat,sha256=9UdHELj5G90YopBKktxDyWVQyLxl5f7P3ToBElwlvCo,658
|
| 407 |
+
babel/locale-data/ff_Adlm_SL.dat,sha256=7jLKofwQBRggP61keprrbfFGXvrcJPIOvwEVmUNjcTI,1233
|
| 408 |
+
babel/locale-data/ff_Adlm_SN.dat,sha256=nGazz6Tun3D-XsO6SljxQeeBuzvAb1sBQw21IbkDQKo,637
|
| 409 |
+
babel/locale-data/ff_Latn.dat,sha256=APyNmlFYRwCQOlboY58qsqiF57rrI3F4fHu-uQTdt4g,866
|
| 410 |
+
babel/locale-data/ff_Latn_BF.dat,sha256=Nym5keR3dDPMJBFr7ZyW2cuuY-qTMkdHzXnIHSmfD4Y,616
|
| 411 |
+
babel/locale-data/ff_Latn_CM.dat,sha256=rWaVAF6D5gv_hDhNmSGbcWGpPV7X4gp53FBMXyMjT-8,635
|
| 412 |
+
babel/locale-data/ff_Latn_GH.dat,sha256=-kMvFNIQyikTD2dFakV81ghSR2H584AigLgtmrzlhN8,1231
|
| 413 |
+
babel/locale-data/ff_Latn_GM.dat,sha256=1Air8sk0wb0McqLZXDWIYQeiKgPusBaVjr4zk54IaoU,1227
|
| 414 |
+
babel/locale-data/ff_Latn_GN.dat,sha256=7R-6dXYMBdveo2-9Vc7CjIA2H6y_hGJVbfVGIaJUgbI,636
|
| 415 |
+
babel/locale-data/ff_Latn_GW.dat,sha256=2kbqhzcDeSPQxefHxynmrv2tmFVnWdRNjO7I3AZ6lxk,616
|
| 416 |
+
babel/locale-data/ff_Latn_LR.dat,sha256=MQxcDQnMZC5hN52abzqCjVIL9Z5mA9wOyTqGPP4Oj0g,1227
|
| 417 |
+
babel/locale-data/ff_Latn_MR.dat,sha256=CDUb5owq0Ntsd2lIZJejvYxOjl-NOUPP-v3tgVj1_qU,1228
|
| 418 |
+
babel/locale-data/ff_Latn_NE.dat,sha256=R8C0fI8ql5XpnT29CrwBG8rgdHB1AASDBSdvqIqIQ1o,616
|
| 419 |
+
babel/locale-data/ff_Latn_NG.dat,sha256=00rtiYbJD_ci8-0M4ye95rzGpbyX8qQ-dmFFIajAtRQ,637
|
| 420 |
+
babel/locale-data/ff_Latn_SL.dat,sha256=UaWOeokdbSoxG0JUyyGWkDyz70sXy-cZbc3lXZxmQK0,1228
|
| 421 |
+
babel/locale-data/ff_Latn_SN.dat,sha256=mPVac9iCnwNay8c7Ko3uUvg48lfyfEZrvhpyEFFGmFk,616
|
| 422 |
+
babel/locale-data/fi.dat,sha256=yr9FhmvZuEh0-H8Kx-8XWi-7Suo0K-esRZVVhXdMPxQ,204853
|
| 423 |
+
babel/locale-data/fi_FI.dat,sha256=cpbJU4KKG8OWbmLnc9TKTdzmpoi2AJh_Pu1cHhDwVSM,653
|
| 424 |
+
babel/locale-data/fil.dat,sha256=g0INTCXppDgjTGgBHy9hqQ8Mcw7G9K3XLTLyVshWuuA,144724
|
| 425 |
+
babel/locale-data/fil_PH.dat,sha256=JjoZt3zNxy1X6RnHoxUKOMzT-xMh3tGZBRq8cvrBwqA,636
|
| 426 |
+
babel/locale-data/fo.dat,sha256=4P7HQxbB7uhYUyAt1rFID1mHXUe9zlQBvWCt8LDRhNM,148411
|
| 427 |
+
babel/locale-data/fo_DK.dat,sha256=HUuarLNFSsV_gN2fg-OqrPr-6Ry6KFgitCp173jxAOM,674
|
| 428 |
+
babel/locale-data/fo_FO.dat,sha256=SLeNQ33QTZ92kXCzQcFfo-OgwZVFPJKIeRivuvz0zo8,653
|
| 429 |
+
babel/locale-data/fr.dat,sha256=HvPCR3ft-_VxUpJsVp1wKU8aiJ7eCKZEz9XZVlM5jek,213357
|
| 430 |
+
babel/locale-data/fr_BE.dat,sha256=ODfkJC5kWWEEkjr1UV8AaLtKKc4sPCUxlIGkEDkTr6s,1085
|
| 431 |
+
babel/locale-data/fr_BF.dat,sha256=7piWVeMMrZ-YbO9MNqJAu7ZeIdueVnhg07eeMwJHy94,616
|
| 432 |
+
babel/locale-data/fr_BI.dat,sha256=R4kaU1OtMcNIcibkw8OFGP6FaYMxt2uKMRyidkEqbiA,637
|
| 433 |
+
babel/locale-data/fr_BJ.dat,sha256=sel3fdwegY5W4NRg32t4MuXoqpGqTAGO_ffCF2NPggE,616
|
| 434 |
+
babel/locale-data/fr_BL.dat,sha256=n-MRZjeHNkRMwCtGgPZq52Lj0ijntBsxfskC324i2k4,616
|
| 435 |
+
babel/locale-data/fr_CA.dat,sha256=Nu60QdYyJaiQnz1EbBLSWIO86Rf57q3FWoU7ywZMKQ4,72420
|
| 436 |
+
babel/locale-data/fr_CD.dat,sha256=HWaY-wrLseHcf0fGlRkAWt118iQjRZaTGlqs7G23ZrU,1138
|
| 437 |
+
babel/locale-data/fr_CF.dat,sha256=wxzk0Nf6_pKO2VDivQprUY9WvaxRSkrfQBoUE1UVrAA,616
|
| 438 |
+
babel/locale-data/fr_CG.dat,sha256=zP3HTP-nqZjG-OD_DLrDEPPbB3t9g4T2kHVzI-HxhaU,616
|
| 439 |
+
babel/locale-data/fr_CH.dat,sha256=DiO5jczUyCwTWpWSoxVHE6kLMXQPru-XotJQLDInjKw,2876
|
| 440 |
+
babel/locale-data/fr_CI.dat,sha256=TrHL8hQRuJI3Auxe3aTHYa_rljyUvT_s0q-jdSJflJM,616
|
| 441 |
+
babel/locale-data/fr_CM.dat,sha256=31oDAmeRb3F8a4fvVn1QJyIbrla04w8kfC4oQO0vwkk,1970
|
| 442 |
+
babel/locale-data/fr_DJ.dat,sha256=Jqu2FOJQD41B6fLSBEc_Wf-dIQ-B6MWlT0m1buQnmxo,1248
|
| 443 |
+
babel/locale-data/fr_DZ.dat,sha256=uOe9lbjO51q30G0UMs5nKrMLta5CtLW2Fg4dvsfRX3M,1290
|
| 444 |
+
babel/locale-data/fr_FR.dat,sha256=bwtjtv0NG-lxlXO7fJd6r--l38WKaQmqlmn7PpXJdJs,653
|
| 445 |
+
babel/locale-data/fr_GA.dat,sha256=rMwS-msXjMO5T5k1BP2B2S9B_dYvDHlP8HMS-Lq8XU0,616
|
| 446 |
+
babel/locale-data/fr_GF.dat,sha256=x97-H7H0h4_MUTpjMdrkYB790vBvPKKxmnUTu-FOwLg,719
|
| 447 |
+
babel/locale-data/fr_GN.dat,sha256=6KVlBWrF76ZhgyYg47F1TcR8_fbE5Ii2pJzPhmbr3Pk,636
|
| 448 |
+
babel/locale-data/fr_GP.dat,sha256=W99xHjqPQj_NJ1X34ismj8A4xeZcHu_vyqH8tIwXgeI,653
|
| 449 |
+
babel/locale-data/fr_GQ.dat,sha256=Ogf5NI4zMvbVROeIb8F6h1NxJNKOqY4fKU6G2SPJXDk,616
|
| 450 |
+
babel/locale-data/fr_HT.dat,sha256=S2Vvt2b9Wu4dY5Tsd9xxFAx_RLcWXCGf_XeSSQFYbKQ,1836
|
| 451 |
+
babel/locale-data/fr_KM.dat,sha256=ChLpzCyulxYg8Qmm5HK8YkK203GRSUEBNPSl8war7lA,636
|
| 452 |
+
babel/locale-data/fr_LU.dat,sha256=0sYBhn8-9lvfOrU-ZEIbnO5v03qQOQq4wXCKp70b2sw,729
|
| 453 |
+
babel/locale-data/fr_MA.dat,sha256=Um7dK7MvHkPB_h_r0pk47rMFCng1LWFgIekS7cDX9ZE,1098
|
| 454 |
+
babel/locale-data/fr_MC.dat,sha256=IfTCZ89rqHzUxdKyIz86Zs_VUH2zc5JAvntdhyKsNR0,653
|
| 455 |
+
babel/locale-data/fr_MF.dat,sha256=xU0grNJKWgpfArwpLt7vuOpSTSkyPx3o6gFkmZLCxd4,616
|
| 456 |
+
babel/locale-data/fr_MG.dat,sha256=A9zYBbE6gIWuGDPxv92ReIcR49gtIEYaEkCj9ZONHHI,636
|
| 457 |
+
babel/locale-data/fr_ML.dat,sha256=-PoWsHBtnaZisIOqZyaEFmwooRXb2R2xEMe6DYad_sk,1153
|
| 458 |
+
babel/locale-data/fr_MQ.dat,sha256=45qWAev4p2ZaFVky1Qlrw5q907PDfbRJq9q2UACahm8,653
|
| 459 |
+
babel/locale-data/fr_MR.dat,sha256=mVSOABz3cRa1-HEeUKW13sLw1ZR6PmB9h_DPfZsK4Uc,1228
|
| 460 |
+
babel/locale-data/fr_MU.dat,sha256=c4ERuS1GI8h7waxcW6BRtloW7BThLlgqdYTf31Ioh_U,636
|
| 461 |
+
babel/locale-data/fr_NC.dat,sha256=Su2DaGZPnLCaONmgosMYke9kH6dP8xJ8wJF6P5xrJq4,616
|
| 462 |
+
babel/locale-data/fr_NE.dat,sha256=D6ghYGdDXlhaVQ5gAr8wWHxEHYR7mBs0QaiNL5nfxWM,616
|
| 463 |
+
babel/locale-data/fr_PF.dat,sha256=oPN2EBo1hpLjlpDYPB51qEAx_4HNMWG5-Bh9JN6Kal0,616
|
| 464 |
+
babel/locale-data/fr_PM.dat,sha256=gEP6Ay7r-p7uIjOGXP8eCa62yujlTBntENdeNd9KKes,616
|
| 465 |
+
babel/locale-data/fr_RE.dat,sha256=pxNaLi-BUbe3E-Xf5ZXPoeut9NdT0D9OGEgmoSWZEr0,1055
|
| 466 |
+
babel/locale-data/fr_RW.dat,sha256=gP8mpM7gx_X_9NKDm8B9PuTg83jwT5Nn3NOKPpVhi3w,636
|
| 467 |
+
babel/locale-data/fr_SC.dat,sha256=qvz0N08LKCsPCPDZK1NmAhhzmaszBQ8mSlDbAsEwAoI,636
|
| 468 |
+
babel/locale-data/fr_SN.dat,sha256=n6ijBmMl-ztuCLSePI-Q3yIyhzejn7KvRw5ZqjDoXsA,1018
|
| 469 |
+
babel/locale-data/fr_SY.dat,sha256=tpDovgZ3aK7OumRwbntHTknV-tRL_HjcPK1aQINC-x8,1290
|
| 470 |
+
babel/locale-data/fr_TD.dat,sha256=1H47veWKRj_iV9CxHMz7x7tfrL8IYdQaRWhTV455efw,1208
|
| 471 |
+
babel/locale-data/fr_TG.dat,sha256=r_E5Vnj0Kb5CG16ApHFls4UreDeO7-o3uzpQdJjpbRM,616
|
| 472 |
+
babel/locale-data/fr_TN.dat,sha256=hcGRJ2UjuFEFJqb1BDglGsXY8jCEIdM8--OrU3OqRhc,1228
|
| 473 |
+
babel/locale-data/fr_VU.dat,sha256=FYYsiaoM8QZeClMnQzLiLZNXW9hULz-rCgRTYWvrIvs,1228
|
| 474 |
+
babel/locale-data/fr_WF.dat,sha256=jn6VFRw_qpJFxpO-I6C9nhz_wRZ8cV2b2XRBgSzi710,616
|
| 475 |
+
babel/locale-data/fr_YT.dat,sha256=x0WpQCLoqrLY3_nCF7JlcuekkoUtcpE4llC8kRmeRmY,616
|
| 476 |
+
babel/locale-data/frr.dat,sha256=Itmd93DOwAMGcTkWE83BWDS1oXEVckX0EE6mSiOKyoA,102994
|
| 477 |
+
babel/locale-data/frr_DE.dat,sha256=2ohnodzECbJBUTEta36Ts4amZKl2_LDhuD0-Hu5JBo0,654
|
| 478 |
+
babel/locale-data/fur.dat,sha256=pvg46WO2uwbg27leWyWYXkoqYFiaE1u9Txsd_iZJeC8,32441
|
| 479 |
+
babel/locale-data/fur_IT.dat,sha256=PpDH1opUDjndOtvpPadiOtITGyGxKZY0ziEhb-4HKbE,654
|
| 480 |
+
babel/locale-data/fy.dat,sha256=zJce96OaCoG-oKfhQFisyjgVEK3pNVtF9RT-f9h7y1g,108200
|
| 481 |
+
babel/locale-data/fy_NL.dat,sha256=I_M2hFVCAaVAL90yVMloW2eYmzO5C3NZztfEDAes3_I,653
|
| 482 |
+
babel/locale-data/ga.dat,sha256=rx5MLgtNUisB9V7gu0e2dNyCXF2H9KhLVULuYvLNUh0,261523
|
| 483 |
+
babel/locale-data/ga_GB.dat,sha256=NKphVJhmH8egga1dgfO-hSRVFhbxms2JvGMU3ybgj_Q,653
|
| 484 |
+
babel/locale-data/ga_IE.dat,sha256=P948T1Tl4B7kL1T-uxii27q4IWO3yQQ5emTLv7iHvW8,653
|
| 485 |
+
babel/locale-data/gaa.dat,sha256=W9tUKmjglnSUxVlpiGA0clKmagjmzgF1Fwj_UPmg8Ik,33806
|
| 486 |
+
babel/locale-data/gaa_GH.dat,sha256=FF7vo24vzA2ru3t8py246uanyOqyoSkpD65F7KFTXlA,617
|
| 487 |
+
babel/locale-data/gd.dat,sha256=AtSvR97H05LvFNLHpLsb7tOgKYaOjYvWFOLaDDH6xMk,280763
|
| 488 |
+
babel/locale-data/gd_GB.dat,sha256=weaRul21diYZoqLk7SXacBy8GD1bH30cQO6AHejilPM,653
|
| 489 |
+
babel/locale-data/gez.dat,sha256=6gIHA3BFc3-A6-dOq0pc6bqP2ej6kmG9Xvwa0EEhoMo,12743
|
| 490 |
+
babel/locale-data/gez_ER.dat,sha256=MKpSW7Upkpe42Q2mbJStbjtnrW6Kyo8Tg0zXAxnHWqM,638
|
| 491 |
+
babel/locale-data/gez_ET.dat,sha256=93QTSMihpcfFyRhttFplgAcsAhzrPjlbrz5HI4feRSc,636
|
| 492 |
+
babel/locale-data/gl.dat,sha256=N2zvS1gg8f3l6SOLqIIiKCBsbxAcArFclISemEyGx7Y,153642
|
| 493 |
+
babel/locale-data/gl_ES.dat,sha256=us8xWRQnNTO_KC42-FOU2cnLCNl96591qnxZ4exq5Fc,653
|
| 494 |
+
babel/locale-data/gn.dat,sha256=2CbBgzd3kHlm8uIpKVV3yurmEXB_yNUfM2NKTFV95dU,2477
|
| 495 |
+
babel/locale-data/gn_PY.dat,sha256=tArgCo85T_BUNmPc4sXVRz8X5wcHJmBS6XP0r8dPgA0,635
|
| 496 |
+
babel/locale-data/gsw.dat,sha256=TGHS38pKauNWMdFFsCyCJ_9p17aLt14jMA56gxTDBM4,95265
|
| 497 |
+
babel/locale-data/gsw_CH.dat,sha256=fQlRCd1MJ_gI6rcnkrU-lUE7ZM4syRLh-suMRT0DCOk,654
|
| 498 |
+
babel/locale-data/gsw_FR.dat,sha256=vHNQ1q9Zyf6xLfsJpmqpaX1iHerMRt1dsJSPQdQDoTE,654
|
| 499 |
+
babel/locale-data/gsw_LI.dat,sha256=dsg7TA7MECMrbTXC7i7zXIjrEoqrF2jZ_ckGiTMholo,654
|
| 500 |
+
babel/locale-data/gu.dat,sha256=5A_T6q__RzuWdGg9Sfte2wOqRw_Adz-LJMJJzFJ87cg,208242
|
| 501 |
+
babel/locale-data/gu_IN.dat,sha256=shXUMyk4ogB8uJPazALoReGyLqRXSYOeVBVMn313_Y4,658
|
| 502 |
+
babel/locale-data/guz.dat,sha256=491I3x6EkMG0roSEKI3sHxtaweXWNXhXyk4vsG-LzDg,15427
|
| 503 |
+
babel/locale-data/guz_KE.dat,sha256=Uz_x0_YFKJHDkSd46SvuIfO7W0c-uqYnasmmLNib3WU,636
|
| 504 |
+
babel/locale-data/gv.dat,sha256=Ye3v_q7SrnCeiOVw1r7NRcTtUZ3RwOr1ZKs6skxYTos,3960
|
| 505 |
+
babel/locale-data/gv_IM.dat,sha256=bXOsSoV303kSUECHz2xd5HhASRI-XCjqjxnxpk0Bt10,634
|
| 506 |
+
babel/locale-data/ha.dat,sha256=fVfNqCuIXaCTV5E9XNMNVROCwgalJ8f4MKfEvKun3Ao,150526
|
| 507 |
+
babel/locale-data/ha_Arab.dat,sha256=AUoCyyrZDTrf5SEZ2SRizimC11NMSCyonIkMRer1PxY,2197
|
| 508 |
+
babel/locale-data/ha_Arab_NG.dat,sha256=oYJYqTkaDX2p4IJ9j3sEJT49dcVn_f9JyjO0rUJTmAc,616
|
| 509 |
+
babel/locale-data/ha_Arab_SD.dat,sha256=7DD6pzCmpEdjwbTMAbAb_vJey6Qh0tIeSs8LjEpJxBo,678
|
| 510 |
+
babel/locale-data/ha_GH.dat,sha256=Cwfuh0nEMJu4LGZmdOXJHp_5fZRdpTIODJ_Tpd83uPM,1231
|
| 511 |
+
babel/locale-data/ha_NE.dat,sha256=glKzRtSaovyoiyBc-vjFbJ0wNuxfga49w_zeK3ANtvU,616
|
| 512 |
+
babel/locale-data/ha_NG.dat,sha256=oYJYqTkaDX2p4IJ9j3sEJT49dcVn_f9JyjO0rUJTmAc,616
|
| 513 |
+
babel/locale-data/haw.dat,sha256=aNXNxqponTYIxzV21MX0jIzG73qbhbNO6px2WGael6o,10375
|
| 514 |
+
babel/locale-data/haw_US.dat,sha256=W2qJBTNdETpoN-Ue0UYbqyblj-gIbQNOUMr01RwJ2fw,654
|
| 515 |
+
babel/locale-data/he.dat,sha256=o6AACO6FcY_o6bcUuLkcWgbWIT77K8N8BTBDLY0hk7A,217062
|
| 516 |
+
babel/locale-data/he_IL.dat,sha256=KpQ8sod_QOZ94Tr0tfhlATzVVsrqXck6eq7txoQgCbc,678
|
| 517 |
+
babel/locale-data/hi.dat,sha256=-uw13ozTXWlo39eLvIBYrfQxDROzFOdwmI5wXU66n9A,221948
|
| 518 |
+
babel/locale-data/hi_IN.dat,sha256=UMkxSHgYSdX-hPgYa7rOOzft7xtJwcM0m5nTphUe9xM,658
|
| 519 |
+
babel/locale-data/hi_Latn.dat,sha256=Dn0MJdILlsVYU9R5BJFSPGGr1a35jF4k9ebJMKLX69U,30945
|
| 520 |
+
babel/locale-data/hi_Latn_IN.dat,sha256=UMkxSHgYSdX-hPgYa7rOOzft7xtJwcM0m5nTphUe9xM,658
|
| 521 |
+
babel/locale-data/hnj.dat,sha256=ryXdpBMEUzFyZ_u_YiqAK689QOsEuUO_Auyuhty_4jY,2117
|
| 522 |
+
babel/locale-data/hnj_Hmnp.dat,sha256=6GekZXtZVXtGcI_zk6NqXq3WxMnOx83IpRlJOyUws6s,746
|
| 523 |
+
babel/locale-data/hnj_Hmnp_US.dat,sha256=OydEowg2bNVks5nd5ij7ZJqqQT0ztYv4HL1ZZ4gNajw,654
|
| 524 |
+
babel/locale-data/hr.dat,sha256=kdzKpWmyLAIFw7D5DPKG7aHUQjYlM5fctcBLRoHeujg,207636
|
| 525 |
+
babel/locale-data/hr_BA.dat,sha256=E_S8FRdn0yszTWFg9RlqTV5zEwCc7-qtod45Ud8LHyI,1188
|
| 526 |
+
babel/locale-data/hr_HR.dat,sha256=PqaNYKNdTFgfgmeiINdYp2d3q8qpfkCUs1y4ZHmsphA,635
|
| 527 |
+
babel/locale-data/hsb.dat,sha256=w5bDS336hxU-RChl4QgaayXgMgN_VBUh5GJXznPI_Bs,206887
|
| 528 |
+
babel/locale-data/hsb_DE.dat,sha256=_ELT9KBswSqeyiwbcsP9nFY793FE8PQzEu_2w78Amro,654
|
| 529 |
+
babel/locale-data/ht.dat,sha256=WTxEmIzmX4quBNzQMm0nY3afRvD44p7KBr19xZN_t3k,812
|
| 530 |
+
babel/locale-data/ht_HT.dat,sha256=XR94sLQ8B6jF6SPd_4R6GGLmQQZGe8IoGSDnMYNIT9M,616
|
| 531 |
+
babel/locale-data/hu.dat,sha256=dmS-7GInw1eGbifjgMyXc1m1nBg6dK6IOJIDoLb_Epo,147032
|
| 532 |
+
babel/locale-data/hu_HU.dat,sha256=r3RZskHfUdk1Ba226wqBHAoRMXorlh-IkWLlnY_mBTs,653
|
| 533 |
+
babel/locale-data/hy.dat,sha256=R6n2G8QdkkxlAxBgpTK7l-cPhwHg03vIG1pwmWVrCV4,202316
|
| 534 |
+
babel/locale-data/hy_AM.dat,sha256=r1Bb6WWX2QxVlLP5vRVgox0HgoDOosA-h3oYKLeZMIY,635
|
| 535 |
+
babel/locale-data/ia.dat,sha256=Wa4yDTDv9TA2Imo69v_49GqgV8LvQP1iuWGq6LFAMOk,133538
|
| 536 |
+
babel/locale-data/ia_001.dat,sha256=fzAkHPu7PNj2TOl-kQcJLIdlEK6z-KfVFUVcy-YF5Zg,941
|
| 537 |
+
babel/locale-data/id.dat,sha256=CfCCzK3VV98obeH7x1Ueax-xYczfCwextwJ7aetTQ5A,126977
|
| 538 |
+
babel/locale-data/id_ID.dat,sha256=GvwO35RP_Y8vswE60ItYMQa7XUOBXGLk8tvL8kSJkY4,635
|
| 539 |
+
babel/locale-data/ie.dat,sha256=9nzS8srJ9Mze83D7nKqXSlGvjOtu7utOyAJCLaffEm4,77957
|
| 540 |
+
babel/locale-data/ie_EE.dat,sha256=93dmapYNE5HEAfIRwL_HjNV4fpCJhy1CseggbriCXL0,653
|
| 541 |
+
babel/locale-data/ig.dat,sha256=ts_BawFD_ves9B7kX6GAIxwBY8FP4jNmkZidIdAVaDA,78550
|
| 542 |
+
babel/locale-data/ig_NG.dat,sha256=2MR603ed1L8Y_aZhXPk7K7J8bgQPE4xvvpn8R9Jodiw,616
|
| 543 |
+
babel/locale-data/ii.dat,sha256=WBkpukOuFcoryzq0QnHhdafGfad_u9vdJy0JO9vo-iI,7477
|
| 544 |
+
babel/locale-data/ii_CN.dat,sha256=Vr_Oe23kFnz-EDfl7XeDv6GeTY0LSK-VV6UJpzU8yJE,635
|
| 545 |
+
babel/locale-data/io.dat,sha256=laqBHV7QB933VjLibEOmRezXV9StwhKVzKvWp8e62YA,932
|
| 546 |
+
babel/locale-data/io_001.dat,sha256=T6zZvvSVOcdpy3fhXbdPAWmHCvDTluick2U8_hUDu2E,912
|
| 547 |
+
babel/locale-data/is.dat,sha256=r9gnQpf81NqPVskVKUiSGWa6VU3_NXzJcna1Gho28d8,163097
|
| 548 |
+
babel/locale-data/is_IS.dat,sha256=f3tUj_oYhQ6_tGnn8yda4PZfqChiHmcZXo_nMDCtzSQ,653
|
| 549 |
+
babel/locale-data/it.dat,sha256=n8pxKaMuS2ekD7EOSV-3PmVfdzm9NqxF5zA073x5itU,173579
|
| 550 |
+
babel/locale-data/it_CH.dat,sha256=Tvtge1s4BcbCeKJmPBiSbtbf_qv8wrw3Eb4Dc1sF3dE,2942
|
| 551 |
+
babel/locale-data/it_IT.dat,sha256=-e6EK0A6gEd_G4_BHlmd8_caQ-k_JrEemNgdA0czhsQ,653
|
| 552 |
+
babel/locale-data/it_SM.dat,sha256=xjE63TohE8bjkNiOh-BhOkuB9YWpQ0n2rrBMJoAql5E,653
|
| 553 |
+
babel/locale-data/it_VA.dat,sha256=wwsl_eAmNu9m2JPZnpBwFVh4gsk5AM9lSx8UAXhrMlE,653
|
| 554 |
+
babel/locale-data/iu.dat,sha256=vZIG1AsqwcrTA6zfwBeQydVAn5qDQXT8yTK8wvbaVAA,3209
|
| 555 |
+
babel/locale-data/iu_CA.dat,sha256=C449KxuskTW8w7z56Vv602QRYsQ90O0WbazR7VqlDa8,635
|
| 556 |
+
babel/locale-data/iu_Latn.dat,sha256=oYsdWLomYvVJg6kIQIKYOdSGWyrEHftc2U9bZ0sHFD8,904
|
| 557 |
+
babel/locale-data/iu_Latn_CA.dat,sha256=C449KxuskTW8w7z56Vv602QRYsQ90O0WbazR7VqlDa8,635
|
| 558 |
+
babel/locale-data/ja.dat,sha256=86xPBOY1H1e0fLC6g_61R_ipS4QGbB9sXst_JwwdAWo,179695
|
| 559 |
+
babel/locale-data/ja_JP.dat,sha256=o2pbFmlkEZjV7CHE9cYENYVv2kQA8texhNDhEecgQ9w,635
|
| 560 |
+
babel/locale-data/jbo.dat,sha256=2eB9ymOoFb8abB-v7ISAGcAg4HEEMmpuseHIXFgtqkU,1008
|
| 561 |
+
babel/locale-data/jbo_001.dat,sha256=wwLKEXJOwULYD-q92kQdvpiwW2fgis5YcsP2mT4tnT0,746
|
| 562 |
+
babel/locale-data/jgo.dat,sha256=9X63SqWqQ7TK7Z2RKaQwFBP9sMog_4cQN5Sr_KBlyL0,9031
|
| 563 |
+
babel/locale-data/jgo_CM.dat,sha256=1lDyjZLpK6fS6oSpfnVLdYd2IUgGlUQfF53BDdK7TLY,636
|
| 564 |
+
babel/locale-data/jmc.dat,sha256=lRstulkfCj6kDI8VLH_3GS4awAqVsylMU1hvvWH7kJg,15374
|
| 565 |
+
babel/locale-data/jmc_TZ.dat,sha256=fODp_OsVygbH0UoRsx4HHcXrde02bRKc-hy80sDkcK4,617
|
| 566 |
+
babel/locale-data/jv.dat,sha256=SucM3ZDoHXO7PsbOYNLdx0UmQqWUll2i1hDqn-zJY9U,103138
|
| 567 |
+
babel/locale-data/jv_ID.dat,sha256=G3zTSeqWMngemp5lAcghudTcv-i8egZS12P0-T1DNXw,635
|
| 568 |
+
babel/locale-data/ka.dat,sha256=dIskDjc7ZdRZ1rGJIHxOP_47WO_cdjLDx4eltYETbUE,230234
|
| 569 |
+
babel/locale-data/ka_GE.dat,sha256=zzw4NZBk8dsHIBeEzB3Vtf2_1nC4DhqblLoBUXfNHN8,635
|
| 570 |
+
babel/locale-data/kaa.dat,sha256=KjLQ7_UT8pqVmgqy5BXJHe9hbPceKi6AIyefM4_0pYU,17585
|
| 571 |
+
babel/locale-data/kaa_Cyrl.dat,sha256=zW7tFPX2CPo0NwR2o1DCKu8Tsvm-Aef9RAuy6AcaJXs,693
|
| 572 |
+
babel/locale-data/kaa_Cyrl_UZ.dat,sha256=DugGAZvImbUSHvvGmGw0ekXXBj34vEjSkHhSxVXbc-g,636
|
| 573 |
+
babel/locale-data/kaa_Latn.dat,sha256=zW7tFPX2CPo0NwR2o1DCKu8Tsvm-Aef9RAuy6AcaJXs,693
|
| 574 |
+
babel/locale-data/kaa_Latn_UZ.dat,sha256=DugGAZvImbUSHvvGmGw0ekXXBj34vEjSkHhSxVXbc-g,636
|
| 575 |
+
babel/locale-data/kab.dat,sha256=ykLRvdRtHpY8y7JDHOgC03KxAyvAfxzYQUl44CKKr6s,121528
|
| 576 |
+
babel/locale-data/kab_DZ.dat,sha256=v6fd0kyletm1kfN2ibSUh6oddckpLHjPd_qrq6FQpd8,679
|
| 577 |
+
babel/locale-data/kaj.dat,sha256=tKKi4eYHT0zEJLSHi2DefEGyTTu4RCKpnANu7NQhAPg,2696
|
| 578 |
+
babel/locale-data/kaj_NG.dat,sha256=1RODrBAPxCrrlTgfhpdz-VxQkTdjJEJYHaJEsOgQsNk,617
|
| 579 |
+
babel/locale-data/kam.dat,sha256=br3FOMP0rS2tAq1tSXwYq197v2XXHqWtX_TM-39QP1k,15506
|
| 580 |
+
babel/locale-data/kam_KE.dat,sha256=8AQQhHQdaI4rBKXfTivg884XIDfZlbDEQM28KwvB2Og,636
|
| 581 |
+
babel/locale-data/kcg.dat,sha256=dOZR1bP8sPbhD2Mk496Twz8MOivgGQoliuDMAWSO9fY,2549
|
| 582 |
+
babel/locale-data/kcg_NG.dat,sha256=jCObRZa-t9Khgx_M8ps0PLbeit7rPCFtHeCOhtfCnOY,617
|
| 583 |
+
babel/locale-data/kde.dat,sha256=cFVUYeayn6-kMX6PwQQ3J8rpHMql07_V7lSluInC2x8,15810
|
| 584 |
+
babel/locale-data/kde_TZ.dat,sha256=2sfb3gejYM15YtZeRrc0AJgdaJhqgbVJ9c9yF9SlJmg,617
|
| 585 |
+
babel/locale-data/kea.dat,sha256=o2awnBismFEWQemtUPASmZMVLlOkJNDtuD6egmvMatw,76097
|
| 586 |
+
babel/locale-data/kea_CV.dat,sha256=LyzxPE6yP0f9hdD4uvu8CvEp8nmcmRDVuRI8YxBQ5wM,617
|
| 587 |
+
babel/locale-data/ken.dat,sha256=PMrEuqYRQIhbpP2dPowHOL_NKKFpEBd8qNUV_NpZnDw,719
|
| 588 |
+
babel/locale-data/ken_CM.dat,sha256=jNEojAAtQqJMkEq84kxHU5hGOVQCOW_hnGQScxycYMo,636
|
| 589 |
+
babel/locale-data/kgp.dat,sha256=OKx1ZbBdHw75AdzrT-petm32Dj8wJdtUQH_oai7v0qI,184092
|
| 590 |
+
babel/locale-data/kgp_BR.dat,sha256=FNSYAqPhkzoZzholxTydgasgkuw7jgxCfyKDbeRiLt4,636
|
| 591 |
+
babel/locale-data/khq.dat,sha256=OcW4Zprt-WlTePo7DzquB-yS8vwfPqjaijpkrX5l75w,15753
|
| 592 |
+
babel/locale-data/khq_ML.dat,sha256=ViqThOcZTHZBtebV8LJY-DXdWVX5jAR5pdlBrTKws2Q,617
|
| 593 |
+
babel/locale-data/ki.dat,sha256=vffpb6Wy7TN__hZQH1SJYi81AxamhBnEK_XBCiF3OFc,15451
|
| 594 |
+
babel/locale-data/ki_KE.dat,sha256=PNoxhP-WLxW2vH3fS8N9Nuy0tVimMP-ZAaCfLfnfDN0,635
|
| 595 |
+
babel/locale-data/kk.dat,sha256=93jtpKcfiQBRbyeOyJgqETZXGOntosB2nGedgHShM1w,200871
|
| 596 |
+
babel/locale-data/kk_Arab.dat,sha256=TBsZm6iLJ_dw2mNxDdQk95jELZ87mArNl12iktCwKwo,222820
|
| 597 |
+
babel/locale-data/kk_Arab_CN.dat,sha256=HCoaBi32ENdpJx5usXdBR9aR__MHFeKV-wTo_53tQNk,635
|
| 598 |
+
babel/locale-data/kk_Cyrl.dat,sha256=z3n_4vbUD_OcZhi9Tm8vkSu9h4RUgavZ_CFrujFbuWE,1584
|
| 599 |
+
babel/locale-data/kk_Cyrl_KZ.dat,sha256=eaQW7Va1z2L34hs-D9QgrmyvOo4Lpy2uxxvxms6kL4s,635
|
| 600 |
+
babel/locale-data/kk_KZ.dat,sha256=eaQW7Va1z2L34hs-D9QgrmyvOo4Lpy2uxxvxms6kL4s,635
|
| 601 |
+
babel/locale-data/kkj.dat,sha256=IYeF4Uoeb0kfxooFLFcqmdIwGWbWh0MUfBpztTxWFEw,3373
|
| 602 |
+
babel/locale-data/kkj_CM.dat,sha256=gqHwzVPG_Lo3svaIVe0Kfhj4DaKtstOxJJhUGvvpSbI,636
|
| 603 |
+
babel/locale-data/kl.dat,sha256=D8SSjxLZliXOxyTxpC1x7jYbFQn4WbSV3lfotFFt3Jw,47570
|
| 604 |
+
babel/locale-data/kl_GL.dat,sha256=c49k11GtBG8-vExsQNo_d1pFaQm0LYmXl7QcMSTEApA,616
|
| 605 |
+
babel/locale-data/kln.dat,sha256=pldtRERWUhEOA85_zeFJfshpMl6gtgdELjGyNGtJzOo,17427
|
| 606 |
+
babel/locale-data/kln_KE.dat,sha256=ZhkKgZ2lTdWAvWVOJEFlp4ASvjk2hcyTc2_P9s3mykQ,636
|
| 607 |
+
babel/locale-data/km.dat,sha256=TueDML7PuHjlME0Bew9xgkFSFIxBOsJTzpMwyjyvuXs,176653
|
| 608 |
+
babel/locale-data/km_KH.dat,sha256=bnykdq-RYJ0ZwajV5dFBVtM4anVkLjXutFdUxKByQ2o,635
|
| 609 |
+
babel/locale-data/kn.dat,sha256=n0AHHLkpl4FIYeiSCEMDJF9mFr5nCgHcV8HSCOKz8yw,267281
|
| 610 |
+
babel/locale-data/kn_IN.dat,sha256=rx1LJYeAP8xU6MIU3yhHLuije5OQWL_wzz5glztIdi0,658
|
| 611 |
+
babel/locale-data/ko.dat,sha256=tYIinjTM5ZLw-AvWerUR8h4FRQ09LGfoRNyutl2iMLI,154621
|
| 612 |
+
babel/locale-data/ko_CN.dat,sha256=U_q1api28ucaC-ABOBb822CgSq4nywhMN02uS7TCREI,1187
|
| 613 |
+
babel/locale-data/ko_KP.dat,sha256=BCMOKQSzXNnjAUWfZZ8pbFoSDBed9tnnatyqIePNWio,816
|
| 614 |
+
babel/locale-data/ko_KR.dat,sha256=CJqKij0oULIeCIG8McohdnhEsfJxUwmJHOpJY1bLrNY,635
|
| 615 |
+
babel/locale-data/kok.dat,sha256=1pS0SXgetR-9DHtL71PAw2VIRp51a9KfxoSnw3BoxFs,179992
|
| 616 |
+
babel/locale-data/kok_Deva.dat,sha256=EP15THeV74hd5G3DDXlwIHzxQvpECa67TioBGaur3l8,693
|
| 617 |
+
babel/locale-data/kok_Deva_IN.dat,sha256=GiRy8Q6VCULzgIxNPFEZzABKOg13Un-DblBwXnBSeEk,659
|
| 618 |
+
babel/locale-data/kok_Latn.dat,sha256=jVrQX1SeylbWO6B3ana7r9r1sRvMyOvBVwPfyXxB4uM,29867
|
| 619 |
+
babel/locale-data/kok_Latn_IN.dat,sha256=GiRy8Q6VCULzgIxNPFEZzABKOg13Un-DblBwXnBSeEk,659
|
| 620 |
+
babel/locale-data/kpe.dat,sha256=AHR_ZG1p518D4yulM_cs5E58iMsVXKk4Hi6k0V0IDhQ,1331
|
| 621 |
+
babel/locale-data/kpe_GN.dat,sha256=7eabSFmszupn0IlzP6TRg1-7FZS9AB3JdBkDgJtIs64,1210
|
| 622 |
+
babel/locale-data/kpe_LR.dat,sha256=4O2gzHn_orogC0qOiIyIox-JjyA73hEAe_fZ3Fj5tYc,617
|
| 623 |
+
babel/locale-data/ks.dat,sha256=KySSApsfBfxM26TaXsK2gChd3noV1e5l41gUsaC3DA4,111691
|
| 624 |
+
babel/locale-data/ks_Arab.dat,sha256=fzDL_rCiC-BqymPhF6GBX-d5uVkvZCE4e8JS2L8cjRU,850
|
| 625 |
+
babel/locale-data/ks_Arab_IN.dat,sha256=-OE8PBigMDH8zQrxiaffmabm91Mi8-OVdDR2JEK8xPA,658
|
| 626 |
+
babel/locale-data/ks_Deva.dat,sha256=weXN4SV8247g4MW8R7MHXM6sKk1qhf2Wmowls_zowAM,12510
|
| 627 |
+
babel/locale-data/ks_Deva_IN.dat,sha256=-OE8PBigMDH8zQrxiaffmabm91Mi8-OVdDR2JEK8xPA,658
|
| 628 |
+
babel/locale-data/ksb.dat,sha256=vbB4JVStmpZIu9_vi6f9-Dt40sN2wPvF9Y2JzJJ9oEY,15356
|
| 629 |
+
babel/locale-data/ksb_TZ.dat,sha256=PvWBMUhpMhV27zE9BCEJW8oMqRXWK-6VwmSsXZDMTPY,617
|
| 630 |
+
babel/locale-data/ksf.dat,sha256=IIgvqtnlTxMmLSk38JyZe0PA5gLEX86ZDcaVIULp7Zc,15952
|
| 631 |
+
babel/locale-data/ksf_CM.dat,sha256=0OOsuUS0S_AUxUPySFQOZVbPcB3F2I4yzHZm63YypDU,636
|
| 632 |
+
babel/locale-data/ksh.dat,sha256=M6W02xiGUibDW13RIB7psbwMA2wdNYQHz3Bp9XljhZ0,76781
|
| 633 |
+
babel/locale-data/ksh_DE.dat,sha256=EhgYIJQaC3LGiWrcE2sdfUC8LOWJnciWORi_yoRkOvw,654
|
| 634 |
+
babel/locale-data/ku.dat,sha256=beByrhXjB8iRhaNGxkQaxnUckutus3MJ61Pm-Ro8SqU,117087
|
| 635 |
+
babel/locale-data/ku_TR.dat,sha256=LoNyoL-poYXgqejDzB9-zI_0TIJF3amwyzcs6UnHUII,635
|
| 636 |
+
babel/locale-data/kw.dat,sha256=x5JFxfv4DvLd5Xnq5J7JlbcffhYNXwIn5-Jp3Q5QV5A,7242
|
| 637 |
+
babel/locale-data/kw_GB.dat,sha256=ol7LWhJJFNoNkFEjtk4x1PpLkML9UbuVmZAuG47LokY,653
|
| 638 |
+
babel/locale-data/kxv.dat,sha256=AMdZKJIlfkcpSetPdGRHX8LLN0O1s14NAtDzekSi01E,69503
|
| 639 |
+
babel/locale-data/kxv_Deva.dat,sha256=MlejiNswS_LJAemj-vyEyvXc2SyminqNCWbaq3eceKk,86834
|
| 640 |
+
babel/locale-data/kxv_Deva_IN.dat,sha256=Z43Yc1G4Bsmu7KukFfgXfIl1Cq2Rqa7RQQNYygE5Aak,659
|
| 641 |
+
babel/locale-data/kxv_Latn.dat,sha256=XqtuF9yh0tBrDPoRpZj_1Mw-QUqt98klOlgZXh7qPus,693
|
| 642 |
+
babel/locale-data/kxv_Latn_IN.dat,sha256=Z43Yc1G4Bsmu7KukFfgXfIl1Cq2Rqa7RQQNYygE5Aak,659
|
| 643 |
+
babel/locale-data/kxv_Orya.dat,sha256=lsjWswZU3LWmYNE5tLn9cla-WSbdfqAoltC_OvxtR28,85964
|
| 644 |
+
babel/locale-data/kxv_Orya_IN.dat,sha256=Z43Yc1G4Bsmu7KukFfgXfIl1Cq2Rqa7RQQNYygE5Aak,659
|
| 645 |
+
babel/locale-data/kxv_Telu.dat,sha256=rXJrWxHMFrPeheoNt9NvKLzNoGLpNXiHpc4PsuS4tX0,88218
|
| 646 |
+
babel/locale-data/kxv_Telu_IN.dat,sha256=Z43Yc1G4Bsmu7KukFfgXfIl1Cq2Rqa7RQQNYygE5Aak,659
|
| 647 |
+
babel/locale-data/ky.dat,sha256=PAH_ov1xcnJAie5ltB3I_XAUJsrE_8tFwFlOjorRBts,179889
|
| 648 |
+
babel/locale-data/ky_KG.dat,sha256=CdtjRR2iZgfG5pdz13MX-EHTDtN6BdLeZwGCmrZnrkU,635
|
| 649 |
+
babel/locale-data/la.dat,sha256=nJ1hfe-gN1dlNH5qawfkwjv0bNzefm7UCEwnYv1O6ig,33837
|
| 650 |
+
babel/locale-data/la_VA.dat,sha256=dhULocaXyJGitrljd1w688DTmezcmmY8YcoKsT30n34,653
|
| 651 |
+
babel/locale-data/lag.dat,sha256=mtjtyLHLCfoUr4STtBqLXOxLnZ0igugTC9fZiyJZk8E,16281
|
| 652 |
+
babel/locale-data/lag_TZ.dat,sha256=LlfEls8DDvoVp07MYnFdLBPUhkJs2kzwUDk45BZIO-g,617
|
| 653 |
+
babel/locale-data/lb.dat,sha256=lUGm84DfwLgQ3vC0mL_foFf5dSZZKDTIuwCRf5BjgVs,135641
|
| 654 |
+
babel/locale-data/lb_LU.dat,sha256=s0AY2-F7BqA4tMcRPjCfbzbXRbHsKnD6uIQGSkulCT8,653
|
| 655 |
+
babel/locale-data/lg.dat,sha256=LnMo-qAcWHbbAuRmCTz4_nBGHgUx0aojWG7C8TFn__Q,15834
|
| 656 |
+
babel/locale-data/lg_UG.dat,sha256=nyn_HKdBHGkHlbjlDX28L5Z9k59MKFqvmVL3vg222s0,639
|
| 657 |
+
babel/locale-data/lij.dat,sha256=Ic982St82mPMfuQqqLswPtOy8LlglfcLYk_ftIDM65Q,129648
|
| 658 |
+
babel/locale-data/lij_IT.dat,sha256=rtPerU7ltwkHHc7HErfwJfX8TDSCpTHvBzwKBdSt4x4,654
|
| 659 |
+
babel/locale-data/lkt.dat,sha256=U_yXNWWJkqlepaZ9kS-FVOAHQKVmc0vhwgWgFRzXnqc,11180
|
| 660 |
+
babel/locale-data/lkt_US.dat,sha256=ywWg9m80tNjumAxGNrBwYhXhc28rC4OSdyvkdXAKs5Y,654
|
| 661 |
+
babel/locale-data/lld.dat,sha256=2JBQPu8T-cMVqzVOFs0Vz-0hU2RtHMyTvj0F8wPl2EU,95451
|
| 662 |
+
babel/locale-data/lld_IT.dat,sha256=rHSiZg_-Ba6si2LONUCmQ841RxcX2p7V1jDSuwNNBg4,654
|
| 663 |
+
babel/locale-data/lmo.dat,sha256=GYoR98Ap5hosG9bfENEA3sCkR-msF_KvxV2nLydjs9s,1659
|
| 664 |
+
babel/locale-data/lmo_IT.dat,sha256=Xg4Qvye_hPNJLCTwoBuRMAvhtjQb8VlD9SaH_5hVG9s,654
|
| 665 |
+
babel/locale-data/ln.dat,sha256=OHqUbo7M-600CtpOUNqq3B-Tt0_L3c2GgyR2xZhuMmE,23909
|
| 666 |
+
babel/locale-data/ln_AO.dat,sha256=VNcFViSaGw3f92D60Uk7vxQ8i6Q9H1FD6paDpJh-r4M,636
|
| 667 |
+
babel/locale-data/ln_CD.dat,sha256=Ao_lUWuswJgGHhVJYs2_Z8LyN4iqgYsAda8f9UarT6s,616
|
| 668 |
+
babel/locale-data/ln_CF.dat,sha256=g5Jy7ovUkwcn0W5Ov5bu5SBc2iM4SWwUFwtzWzAAb34,616
|
| 669 |
+
babel/locale-data/ln_CG.dat,sha256=jQld0yw63ufWbhlOt81wjf731zZluc2zWc1A65kBlAM,616
|
| 670 |
+
babel/locale-data/lo.dat,sha256=hXtgT4nkqb8h669TsazfIFBsK23QNpcCZbqvb6SXWBo,189363
|
| 671 |
+
babel/locale-data/lo_LA.dat,sha256=gNa7KRGYWI0h0PcHJ35bwnPskILOH-1jLjHCXP85jaU,635
|
| 672 |
+
babel/locale-data/lrc.dat,sha256=GbK-bWw4TlGvGRyM4WxDujkUr7Gdz9k2A__fSelwEdk,13594
|
| 673 |
+
babel/locale-data/lrc_IQ.dat,sha256=cy9DO9oAKI51NMitAb2MTbZoxtaAPzaYVGV0-xd0mGA,1255
|
| 674 |
+
babel/locale-data/lrc_IR.dat,sha256=-ca4EmTX5VAi_5tDfimpevJFb-g8vAjgpe_jkDTDZWQ,679
|
| 675 |
+
babel/locale-data/lt.dat,sha256=1h5TjFvNSuqrE3JntTmnLN9wW69jfkVakAIICcmoVbc,262613
|
| 676 |
+
babel/locale-data/lt_LT.dat,sha256=j8dIQrFc0s77xJ4P-UGiDcaNqZW6CXOEiOh30FemNiY,653
|
| 677 |
+
babel/locale-data/ltg.dat,sha256=qRaChoBWcmkL8As9MgCysSh58BP_F3US65EaA97ZgZQ,2632
|
| 678 |
+
babel/locale-data/ltg_LV.dat,sha256=Gm8suGbSLaNGzzWPjuEKVdEqJH18ABue4htegryH3bw,636
|
| 679 |
+
babel/locale-data/lu.dat,sha256=4TGAGkYbDHz6QAKQHHXoRkl0Wx-0LOiMkTjDgwJq0TU,15331
|
| 680 |
+
babel/locale-data/lu_CD.dat,sha256=K3k0wMpIbjusgPC2W1q2sxyxynx2M78zOLjt4ikcoZA,616
|
| 681 |
+
babel/locale-data/luo.dat,sha256=xJNSb25OVQogO42d-Jy2fR1FzeSfW9Swwt9Wat4EmsA,15201
|
| 682 |
+
babel/locale-data/luo_KE.dat,sha256=jVUd3oO_U7IP6KmvSkVHYNmlCc8_-m2mpJMBaqArSFI,636
|
| 683 |
+
babel/locale-data/luy.dat,sha256=pcTbaSctQyVgVVh4nXoXxMQGZa3Ip7hsfRN096zwEsY,15030
|
| 684 |
+
babel/locale-data/luy_KE.dat,sha256=NVkQAtmDBXUws3KybnM706J3lwUc5fJo-YEjKd1zhiw,636
|
| 685 |
+
babel/locale-data/lv.dat,sha256=s10obHsTYkBF99rADGvkxupv--JkRPQS2aM6sWvbM4A,201861
|
| 686 |
+
babel/locale-data/lv_LV.dat,sha256=oS9W0pdiTNtMTeGOsef2K7Va2O6k-dQEtN02qCaAoFw,635
|
| 687 |
+
babel/locale-data/mai.dat,sha256=Foj4spiHhuOjBZqaXQxZNCWwdCoslwB7KSX6nXQReu8,95488
|
| 688 |
+
babel/locale-data/mai_IN.dat,sha256=DoclpHa5nlHcAflg286ycOjQ6trZP8uHThzcp37Y91E,659
|
| 689 |
+
babel/locale-data/mas.dat,sha256=xxugbgGc3JxvM2GzV1vmKy1buszviy7NtSH-y6GdMZ4,16595
|
| 690 |
+
babel/locale-data/mas_KE.dat,sha256=zH3Le4j03YNsPjt_-GL5RvPG0znnJKQ3ifbLhMZsoYQ,636
|
| 691 |
+
babel/locale-data/mas_TZ.dat,sha256=VyRJlBqV_fukTqSR9Jxr-PujSA7u-MP9aXrJBVJCKiA,638
|
| 692 |
+
babel/locale-data/mdf.dat,sha256=NQH9Yo77oyvxZj_93XIf0e00JDAoI2ydlCSS3klNgwk,2240
|
| 693 |
+
babel/locale-data/mdf_RU.dat,sha256=sVnTxgzU2rEwl7P4d5UY6XOKv1XUCbtkEQO0cu2OlOk,654
|
| 694 |
+
babel/locale-data/mer.dat,sha256=WFl2qQThWrilUbBaN4UJQb97ZrV3uOB4ZTO9kXsjtnQ,15426
|
| 695 |
+
babel/locale-data/mer_KE.dat,sha256=WqDQTsO6BtbROdcj3p3omUZk8XB6HiJrIlCCj_wLPxo,636
|
| 696 |
+
babel/locale-data/mfe.dat,sha256=n5lJPfd4pjC3xmVm123ivVpjg-WAkLQq9YONw1JlpTs,14835
|
| 697 |
+
babel/locale-data/mfe_MU.dat,sha256=MHUOKiQPHuUbhT6hQXJEkpGDvTUyMV4btJTuiLhJQ4k,617
|
| 698 |
+
babel/locale-data/mg.dat,sha256=9PbZhJ2v9RP2XSzwv7bBPTGlSNYJrUUISNkTwdF1Z7g,18776
|
| 699 |
+
babel/locale-data/mg_MG.dat,sha256=uJbGeEzIn4Rh5Bh4hyV-Hs0_qez9KBeOi4hvfC3zkIw,616
|
| 700 |
+
babel/locale-data/mgh.dat,sha256=ezIhzOd-qzUBRud5ZPjbtBBc_mON2HuKGu_okOahCbk,9753
|
| 701 |
+
babel/locale-data/mgh_MZ.dat,sha256=aFZZ41qtARE6CeecCEx99tzW_fp-XfkAc10wpQ5YeGM,636
|
| 702 |
+
babel/locale-data/mgo.dat,sha256=xyRaEmGV6Fw9nVfReQJY7KfgGwdnvQzScLiH0appsLU,3549
|
| 703 |
+
babel/locale-data/mgo_CM.dat,sha256=Nsp33t4abZsKdDmIgB8tb08OsEh-7JXMY_JKCsd61zY,636
|
| 704 |
+
babel/locale-data/mhn.dat,sha256=RpSxxevhvYxyX0dq1RAhIqoREyyPwKjsByXvOhQkAMc,693
|
| 705 |
+
babel/locale-data/mhn_IT.dat,sha256=3UoH_l7yItN5qXKPaq6bWK_CvK_wD68zkxzLrCwxr9A,654
|
| 706 |
+
babel/locale-data/mi.dat,sha256=ZlyyKSUJCtl7z94uIwEFuC6uBGWXOTM8F1TJLiJeSmw,85086
|
| 707 |
+
babel/locale-data/mi_NZ.dat,sha256=RElP_P4F1HDHjSHsdt54vriFcz0TcIeT26pm-_dy-Mk,635
|
| 708 |
+
babel/locale-data/mic.dat,sha256=Sp71dA3ZhTiiPTfk3b0Mm6y6CM0J-mGR0av-psrUGtI,1638
|
| 709 |
+
babel/locale-data/mic_CA.dat,sha256=uZoBvRFux6M40HcGau7E6V0Pyxh45Bxi0SFngOxLWRQ,636
|
| 710 |
+
babel/locale-data/mk.dat,sha256=xVJU-aubw2FQ_THzBUGd5LHR5IU1VjGkPOeRHpU-T98,216606
|
| 711 |
+
babel/locale-data/mk_MK.dat,sha256=qlI1ZtLgyX2fcYS9pnTa8illdSnPmfNXORjws-H93lc,635
|
| 712 |
+
babel/locale-data/ml.dat,sha256=tR0lt2uQuzmsBgXWIuRpz-AzD00S_OrvLc-QkiYAX-U,246736
|
| 713 |
+
babel/locale-data/ml_IN.dat,sha256=VwCnSFs3oh7xo4-nS1HzWj_xICDzG6E-AW0Oxi6Lu08,658
|
| 714 |
+
babel/locale-data/mn.dat,sha256=O3oSpnDd3Pt-dRrwdg1v245S6Iym3SBnZZ3gqOhQW5A,183647
|
| 715 |
+
babel/locale-data/mn_MN.dat,sha256=qhJGIDXSglsa3BYCalsusoyiKgOj7PJ90Yi4ET2-nxc,635
|
| 716 |
+
babel/locale-data/mn_Mong.dat,sha256=zqCuL28Sx1DS8LGqtC2nyTCoEpSFpF0vE3wvBxpHK1o,1726
|
| 717 |
+
babel/locale-data/mn_Mong_CN.dat,sha256=WTF89EShdtBd0Vz62erFwl9KTG-GgEyzjjmKWuJCFH0,635
|
| 718 |
+
babel/locale-data/mn_Mong_MN.dat,sha256=BTah7qfU9QayUb7evUKdF9c4Ptf4NqqO6SUeUql2Bak,12935
|
| 719 |
+
babel/locale-data/mni.dat,sha256=aS_XIOmHRptFT_dTFuxgTvB2cEPKHJVVM_vtURTFo7A,12972
|
| 720 |
+
babel/locale-data/mni_Beng.dat,sha256=7PTKZT_UE3WNiipyGHnn2SDNFNhAcqHhEJ8T0Y3O7gI,693
|
| 721 |
+
babel/locale-data/mni_Beng_IN.dat,sha256=nAW_LfRtJqC6-ehdC8yyszjhibXqMAXPkuaz8POQav8,659
|
| 722 |
+
babel/locale-data/mni_Mtei.dat,sha256=zdzwNyaRIil7lkjEf6ProQX0nwYlc5VF4r4gHNTUVTY,1720
|
| 723 |
+
babel/locale-data/mni_Mtei_IN.dat,sha256=nAW_LfRtJqC6-ehdC8yyszjhibXqMAXPkuaz8POQav8,659
|
| 724 |
+
babel/locale-data/moh.dat,sha256=FuywEiFRXQe1GUv9zPR15KOsZLr1TykmuglinLINTqE,1316
|
| 725 |
+
babel/locale-data/moh_CA.dat,sha256=AXdrS_As8DrrTGs5IHmQwXoEXndFuoWoTGXPXcL4Pk4,636
|
| 726 |
+
babel/locale-data/mr.dat,sha256=UG0FkufUtQ7qvzcK_WENRq6SgPy4zAcviYDQL-NrGY8,234157
|
| 727 |
+
babel/locale-data/mr_IN.dat,sha256=HOu9QR1BLbciqF6BeTfWvD0L5Igwv5HrCWu9y_vNns0,658
|
| 728 |
+
babel/locale-data/ms.dat,sha256=l_YQob4w4jdu0U-Z-eMYK2bPAyU0Xeekar0olT5G21s,114970
|
| 729 |
+
babel/locale-data/ms_Arab.dat,sha256=9zretwvdo_9N3SIxLKsUtDVNZlmh0OhrPDxmtWqw22U,14359
|
| 730 |
+
babel/locale-data/ms_Arab_BN.dat,sha256=vTEKSh0hjyiWJhf503-fwjADvTCN0AqRSzF6muL52JE,1335
|
| 731 |
+
babel/locale-data/ms_Arab_MY.dat,sha256=w6ZZrz3qEmnsLsWtJA8rTohqF1cxctkzSj4WN0XHuHE,635
|
| 732 |
+
babel/locale-data/ms_BN.dat,sha256=vTEKSh0hjyiWJhf503-fwjADvTCN0AqRSzF6muL52JE,1335
|
| 733 |
+
babel/locale-data/ms_ID.dat,sha256=ZPgnDJgiycDHGZnN3Eg7OgZp1jIYtiZzMqm9f3LOtR8,3440
|
| 734 |
+
babel/locale-data/ms_MY.dat,sha256=w6ZZrz3qEmnsLsWtJA8rTohqF1cxctkzSj4WN0XHuHE,635
|
| 735 |
+
babel/locale-data/ms_SG.dat,sha256=jsfNag5WQWdejzh5hayA7_-IbY03MUVPAPDHUJyCZRg,654
|
| 736 |
+
babel/locale-data/mt.dat,sha256=Xx_-as8jJEXOBAgfFX7vE6-2Qex4FWJ5rYW3DlCbu0A,49384
|
| 737 |
+
babel/locale-data/mt_MT.dat,sha256=L5q5LizZQL0-FLj2U-wn2YhkpL3p7ZvjdyAvH1wwUG0,635
|
| 738 |
+
babel/locale-data/mua.dat,sha256=N4zi8XyQdW_TmszNHQyn4zmia-MpCNWx_Vudoaj075Q,15861
|
| 739 |
+
babel/locale-data/mua_CM.dat,sha256=Ib4K67KfndwGsoZDH0ehHA-F7V_SUj7q9VsK2juzaIQ,636
|
| 740 |
+
babel/locale-data/mus.dat,sha256=zPqFwR9oCIJ0mA6evYwT75cWt_QBF-0eDZx1n6fmsDY,2722
|
| 741 |
+
babel/locale-data/mus_US.dat,sha256=xcd4KKUIqBwSefSC0GGSDkvXL46eDWgWolJsGuSf654,654
|
| 742 |
+
babel/locale-data/my.dat,sha256=9crk_2tyVPKBH_YWC_D0h8o1nbHH9k34e414JywM_6E,183534
|
| 743 |
+
babel/locale-data/my_MM.dat,sha256=l53-D5YL-BbmLZYveFV2ISa4NcrSwTfKsRRc41Jd42U,635
|
| 744 |
+
babel/locale-data/myv.dat,sha256=78-9U5eDf3V2q3Mj0MazIxh1n8sjyVjQ1O0Oyt5875M,16828
|
| 745 |
+
babel/locale-data/myv_RU.dat,sha256=sncxwOpjfFkRASKHMP1ytKcjpF4w4GjU_JEVqXv84Tg,654
|
| 746 |
+
babel/locale-data/mzn.dat,sha256=8Y5VGlzCxKXzBP5iFsyflLZSS1x0_3T8sqbwivfU45s,46144
|
| 747 |
+
babel/locale-data/mzn_IR.dat,sha256=fjN1ek2fAzZyzFJpjX_MIc5oFOEqj7LS_SNdBOQS9ZY,679
|
| 748 |
+
babel/locale-data/naq.dat,sha256=N07nsBSSEuNZ4feWvo7b4YWwbgjBwlxG9653O-OlhmI,15797
|
| 749 |
+
babel/locale-data/naq_NA.dat,sha256=e5gAIOo7le-dVOAX_k2OW6gEyVfEUxcYDUJu_MBDY5M,617
|
| 750 |
+
babel/locale-data/nb.dat,sha256=-bGHDSonSEdqfb2PxNC1_3jOHELm3CwV7xzEtpmWZUE,1330
|
| 751 |
+
babel/locale-data/nb_NO.dat,sha256=J1UiN-AG900acMz4p0fBHtXDpS0HD6uGAi7gg9gOrsY,653
|
| 752 |
+
babel/locale-data/nb_SJ.dat,sha256=XcK9_nKriUY_4k09kmgJalGTls-e5-YS-MCPEKLP8vA,634
|
| 753 |
+
babel/locale-data/nd.dat,sha256=ITmP8mLDb63INBKlxe3yCZqRbvL83DrVBkIIAA_YjmA,15730
|
| 754 |
+
babel/locale-data/nd_ZW.dat,sha256=KpZHrPr_0Ru0t9ojSK9ZiqGZ6-rSpvA7cX9C483ocRk,635
|
| 755 |
+
babel/locale-data/nds.dat,sha256=q3dxEsEcdLTOigPQxhEXuaA4U03umMzIBNC4NkFvino,47839
|
| 756 |
+
babel/locale-data/nds_DE.dat,sha256=Qmh5DjX65W58jXXXX3pxfxS_HVTJVavMspBPdph9sfc,654
|
| 757 |
+
babel/locale-data/nds_NL.dat,sha256=E_EO3ylaBjJNThr211Yzefh5DRbkEFFVpbBMXIQ4U1U,654
|
| 758 |
+
babel/locale-data/ne.dat,sha256=5Ob8IUrudfJp6yCzhHkmYC2mkVY1sd10I79pSXzups0,210152
|
| 759 |
+
babel/locale-data/ne_IN.dat,sha256=SFloADZtyb42wygQmrMy7yx-aADGQECZJUey796oqnw,1292
|
| 760 |
+
babel/locale-data/ne_NP.dat,sha256=LGc7Z5TRi0HRNQdY4bqPitV73gzTPWLd_g-6aPyvryc,635
|
| 761 |
+
babel/locale-data/nl.dat,sha256=iGSLuhpd3RP4i7tOj5RU-vJ1KC_Ij6d5npxRBE5HisQ,149984
|
| 762 |
+
babel/locale-data/nl_AW.dat,sha256=HYycPPe5HDhuP_zN89ysXR2AqjIbx_-XB2n0-TUPhxw,638
|
| 763 |
+
babel/locale-data/nl_BE.dat,sha256=xHmyTOK9-rwPAH6fYdlPFZv-xinmTFNRN-LIGxb59HE,1876
|
| 764 |
+
babel/locale-data/nl_BQ.dat,sha256=lZQzrmWsFTpiWwT9l6FakrNoll3QNP3drIMcxFkAy6Y,635
|
| 765 |
+
babel/locale-data/nl_CW.dat,sha256=doEeLSsQVaSocP4jr5LxNrT5luSiG4hkgsMvoYjJBtY,638
|
| 766 |
+
babel/locale-data/nl_NL.dat,sha256=bGo4nyjhqe1VtDHlP5EUmNkBKsViUSiH3h_ikXcPuRo,653
|
| 767 |
+
babel/locale-data/nl_SR.dat,sha256=d-YXA5QA5b2Bh-WhxNTkyKQ4ROhuEg1CeGN5XmzWcZM,696
|
| 768 |
+
babel/locale-data/nl_SX.dat,sha256=ciTQIntv0njAJGIUENzo6stN8yarfh-eBpmEzxmpJbs,638
|
| 769 |
+
babel/locale-data/nmg.dat,sha256=NEWUb0RI43oeWByH9l1FvrLDvVQY6501jviEYmM_CCs,15468
|
| 770 |
+
babel/locale-data/nmg_CM.dat,sha256=0A-cVUgt1l1ITnPRdcgWiQ68ZGqHDYd-k2wSc_nXnMQ,636
|
| 771 |
+
babel/locale-data/nn.dat,sha256=E-Y0lC-8QKCXdc8CC_ZPN3bstsXsM3MD4Lu62XMMq3U,64042
|
| 772 |
+
babel/locale-data/nn_NO.dat,sha256=98eWK3CBq5T_dI4a6dQH2TktRygMH0EnpO1EO7w8lVY,653
|
| 773 |
+
babel/locale-data/nnh.dat,sha256=cWTTqJEXln6pUYON7H4PRrYr_uRWktSzcLGCC8jnTno,3530
|
| 774 |
+
babel/locale-data/nnh_CM.dat,sha256=dt9ZNHX5ZQo-kcyT4-mVRCUiuzL-H2A9e0s0JrHwZts,636
|
| 775 |
+
babel/locale-data/no.dat,sha256=xxkSV9bwDKWKK6dmGIaZGo4snfkON9eJUp3-uvlEC1w,191212
|
| 776 |
+
babel/locale-data/nqo.dat,sha256=VQzcAnkUnAETAL8xosXBsQltlC4yqpSZNMkwtsWPRgI,109412
|
| 777 |
+
babel/locale-data/nqo_GN.dat,sha256=3eOSTBaZM0RNLUDZFr__KTR_9iZoGUFq9M6bhtmHjcU,617
|
| 778 |
+
babel/locale-data/nr.dat,sha256=ZHIIC8BaR5XBmnULOTfmAYzXmqImq5QmELqbFPKKQJo,2167
|
| 779 |
+
babel/locale-data/nr_ZA.dat,sha256=e4_czqcyMye0qthJd2hzn_9inTS8WjjbFOzRJ3wAS24,635
|
| 780 |
+
babel/locale-data/nso.dat,sha256=dsq0mvwg5QK35al0bVwZGUL961EuGS05vlFR5qb4HwM,6470
|
| 781 |
+
babel/locale-data/nso_ZA.dat,sha256=TdOqVTzKNigLD6zOPR7W7QHT-Aw40ylsUE7bmMwgaKY,636
|
| 782 |
+
babel/locale-data/nus.dat,sha256=4G1Wwsq1yWIew4nA-QBo2j8LmbqBTRZ0gCU0LYLUSUk,8215
|
| 783 |
+
babel/locale-data/nus_SS.dat,sha256=Is_mWvnSS7j05Vk9RHcCfyLOdhOeOWRqgXDf8FGNEJQ,617
|
| 784 |
+
babel/locale-data/nv.dat,sha256=7CBom-BDX6Wk2o878hmZ8DBY8QAS8Z99ExdmdVpq-vQ,721
|
| 785 |
+
babel/locale-data/nv_US.dat,sha256=ak7j2GDaOMbAAmXQhfC9PRM8E9h_hJZL3UDqxqjCtoI,653
|
| 786 |
+
babel/locale-data/ny.dat,sha256=XXvyFcRnNcH9KcAH1K7jzS5xLFsXMlXVW3yowhXPIO0,2152
|
| 787 |
+
babel/locale-data/ny_MW.dat,sha256=kyhkcpqgIwSrUcfxve2OS2P9S1AfXItRHmy94K7cQ48,616
|
| 788 |
+
babel/locale-data/nyn.dat,sha256=nVlbaYbL0QCkpVvX2rYYUFRsuI8BOjcReljkcamobSY,15668
|
| 789 |
+
babel/locale-data/nyn_UG.dat,sha256=fEm-RMI6-PvIjbMUoZK68dTaiAmOqH1iDQBn23a6r2w,640
|
| 790 |
+
babel/locale-data/oc.dat,sha256=0GZZe142JNEQ78GP7q1Sq7ZolzkVuvuK-QDCpLu4Z6Y,66841
|
| 791 |
+
babel/locale-data/oc_ES.dat,sha256=H-3UJZkJCacW_BELiE_wXsXSVHp-dfxv59o3Hed8uho,33273
|
| 792 |
+
babel/locale-data/oc_FR.dat,sha256=L80Ivl6dUpQJF4fAY1xaAeCRO9BkN0l6oCr8nRwogsM,653
|
| 793 |
+
babel/locale-data/om.dat,sha256=wbIQO2bCc4PnuCB14zg9Gw9XW3mlv8D_D0C39SMnAnw,67446
|
| 794 |
+
babel/locale-data/om_ET.dat,sha256=v0wHN7iwcuJN-iFgWFPrGdplH6P-0c8B2OEqYOEeb40,635
|
| 795 |
+
babel/locale-data/om_KE.dat,sha256=DZ-2HywpH9NGEronFox-2AprzyoSg0xJAS62LNqZxcQ,1365
|
| 796 |
+
babel/locale-data/or.dat,sha256=bdzcLCC-BRprtZBlm8pvQhvGKe2zTqjQM1JPQZrGapM,226771
|
| 797 |
+
babel/locale-data/or_IN.dat,sha256=ur6a2cCdapMoKd-6KLXR2xAF2YU8xaueeW7UTPL2yLU,658
|
| 798 |
+
babel/locale-data/os.dat,sha256=2ARxbjnZ_WYF6VQTsvXN4epcXlWpkXaVEhUNOJpAv8Q,14821
|
| 799 |
+
babel/locale-data/os_GE.dat,sha256=8NgIdMuGlNow1dXmjW6y4xOis1_3raiXcj_jLBPirpI,635
|
| 800 |
+
babel/locale-data/os_RU.dat,sha256=76MsfCZxiy_RXfhW7Do3Z8q4-jhp1hOXTBIsA6SlA-Q,695
|
| 801 |
+
babel/locale-data/osa.dat,sha256=Ob-cu1978hig_-zOnB-PJW1_496aZ_yT6S7VTFkHoEY,4538
|
| 802 |
+
babel/locale-data/osa_US.dat,sha256=qFfjNw8tVOdprzqK2wBlGH4eNMxDxDQqDDReucJZR-E,654
|
| 803 |
+
babel/locale-data/pa.dat,sha256=pMTu_1agUQqVCaM7VB5fe9wM45MEsfVkDyzkKp6UlUE,202684
|
| 804 |
+
babel/locale-data/pa_Arab.dat,sha256=VBfuWzoA5UdGbWTTG3cPAYL0ApWSup5U9LWBBh4bGUE,3789
|
| 805 |
+
babel/locale-data/pa_Arab_PK.dat,sha256=1Si67Mz8DZfo2D8Ld0b5IlZpvnSMgg4W8_zZLrHrWQ0,635
|
| 806 |
+
babel/locale-data/pa_Guru.dat,sha256=fs7wqdmuGaKQCCwGkT3lRQSKmf1dxG3jyLboZeVtPmE,1276
|
| 807 |
+
babel/locale-data/pa_Guru_IN.dat,sha256=kpz873B1I65nfS3Z5vDLmmGliFVPlPM58sB6jW9nkBY,658
|
| 808 |
+
babel/locale-data/pap.dat,sha256=EzSKg0e-PaX4UNpqi0JTYSjLYwqljGKI-uJLjR1uWhQ,28121
|
| 809 |
+
babel/locale-data/pap_AW.dat,sha256=XZSGzQPijHNf5GjxUjDJQt88iD0ETRdZSTF8gn-1U4M,617
|
| 810 |
+
babel/locale-data/pap_CW.dat,sha256=Mu-gCfh3bv9pzz9RrylMffuphhqgiRaODEZm6TtCpaI,617
|
| 811 |
+
babel/locale-data/pcm.dat,sha256=BPyAoOzA7PpWZ4G9w2NMBzu1JqtXwnZbeCSrLk7j-Qs,161833
|
| 812 |
+
babel/locale-data/pcm_NG.dat,sha256=3gBp38NIuVEbHlKAtQPQXJjT3DKvy7zvUqMAZS6pGzk,617
|
| 813 |
+
babel/locale-data/pis.dat,sha256=aCXK39YyoYqy97wCU2idxYXLL9cC7myCIiJZeKgq-po,1510
|
| 814 |
+
babel/locale-data/pis_SB.dat,sha256=-CDkXv_877c__o56bBeYHAAq2X9CcnKdI65DiE61_M0,617
|
| 815 |
+
babel/locale-data/pl.dat,sha256=zWkc9nD_Ipzoj-nuymRuCLdWD3dG_wQicGQE5NpjSLU,227506
|
| 816 |
+
babel/locale-data/pl_PL.dat,sha256=3s2XpVyaKha_K9MesXKD6sZNGSn1PVRtuz9XYp1xrsg,653
|
| 817 |
+
babel/locale-data/prg.dat,sha256=vsad78h5dkCtaL_Gc-AGmXy3cc6Od1j4WCPGBdX6Tt0,17267
|
| 818 |
+
babel/locale-data/prg_PL.dat,sha256=5jT2Yeek_e_MpGShmy2v-0WWhzQkQ0WsJQlUYfIOcfU,654
|
| 819 |
+
babel/locale-data/ps.dat,sha256=2Yvun7eRlWEkh6Om_QxdW3Hq3AwyYqoM8n0418VjcbU,158607
|
| 820 |
+
babel/locale-data/ps_AF.dat,sha256=sNE6bgx_nV0VWKa8InelUaFYSa3Fpx6byJw0KT4B1o4,678
|
| 821 |
+
babel/locale-data/ps_PK.dat,sha256=ZtzTnH2thc6-J5PbuMOq3lPu57kbqDFxO53s7BSdVSQ,7119
|
| 822 |
+
babel/locale-data/pt.dat,sha256=6Db_e_tQGLJop802pMj8aeNGcuKxa9iKTCZYBNM4crs,183448
|
| 823 |
+
babel/locale-data/pt_AO.dat,sha256=49hMN9AJBDNjcsQw-nl-jY_VKHanO0PGfvd--OxqOxI,1022
|
| 824 |
+
babel/locale-data/pt_BR.dat,sha256=dVKYp9IwRMbjZ_ee-eXFPudSuTRrROvbFzY3dYTYmn0,635
|
| 825 |
+
babel/locale-data/pt_CH.dat,sha256=zAvD0sYytEquwzY8ZRbVCcy7DS2ZzUXofl5qXOixZH4,653
|
| 826 |
+
babel/locale-data/pt_CV.dat,sha256=zOQn8d7--PKrhRUhQ5mPKW1Km6Tyh5JF8hstfxpITzM,1039
|
| 827 |
+
babel/locale-data/pt_GQ.dat,sha256=qI1hvtuSHOev12ips9o3Vy78NJpOMjhkW625M60lqZU,616
|
| 828 |
+
babel/locale-data/pt_GW.dat,sha256=SRxbFDIg9FwEjGjutRI9P1SeLiZBqStwSqPuHBFZwLQ,1002
|
| 829 |
+
babel/locale-data/pt_LU.dat,sha256=z9aq0BTWEnk4lXveNpmi89TKcXN_t6Ud4A_C97uyOuw,672
|
| 830 |
+
babel/locale-data/pt_MO.dat,sha256=shItJIIDrxwlcQhWLhlZG0uhyTlSBDcTag5ivxmb9TA,1635
|
| 831 |
+
babel/locale-data/pt_MZ.dat,sha256=UZ1nkXS9CpiCM1IpOG5XpGK2QqM5mE5lAgRLTGAWl-4,1042
|
| 832 |
+
babel/locale-data/pt_PT.dat,sha256=_H5DG5pOSZR_5gjjycrMBKaOJd_euwJln1pa3MPd1Mg,96277
|
| 833 |
+
babel/locale-data/pt_ST.dat,sha256=Cm2HUxlGtZaz8IXX5Ohms-HYuKgazuBcOZBz5rWOzEU,1022
|
| 834 |
+
babel/locale-data/pt_TL.dat,sha256=CIIDM_Zo0xiu4gXngxYtkYK6ldTNZMRaikSD_sAokMw,1002
|
| 835 |
+
babel/locale-data/qu.dat,sha256=UueUbNLnx5ZwsqJcvzKUTdK5_wKBOmR2haCj0zhd4RQ,93300
|
| 836 |
+
babel/locale-data/qu_BO.dat,sha256=7RUvNrmuLtwqP-qab667GocH_c4gIvpas3dbN1uaGxU,878
|
| 837 |
+
babel/locale-data/qu_EC.dat,sha256=_5V4RYoPb3eCAA7jOCNfB7WZqd9sWP1E0tlF8mGeqFc,837
|
| 838 |
+
babel/locale-data/qu_PE.dat,sha256=Vdd0fcK2dtFgyui3Q9NElHuJ841RI-T5l2UHeBq8MQ8,635
|
| 839 |
+
babel/locale-data/quc.dat,sha256=dIAxk2IuDZhWTj-NKC9PiHBZOnG9ARyANdJZUfoVlJw,775
|
| 840 |
+
babel/locale-data/quc_GT.dat,sha256=8M8KtmnsJiTCaf-Nl5X174Omtyc6a0ri07kysDC3-5Y,636
|
| 841 |
+
babel/locale-data/raj.dat,sha256=qkuyRruXTTQLDgijSA0Equfz19Aqg0p5Mg0heaGKT00,2428
|
| 842 |
+
babel/locale-data/raj_IN.dat,sha256=SS8GPzJu5j6nfXlDoX4NFPN2QScl4M0YNsrFmWklymM,659
|
| 843 |
+
babel/locale-data/rhg.dat,sha256=dHahMWjQ_tUshtlLauqf9b4Y36LNJFGrMBsVmjBzlqQ,4611
|
| 844 |
+
babel/locale-data/rhg_Rohg.dat,sha256=DAOuwC-7uaIuZtrIXvUkYt6YkxqaKpHOma1m0-XTtrI,693
|
| 845 |
+
babel/locale-data/rhg_Rohg_BD.dat,sha256=DcLSBtf_k_f6B102-vbhBOjfzNZjiTDvEUdIOQfVc8M,1212
|
| 846 |
+
babel/locale-data/rhg_Rohg_MM.dat,sha256=HspZzbytcZQ853Jstp-eFEdqSMAD3-shgjrdxY_KQrE,636
|
| 847 |
+
babel/locale-data/rif.dat,sha256=4KtUTy4D-OsLftEaIHU2fw1NUhx0pwJXXie51jI3X10,49902
|
| 848 |
+
babel/locale-data/rif_MA.dat,sha256=Qq7ZdymuPdjHeYDUDGCjMuQBRU7w5qGdgzzZ6wPfN2o,617
|
| 849 |
+
babel/locale-data/rm.dat,sha256=aQ4MmwhjJbBakV6-C-6yjDvN8jvVa8Mk0ovdYgVkR9k,95006
|
| 850 |
+
babel/locale-data/rm_CH.dat,sha256=JHAlYXMD9Vks43cU_gcSEQmqo6pogWPl_R4VMUK2iHI,653
|
| 851 |
+
babel/locale-data/rn.dat,sha256=LwQTzbFINNeIhU5qJsEnh-raxcCDXVMGA6ZL95aU9UE,16241
|
| 852 |
+
babel/locale-data/rn_BI.dat,sha256=r5Cweh7L4EAZK-qTmJuloWc33iXeR4IJUbknrl0XC3g,616
|
| 853 |
+
babel/locale-data/ro.dat,sha256=13UpR66j-nQg4kbgGH4ja6ygDq1k3CCErykEWeeG8yY,200714
|
| 854 |
+
babel/locale-data/ro_MD.dat,sha256=pUZY970zkBSBpVOIA3Ss-6vDJUF3ZCEWYNs4_LXcpAY,2881
|
| 855 |
+
babel/locale-data/ro_RO.dat,sha256=lLYIYWhDUmq1EZ9oV5SETauVa_5uNN5p52dW7XeemRk,635
|
| 856 |
+
babel/locale-data/rof.dat,sha256=Yafgax503CHjHvrc_njDTMVOOD2B36sRvWvDE99geMI,15473
|
| 857 |
+
babel/locale-data/rof_TZ.dat,sha256=I_qwGjqqrcwUR_3UNydHOm_EiiLZYyRV0q-s1qfSSi0,617
|
| 858 |
+
babel/locale-data/root.dat,sha256=QDYvctKQfBJlCMUl24Gf71HIZQq14_V1LcTK-6udwzQ,51999
|
| 859 |
+
babel/locale-data/ru.dat,sha256=8WD_7_Tz0ieaEjXNlFQy8xFSfCwsVf_CUcoHyFfqkgs,305832
|
| 860 |
+
babel/locale-data/ru_BY.dat,sha256=99UlyhoMWnfyhI5ltXGaJkycWLVfJ3FwdxyRm-yr6kM,676
|
| 861 |
+
babel/locale-data/ru_KG.dat,sha256=X-iAT1QuQGhk1mIetpGyWqDlwiBskLfwqrK6ant1XS8,659
|
| 862 |
+
babel/locale-data/ru_KZ.dat,sha256=P1_Gn3esOwDLL8sd8vVYbFA8J7QEsaDAWfZvDsn-WwA,656
|
| 863 |
+
babel/locale-data/ru_MD.dat,sha256=LU12oBwr7MfPTzfs8Dx7uUZVgHin8ybX_oPHrPIJTkw,654
|
| 864 |
+
babel/locale-data/ru_RU.dat,sha256=IVG440mXjphW6iCsKysZCW1Gem_z5_O0lZI6-R3oG_E,653
|
| 865 |
+
babel/locale-data/ru_UA.dat,sha256=WYPDEOUjHl7mtejs302KAURq_ckDn6CFjH-IwmiFF6g,1210
|
| 866 |
+
babel/locale-data/rw.dat,sha256=1KiBkw5N7hioc-ESs0oqgdyOaVdOlsNp1iIz7g3k83E,8418
|
| 867 |
+
babel/locale-data/rw_RW.dat,sha256=tw-gtzH64PeIAmNGeobgUypw7RAyKITeFAcQPGY0MG8,616
|
| 868 |
+
babel/locale-data/rwk.dat,sha256=hCqo5glP1WqFJrEGyW6r3t43NZ7bVHAOGFGDkUzeM3Y,15369
|
| 869 |
+
babel/locale-data/rwk_TZ.dat,sha256=s9duai8NRoHwn8YpQrlMd3VDf6jtQxxcUmu9CIIMzC0,617
|
| 870 |
+
babel/locale-data/sa.dat,sha256=8r4iZXIQ3vnGxlSmOtDhwM-T_iaYN4SXuTSdGh-2JMg,15978
|
| 871 |
+
babel/locale-data/sa_IN.dat,sha256=ABNamoPpYRbO7bK6BGm0tK92kd7su7_OP7Di0wW0zZo,658
|
| 872 |
+
babel/locale-data/sah.dat,sha256=Qlb3HEv5JslfLAkUjLJz_XdRdyLhloQ9uf9q2b_O6jM,39310
|
| 873 |
+
babel/locale-data/sah_RU.dat,sha256=jHlseiwMbtN-IsETeG2dsaIn6OB2kqtAogazMnn0f60,654
|
| 874 |
+
babel/locale-data/saq.dat,sha256=grj85np3tZzXQmLdtYQcu76ynQv5Jq__KIyaDECFIj0,15787
|
| 875 |
+
babel/locale-data/saq_KE.dat,sha256=kN94cJJt8AT0yBRDqUPGoJtMZdOb2e-83NNsq8hmQ64,636
|
| 876 |
+
babel/locale-data/sat.dat,sha256=K_IKB3mSsOkYuYDtbGW3lbGjVk4ctB56WWkJJvE0-mI,66131
|
| 877 |
+
babel/locale-data/sat_Deva.dat,sha256=0EHZ6UcxsVOfi399xQbOkzaH1OU4jkZ10uqmmWnK8VI,1943
|
| 878 |
+
babel/locale-data/sat_Deva_IN.dat,sha256=Bzh9Vmzia_8KLAryt9VqCl9ter9tKxng4b8oFYbYK6I,659
|
| 879 |
+
babel/locale-data/sat_Olck.dat,sha256=mszOmf6B29mFbE6qN6Moy6SfBjwsjaCsbk75dJR245Q,905
|
| 880 |
+
babel/locale-data/sat_Olck_IN.dat,sha256=Bzh9Vmzia_8KLAryt9VqCl9ter9tKxng4b8oFYbYK6I,659
|
| 881 |
+
babel/locale-data/sbp.dat,sha256=1qHxon8_TpGGnLHUBzy5cR1mCEnZmw1EuYz3QLgnT-c,15609
|
| 882 |
+
babel/locale-data/sbp_TZ.dat,sha256=chWs0tZniO53SbtBquTHGS6E4v36tgYL2b3enxHcdCU,617
|
| 883 |
+
babel/locale-data/sc.dat,sha256=ItaljMMLxOEM4DEG_yDNVk8H4AmQrq1xCnDE8AfRDDs,189970
|
| 884 |
+
babel/locale-data/sc_IT.dat,sha256=0G0vL9YXZQLkTmnzJuuygM5ty2Tw5liDg_aWHLvg32k,653
|
| 885 |
+
babel/locale-data/scn.dat,sha256=UKMqekdt_t_Qe_ebhg3eaRsTs37ECpWLEiWSCFjMTLI,70373
|
| 886 |
+
babel/locale-data/scn_IT.dat,sha256=dTXZIHDRhbFDCw02T0wL1iaJ2kfY1ZUzfbvUs4_WKLs,654
|
| 887 |
+
babel/locale-data/sd.dat,sha256=VDMIluqNpBChcALvjd2lGll6sRK6srAF7p2CogEgXlE,154300
|
| 888 |
+
babel/locale-data/sd_Arab.dat,sha256=jgkaYGUhPXll1T7CT68ridccZaERHeZdwUzGoAZBUps,879
|
| 889 |
+
babel/locale-data/sd_Arab_PK.dat,sha256=c3AXdatnrTNDHW_SOh8fNNye4CVey81FnkSXwj7MmcI,635
|
| 890 |
+
babel/locale-data/sd_Deva.dat,sha256=ZZathBrGJyoqspPsHF769J84zQq1y62vN8RAjGj_Cms,13957
|
| 891 |
+
babel/locale-data/sd_Deva_IN.dat,sha256=0KQFEKHV6hHidc5hxrxQEvhO-YyvFf5P5z6t9hPenH4,658
|
| 892 |
+
babel/locale-data/sdh.dat,sha256=5cD8u88qanpCtA8kPvHH9AdAi2-HbhznORqis1PYx6M,1032
|
| 893 |
+
babel/locale-data/sdh_IQ.dat,sha256=B_vUMOiGWVcD1HaR4Zk8XxVzcmMFSISe2vRscyA1lYY,679
|
| 894 |
+
babel/locale-data/sdh_IR.dat,sha256=hwMmQnne41X_lyjbyNbQq34Lpkl91bAgoavPZRuozwU,679
|
| 895 |
+
babel/locale-data/se.dat,sha256=JnN5s3b1OrcP7qmurb8Rb9NKc-ICOr_RmdFs2EBKoRA,54830
|
| 896 |
+
babel/locale-data/se_FI.dat,sha256=9_VJ0wzYFPto0YF2Ge0qieFV9_DOVqqYnPjlC5wnAr8,44207
|
| 897 |
+
babel/locale-data/se_NO.dat,sha256=nm5u2VQ3ne0SUFZtFqwsRa8Gg97Xn1OSxjoP2I-i_PU,653
|
| 898 |
+
babel/locale-data/se_SE.dat,sha256=6M9OxtmQAY_p9fZ_6L8zqo6i--bo_X00cvhTDEbX_UU,694
|
| 899 |
+
babel/locale-data/seh.dat,sha256=viFuK-Mg4wPnvTcrvL-iEzNqFc7Ri_VP_r9pC673SNE,15433
|
| 900 |
+
babel/locale-data/seh_MZ.dat,sha256=Sv94DueqrM3R5RjhCdwrKZsnNdL1WpjLBg6QhBnoaX0,636
|
| 901 |
+
babel/locale-data/ses.dat,sha256=aRW4cH7nGNS5S3B3ff7o02GqcIqn1mVbBRGg3NdxXUc,15812
|
| 902 |
+
babel/locale-data/ses_ML.dat,sha256=y14qGwP_r6VxzJhklYIWfYkolu0OHB-6nJ4tvF7J-iU,617
|
| 903 |
+
babel/locale-data/sg.dat,sha256=ERl6d_xd8JRnkG_D857gWi2xONyI-cEmzt-Un_hXbu4,16476
|
| 904 |
+
babel/locale-data/sg_CF.dat,sha256=QCNYqo_5l2Sv9JUFEWF6YLDR3MknhgkyMz1mO5j2Gv8,616
|
| 905 |
+
babel/locale-data/shi.dat,sha256=fuYtv_xjgmJ0-aAQiuWcJXZY3mpeq__hz4lnouEUyWE,21830
|
| 906 |
+
babel/locale-data/shi_Latn.dat,sha256=aQrfwwcvkgPaWFSev9-3WgwQXhhXj1_5myuR-QifnPo,15435
|
| 907 |
+
babel/locale-data/shi_Latn_MA.dat,sha256=X8cwkkvm2LjcClQWzHRxxmiA8P0c37D7P8lf6RO4iNQ,617
|
| 908 |
+
babel/locale-data/shi_Tfng.dat,sha256=VjsR4oSiK9oFfdIdpaVDwNSIBvFbQ3Jvm63K24bRqk0,974
|
| 909 |
+
babel/locale-data/shi_Tfng_MA.dat,sha256=X8cwkkvm2LjcClQWzHRxxmiA8P0c37D7P8lf6RO4iNQ,617
|
| 910 |
+
babel/locale-data/shn.dat,sha256=awBFmgdlHbpKsnUqWZaGAQ-YbTPm9UWkJKMn9IdJ7pM,890
|
| 911 |
+
babel/locale-data/shn_MM.dat,sha256=7VauV3cmVfAJz7kA76hsF3FdwM75CVjvHdjx6lCoH4M,636
|
| 912 |
+
babel/locale-data/shn_TH.dat,sha256=QHPmr3V4GzTbb6QA5SDl2EsVzQBjpbaDP6OHfJZ0S0Y,636
|
| 913 |
+
babel/locale-data/si.dat,sha256=iuq-0rbecyzhX0pRX5UYdgKKzrn09pkLucKursW_Z94,216775
|
| 914 |
+
babel/locale-data/si_LK.dat,sha256=cWCgV9WmnEwIIsBmhsIVzSzbrV8hkkXaV1xH1ultlUw,635
|
| 915 |
+
babel/locale-data/sid.dat,sha256=zyKwuzw51B0E8sWg60qJ3kO4rzqTtcNBRnH5D3Zm1mU,2176
|
| 916 |
+
babel/locale-data/sid_ET.dat,sha256=vtwy9BuaZwb5A3XdIl-3mws1cEAVk4s8oKy7i-GnM9o,636
|
| 917 |
+
babel/locale-data/sk.dat,sha256=u_TnuG4-zvLxkxQupdNvPS-TYi28xeiPxLit28hxwZM,218242
|
| 918 |
+
babel/locale-data/sk_SK.dat,sha256=eMjPq18mQOAXvkJN5WV6lKEAPyt7-eleGme2pHHevgA,653
|
| 919 |
+
babel/locale-data/skr.dat,sha256=Mrx5bET3kh5Gzd8-2J9Rm4_b_wPZTDoHuhcxqdYj5hA,1702
|
| 920 |
+
babel/locale-data/skr_PK.dat,sha256=UJpLMmJJIM5jeI-tXWPBNX4Qd3WS2nTwp3bvJg5D3WY,636
|
| 921 |
+
babel/locale-data/sl.dat,sha256=eEJU8du-WwCkCviFmusUqH8H6sMl2PHG_khSumUB3co,210137
|
| 922 |
+
babel/locale-data/sl_SI.dat,sha256=3Hk2t-MUfAUtqu_Gy0_fTjOhwBUtxdnndQ7Kowg0qek,635
|
| 923 |
+
babel/locale-data/sma.dat,sha256=BaBVbhsEPN9V4JGtMt2TpMdf0oIrL8Maxt2FXDIEEss,944
|
| 924 |
+
babel/locale-data/sma_NO.dat,sha256=OeIJ-EJtvWH6z2dZ1Hv8QdmQC7M7r51t-_C6LD6ZyxE,654
|
| 925 |
+
babel/locale-data/sma_SE.dat,sha256=M_zYllAUd2UaWvccZ6ShB9-Gd8JYzIEln-88Q23syaU,654
|
| 926 |
+
babel/locale-data/smj.dat,sha256=eyHR5AZqbxxlTYhyxJfvTjpz_v6zfh3TrDtcDkCgTig,939
|
| 927 |
+
babel/locale-data/smj_NO.dat,sha256=5fz-YVJEoXswvC-RdFcJWmt-EMGcNXA3c9j_pfmxqCA,654
|
| 928 |
+
babel/locale-data/smj_SE.dat,sha256=7l73FEZcAemOwXSrfPB3X7a0cto3J4oM7AO9i9PMIBU,654
|
| 929 |
+
babel/locale-data/smn.dat,sha256=LGkyaifqt24L0NeExCtzhg8rKEKnkfJNEKtt67B-ViE,40399
|
| 930 |
+
babel/locale-data/smn_FI.dat,sha256=VRY3dbCyxEmDUTep9bQXDRldd5wSg4skqQpztnMXplk,654
|
| 931 |
+
babel/locale-data/sms.dat,sha256=ylATYbrfu8SVEVdQRbC7dTSOKCNSX7O1gjS2wJXA1tU,6521
|
| 932 |
+
babel/locale-data/sms_FI.dat,sha256=b-Mk20lC32xysqU5v6jGjDUYDZaMDvoMwWOZNdT5yuA,654
|
| 933 |
+
babel/locale-data/sn.dat,sha256=FNTHDspBYVPY7Nse1haEc19O0Sf3btsqNWQFs2Zzcgc,16732
|
| 934 |
+
babel/locale-data/sn_ZW.dat,sha256=8HnH2raHHl8PI25abODlThEhjIOGXJb_u7cyQd5YzZw,635
|
| 935 |
+
babel/locale-data/so.dat,sha256=sAFkgMg-qaZYhHT_lyoaggZ8UM_KX1xbS4miB3l5KN8,166227
|
| 936 |
+
babel/locale-data/so_DJ.dat,sha256=VWnaj_MuW4dJnlO84t60ySCvfJL7FXI4nIP9PTL5Amo,656
|
| 937 |
+
babel/locale-data/so_ET.dat,sha256=EvRRqU4yQPMYhkEK8a4MR808fwKHmW7EvPvEJdjltnE,655
|
| 938 |
+
babel/locale-data/so_KE.dat,sha256=OSiRggRZ7CTNmqiGOvW1W2Cw2RqjVESTVOdUfgVgWyU,1208
|
| 939 |
+
babel/locale-data/so_SO.dat,sha256=2IPbOqSxQGB5FukQ-B-MEme9FHYn22ClXmAV4x08pNE,616
|
| 940 |
+
babel/locale-data/sq.dat,sha256=8lTejyAm-94ixpS6Dly7NQSHNsamftqLIdO4OxPWqok,160229
|
| 941 |
+
babel/locale-data/sq_AL.dat,sha256=MN2RvkKGG2PXjCRsMHsvcnwnIOOp9tNSpcInh2uCWaI,635
|
| 942 |
+
babel/locale-data/sq_MK.dat,sha256=L_GaZJ9XuQMs0zw-xZlrefPF36SH0sJqMrdDDbwicZM,1208
|
| 943 |
+
babel/locale-data/sq_XK.dat,sha256=qILZGRwAhuIBJ9xi_T5WTrrZAVouFjQSvybrwgXTsog,1187
|
| 944 |
+
babel/locale-data/sr.dat,sha256=AAE3LN_CLRWzljEERIYedZepxLIDWzENkL4wmu8Ib6c,265725
|
| 945 |
+
babel/locale-data/sr_Cyrl.dat,sha256=Tbo90CyBAWciKeDesPhmXf7sdBQfjWsmyyrKBco_NzU,1990
|
| 946 |
+
babel/locale-data/sr_Cyrl_BA.dat,sha256=sKEcBX9G9OwCmIZEpTphQyW_LM4xoDGe90s_470_AJs,41992
|
| 947 |
+
babel/locale-data/sr_Cyrl_ME.dat,sha256=rDZOf-zykN151tfgGiO1SUJiClzQ6t40gF927bMLn1I,2320
|
| 948 |
+
babel/locale-data/sr_Cyrl_RS.dat,sha256=Tn9u1EvJAZZEIdgXloi326qjpq8b1N087nRQ9R1JbWE,635
|
| 949 |
+
babel/locale-data/sr_Cyrl_XK.dat,sha256=qVevTILYnuaIjRyPy4rDTavVg-VXxKcZ5fVdh5c-aHQ,1574
|
| 950 |
+
babel/locale-data/sr_Latn.dat,sha256=1joKXYRv5UiiT21s_Za6qE-VA8XpFi1HzYnVOjKpxb8,217950
|
| 951 |
+
babel/locale-data/sr_Latn_BA.dat,sha256=of4wpeCglVK_Td6HnHUjHRwuFtCVtWj3kHb3nl4B0D8,32834
|
| 952 |
+
babel/locale-data/sr_Latn_ME.dat,sha256=Mr0GNVLFIMZpBakd4dEUzJUlAN4nyX2BMAqydgtMzWo,2089
|
| 953 |
+
babel/locale-data/sr_Latn_RS.dat,sha256=Tn9u1EvJAZZEIdgXloi326qjpq8b1N087nRQ9R1JbWE,635
|
| 954 |
+
babel/locale-data/sr_Latn_XK.dat,sha256=wIz7XXQrRFYpzMpR_cgSWikPWI0ehSx5a0gRBgt3rFo,1486
|
| 955 |
+
babel/locale-data/ss.dat,sha256=UAB0p3UMDn8KfBY32a7HVWXWpHlPa26Nr_Woaah2c3U,2178
|
| 956 |
+
babel/locale-data/ss_SZ.dat,sha256=X-Va1uVrsPa1ZX5hwhQ-ME6Q_bovUb24XXFS8UQ87lQ,1208
|
| 957 |
+
babel/locale-data/ss_ZA.dat,sha256=xwT3vZ4tmKEvJpVwFMV9U2j2FLF1tC9PEDN6MC6Qbf4,635
|
| 958 |
+
babel/locale-data/ssy.dat,sha256=QyBWLhH_sreFEBHMQ7aiqBsrGvDeQHyYAKioqksa2iU,2999
|
| 959 |
+
babel/locale-data/ssy_ER.dat,sha256=9CRIaVxgOMeMTc0tcV0Yz9yZzq_uD3g3ylZzqVpYzsM,617
|
| 960 |
+
babel/locale-data/st.dat,sha256=b-jiK03L_9F4QqWW8qmRJ3UZntZDI9eMJglRho3MN7c,8016
|
| 961 |
+
babel/locale-data/st_LS.dat,sha256=pSzdNm6-O5V6-14VcgF2iGNYQPFYIXQlY3SqUW3GcjA,1227
|
| 962 |
+
babel/locale-data/st_ZA.dat,sha256=5tdUX7dxXEL2xiS_0IvHvqhKF-gWXFsi4supkP0RDAc,635
|
| 963 |
+
babel/locale-data/su.dat,sha256=G66EuouIQrCxgKGW9JzPfMZ94NAN87P6REyULyyrFGw,11817
|
| 964 |
+
babel/locale-data/su_Latn.dat,sha256=ievzq_m7eD5pZWLnVlH7oMIdeadf8GIMqEuVPJTBjyM,745
|
| 965 |
+
babel/locale-data/su_Latn_ID.dat,sha256=axNaukDpD_-G-_4R7P1u5w4dh-ToRPN_Yo-QpC1cFRU,635
|
| 966 |
+
babel/locale-data/sv.dat,sha256=RTvQ2li9cKHIEbVl7fI8ENVrmcCa1gERk3S9O2bHKmA,198967
|
| 967 |
+
babel/locale-data/sv_AX.dat,sha256=QFGzIe9UCr5gCpgHunvdPiZ-126vP7GYORL9jjip9-E,653
|
| 968 |
+
babel/locale-data/sv_FI.dat,sha256=Pn3EDh-VD0QJFWupEZ6w4TqAa-WC5GZ8oTA4oqLazvc,2526
|
| 969 |
+
babel/locale-data/sv_SE.dat,sha256=c9PG5p2y_4rnxepGD4uOzemBU3EOQhQNO4BtUS1m3rE,653
|
| 970 |
+
babel/locale-data/sw.dat,sha256=w0uX0MB-_bZQWOnbdyDVg1uRVe1j-K-egjRExoZpE8U,145419
|
| 971 |
+
babel/locale-data/sw_CD.dat,sha256=W7Fw8Wqwo3_x4hWlssmWbVTj4hhSQmRv8c-VSnQdlg8,2577
|
| 972 |
+
babel/locale-data/sw_KE.dat,sha256=YMNWSTJ8qxo0d1KvQwAN5ECRaZ9LGc0BDfX4enggVlc,47036
|
| 973 |
+
babel/locale-data/sw_TZ.dat,sha256=I1bDbpEDiR1jkCgJ_W9fWCPuPxMhjQmwG3sIueKb-Rk,616
|
| 974 |
+
babel/locale-data/sw_UG.dat,sha256=kuNdg2N_dLwUKFm7wSheL1wLOdyrukPxLfDw0PN7tT8,660
|
| 975 |
+
babel/locale-data/syr.dat,sha256=vuGk7MOpvWxjzuHSoG8mAJEKGbI70UoRq-DxlvwqT5c,111105
|
| 976 |
+
babel/locale-data/syr_IQ.dat,sha256=Mrw63eJwh0vRe3Lpj0vRf6Q4cUZXJcx9tlWkuAmMrss,679
|
| 977 |
+
babel/locale-data/syr_SY.dat,sha256=l0Yl2UMjm_7kuzvoG2-KqBp5XR88gdjf1ZlpRRNFMuc,679
|
| 978 |
+
babel/locale-data/szl.dat,sha256=8PpGSXa6ES6yxXD2YOBjG16b6BW9jDZo86RKB0MCNn8,88759
|
| 979 |
+
babel/locale-data/szl_PL.dat,sha256=1D5dKaG2l2Haxde8uraWI2J5lzw1dIWGeJtBesua-IM,654
|
| 980 |
+
babel/locale-data/ta.dat,sha256=RRIrxhZ9pdpGShIrQx7ZQBOPKWn15OGkeL8yQOy-tz8,277264
|
| 981 |
+
babel/locale-data/ta_IN.dat,sha256=BOFaDBw7fc7C6xSSFYNfkhCgCUd7ydHprJ6u0DaneSE,658
|
| 982 |
+
babel/locale-data/ta_LK.dat,sha256=Od6ln5oUnWfaAHwt_SDafWv844c7A7_7fTT2OPVTuyw,1208
|
| 983 |
+
babel/locale-data/ta_MY.dat,sha256=PEUmjhs_RUr1R5kH9uHExdnG59Hy8LmbU18vXZYYPtA,1325
|
| 984 |
+
babel/locale-data/ta_SG.dat,sha256=tbuefTSiXPMwpeV085Qp53l5uDHLsMMXmt8TPEG2fWY,1344
|
| 985 |
+
babel/locale-data/te.dat,sha256=oRTQlv5dIZYav2aQWijvc2wm0VwoR1TwWUPL_qhzkuU,261668
|
| 986 |
+
babel/locale-data/te_IN.dat,sha256=LICnXU-D0uhvxVpQ986Ul1JeAQktXaX53sXZSUY3L2g,658
|
| 987 |
+
babel/locale-data/teo.dat,sha256=jJ-266Aw_zTeJjwGj_VASqzm6Y3CcQYkVPXKuV_kzT8,16012
|
| 988 |
+
babel/locale-data/teo_KE.dat,sha256=S_lAg36VkA1w384kzPfXRLmJmGWfmz3ll7MzOQAtcr8,657
|
| 989 |
+
babel/locale-data/teo_UG.dat,sha256=0WlDglms5bCe1AMwCqroaXpOXu9jQroxllMwXWLb8q0,640
|
| 990 |
+
babel/locale-data/tg.dat,sha256=ErMv0Y4SGno9gTSJbhMVKZXiSe_KNSUFaoBeIDaP8tk,117163
|
| 991 |
+
babel/locale-data/tg_TJ.dat,sha256=TCrsEipGp0reAS2mAvwT58tyzBnYJfL5oNHWpEe1ttc,635
|
| 992 |
+
babel/locale-data/th.dat,sha256=lyG_l3_QzfpnjCv8LVaRTvpvfImkVrqcDoUKrnXlIR4,215576
|
| 993 |
+
babel/locale-data/th_TH.dat,sha256=_QhA0WcHmW6Cr_-gU9e6cdpzTMDT19WyHas58fWDUnc,635
|
| 994 |
+
babel/locale-data/ti.dat,sha256=K4kS476YQonyQifjLpS4UkE7hNa2k5aIDBJRIdh2eDg,214273
|
| 995 |
+
babel/locale-data/ti_ER.dat,sha256=m9w0P5TPQ8IqpWKldwdfnw5_1Upv09AjLdO5WUbcRic,962
|
| 996 |
+
babel/locale-data/ti_ET.dat,sha256=q0b9svPg8aj9xmbXr7F6fPHqeTJmclBl5t_hqQk7IuU,635
|
| 997 |
+
babel/locale-data/tig.dat,sha256=cgqxy3wiehP8yceqa5-mrJVT23IP_bjlkeUOEvxspUM,13481
|
| 998 |
+
babel/locale-data/tig_ER.dat,sha256=OoQ0U6yyzmjKwDtzLUpqR09h_ZaGvzXlp7t-HqNxmm4,617
|
| 999 |
+
babel/locale-data/tk.dat,sha256=z5i4kshTasDEolkNpqXnzlZh75EgbAhL0ylT0_0oioo,164932
|
| 1000 |
+
babel/locale-data/tk_TM.dat,sha256=lADxEQoz-_ImDBmpCFUqDPuZ0ozVUhZKOQF2ZwyXVlw,635
|
| 1001 |
+
babel/locale-data/tn.dat,sha256=LgoZgcUCS4t_RsyQQKiVsJ7Kbs7HoInZAMndRk6DUCM,8596
|
| 1002 |
+
babel/locale-data/tn_BW.dat,sha256=jWMFP1tw-o7rslHAlAIgjEXflko8UCDNaSuQ8ccvNHI,654
|
| 1003 |
+
babel/locale-data/tn_ZA.dat,sha256=S3dMOsYSpBwkUv0tW9q0kKawQQl6yx77LexAL5wQqDU,635
|
| 1004 |
+
babel/locale-data/to.dat,sha256=CBr6gRgu0qo_-kIoOluPwu_ZdH4-SPPJHto_ERcDzHA,145255
|
| 1005 |
+
babel/locale-data/to_TO.dat,sha256=jcfJ2Pjof8jGE4q1y5LHSP9rb4IanN58kR7OgG8d5Q0,616
|
| 1006 |
+
babel/locale-data/tok.dat,sha256=kuSPgVhnv8Rr55G-epQDVyh8FfeKxJbd2J0hierJdUQ,8870
|
| 1007 |
+
babel/locale-data/tok_001.dat,sha256=PPUMevT2TBOGFSq-U-AccYkLHSbkWnBRDvxtpokTCD4,693
|
| 1008 |
+
babel/locale-data/tpi.dat,sha256=mqTAJweAOy1SAH2l4mJAKktX-ZeAdvTC8JnBPxXjB0A,4030
|
| 1009 |
+
babel/locale-data/tpi_PG.dat,sha256=uZD_c8yCtiYwt2EO2VOYPzhSTqWMQBOJMCuMCXe3Css,617
|
| 1010 |
+
babel/locale-data/tr.dat,sha256=ULbjOvmQqcT1Z2_8bBOe7LzwgBUg3LWM2MiLkmb8M6w,150824
|
| 1011 |
+
babel/locale-data/tr_CY.dat,sha256=3EmCqxcPvFuZcHCzpTmHb6pjtPwqQvwCfn27B8rtXNw,1227
|
| 1012 |
+
babel/locale-data/tr_TR.dat,sha256=7lS5CMZw76SVlMJxsmIJW5IfL7k9t8MrfKcnElqISSI,635
|
| 1013 |
+
babel/locale-data/trv.dat,sha256=iEbFtCCE_U5rmjAv0Pe5J_UigixMKq1cPIThdZui1Lg,9404
|
| 1014 |
+
babel/locale-data/trv_TW.dat,sha256=CTQtGdDW4Z0n2Ckb6B63HgEwNE44YTFnJCetwd8q9GU,636
|
| 1015 |
+
babel/locale-data/trw.dat,sha256=1e1LGCtVq79RclEMJbgRE4ATdqflV_KDHxBwInSfAKc,110107
|
| 1016 |
+
babel/locale-data/trw_PK.dat,sha256=pBHdOulrwRLiQuC96g8ilUzpKBeG6kglBqUXB8MlURA,636
|
| 1017 |
+
babel/locale-data/ts.dat,sha256=p7EFPucK9HkTVXeNKTU00s-Oas5U_HCPGX9hqT15p9I,5522
|
| 1018 |
+
babel/locale-data/ts_ZA.dat,sha256=AByEO55W3DVVOBIBxIp1F2QwY01-5v6v8sDFOGSxCF0,635
|
| 1019 |
+
babel/locale-data/tt.dat,sha256=X-J0BKEHy01aoARwwb0SWDuNm1lZFrT0akKrzBZjHPM,111014
|
| 1020 |
+
babel/locale-data/tt_RU.dat,sha256=cmv2MzolKOrsRoqQcFZGcXQj_33dLWGh9oUjnebCnz0,653
|
| 1021 |
+
babel/locale-data/twq.dat,sha256=nOSN5UZAxcCgdTxQFh14Cyk5K38olCyAuT6MrVW5PeE,15509
|
| 1022 |
+
babel/locale-data/twq_NE.dat,sha256=y8xQDxMtyStWC83tm_JiekFxAY0Fj-CWWdmic9GBwd4,617
|
| 1023 |
+
babel/locale-data/tyv.dat,sha256=y90_CH7Yksd1Kuc6KhykhpkdGVLUgFDV-B4oSxGqn5E,693
|
| 1024 |
+
babel/locale-data/tyv_RU.dat,sha256=vP_6cjMLB8I8YL7Nqrq4Gu_AWGFuANbZSdBc7ORn_IA,654
|
| 1025 |
+
babel/locale-data/tzm.dat,sha256=wYFO2vX38bht1nAdcVA7dxKVMh-3yC5sItggFaXkKBo,15436
|
| 1026 |
+
babel/locale-data/tzm_MA.dat,sha256=8eku_7voAqAjN651VYKCuIWvdYGOScCyqbt1rtSVO_g,617
|
| 1027 |
+
babel/locale-data/ug.dat,sha256=jRJJxRRKuYljj6kYicIhxWk8ySzpMT9AOePaBk3EO94,117801
|
| 1028 |
+
babel/locale-data/ug_CN.dat,sha256=2UselU1_d6K7NgQj0EDnDfb4Llk51eQZ7z78oYE-Ywg,635
|
| 1029 |
+
babel/locale-data/uk.dat,sha256=b8iEhvLdQxq7rtlqpx1c9vp6-n3jNGPGSuBWNhZAnFA,339125
|
| 1030 |
+
babel/locale-data/uk_UA.dat,sha256=usJw_J4Uu9OD9nrUxNQAx6vMJBWDjbGuc9l7ssJAyuw,635
|
| 1031 |
+
babel/locale-data/ur.dat,sha256=RTL85URWDMA3albZQODUCbVTA9oxeYXo5kWtuL1XW6g,167002
|
| 1032 |
+
babel/locale-data/ur_IN.dat,sha256=9GV9YIa7Mftq14Po2C6fjMG5sWkU8J5LS5bq1iIcsHg,10550
|
| 1033 |
+
babel/locale-data/ur_PK.dat,sha256=EEAGl6fLd1-a7X0n2PwRxlqwYZ0a0ELm2DuLII9spX0,635
|
| 1034 |
+
babel/locale-data/uz.dat,sha256=iwj3ukxb4FK0rZYtC66ftQmTtr1SgTzy12Wu3KkQYQo,138052
|
| 1035 |
+
babel/locale-data/uz_Arab.dat,sha256=wt8BwimSNmoFzrnduGDXMHhqj3B8-XqqN6ghg2Xm74A,3814
|
| 1036 |
+
babel/locale-data/uz_Arab_AF.dat,sha256=68eUCR8KeB0QDQRCvNMiOIkZVRozGKFTDednrQL1X_Y,678
|
| 1037 |
+
babel/locale-data/uz_Cyrl.dat,sha256=RpmyW2YhTwN_o6sKyfJxcktFI6VMqkO6YDzDE8XoOTE,76581
|
| 1038 |
+
babel/locale-data/uz_Cyrl_UZ.dat,sha256=MWJtHPdj_pF2h6abRP4wUwDWAUF4-zr7jBn2RQcZ0z8,635
|
| 1039 |
+
babel/locale-data/uz_Latn.dat,sha256=L5H7Xfz2Ho-vMqviRPC4ai0MnqoF9CIebiq7muISvSA,1292
|
| 1040 |
+
babel/locale-data/uz_Latn_UZ.dat,sha256=MWJtHPdj_pF2h6abRP4wUwDWAUF4-zr7jBn2RQcZ0z8,635
|
| 1041 |
+
babel/locale-data/vai.dat,sha256=T_MWlDAfbp9qgeArFd8yPDPbyThU15kFu19QTQqAlCE,17416
|
| 1042 |
+
babel/locale-data/vai_Latn.dat,sha256=MecJYJumVm7wCyCo-YeAY4eAon5WZ4ZqR0shQ3Pdpu8,14255
|
| 1043 |
+
babel/locale-data/vai_Latn_LR.dat,sha256=LdVmBAL7nzDp-Ab_uHidBAi2crIf9nXhf8tBNfa7xdI,617
|
| 1044 |
+
babel/locale-data/vai_Vaii.dat,sha256=l_IXC76zzJ2lPLfWfjWzSw6xVtFwr-x8LofcHQsSG_0,693
|
| 1045 |
+
babel/locale-data/vai_Vaii_LR.dat,sha256=LdVmBAL7nzDp-Ab_uHidBAi2crIf9nXhf8tBNfa7xdI,617
|
| 1046 |
+
babel/locale-data/ve.dat,sha256=5bInQioXkePSDbBerQqf4sYPTiB9-zpKuDokCXX5eNA,2372
|
| 1047 |
+
babel/locale-data/ve_ZA.dat,sha256=uJndHi9RMKtDWd58f_Q3g5WgXjL3W7KLQj91rVueabQ,635
|
| 1048 |
+
babel/locale-data/vec.dat,sha256=zokLfsgTK7cSP4KaSV8EMpPlHiOkI6tG3rWM7o7vcAM,160413
|
| 1049 |
+
babel/locale-data/vec_IT.dat,sha256=mC9jRfk9ndmkpRIpWZNCwdMwvxvB6QX6_9HanawdaUw,654
|
| 1050 |
+
babel/locale-data/vi.dat,sha256=F95a-fvLPIeJqOlwx4gr9TnWZ0VpSPyzNwJ0RPc1qE8,134138
|
| 1051 |
+
babel/locale-data/vi_VN.dat,sha256=cGwN0vw-qIaeA2g89U97N1xHSMmmaIVNPCLL2P_QJMk,635
|
| 1052 |
+
babel/locale-data/vmw.dat,sha256=mhERiGM-732X9KO0CThGEyjFtSbquT1_rmzYPnru2SM,1796
|
| 1053 |
+
babel/locale-data/vmw_MZ.dat,sha256=sz0j5RufN9oAzTalcjWNhKtCoEXzeRr5Cv6qCouK45E,636
|
| 1054 |
+
babel/locale-data/vo.dat,sha256=werwY25uwomUcf9q1dyQ8Rwgg2aCoLp78XUzBeSw0LY,4609
|
| 1055 |
+
babel/locale-data/vo_001.dat,sha256=iF2xY9XIdxC0mOYEp9hjYZp2EG-si_YaNYXri_60-4w,850
|
| 1056 |
+
babel/locale-data/vun.dat,sha256=VGNPlnoRipnocGYPgeb39d9MmE6fe5nTMWtCk4m1AEY,15373
|
| 1057 |
+
babel/locale-data/vun_TZ.dat,sha256=YKrOeOS1VnU3BWQ7HWtxjS-gMKJcKAPQLf4HTgkzf70,617
|
| 1058 |
+
babel/locale-data/wa.dat,sha256=1r6krApI8oecIKQt_9RzbpwSN0LcWSjlG34Y9Rfh07Y,880
|
| 1059 |
+
babel/locale-data/wa_BE.dat,sha256=j4YADQloo07Oek1j3aOrLYkzcFkrViS1UdRrA0Z56-o,653
|
| 1060 |
+
babel/locale-data/wae.dat,sha256=qBKStFqpkAruVDgeZJvX6U0X-hq_NkETTqgR2e7A4UQ,29641
|
| 1061 |
+
babel/locale-data/wae_CH.dat,sha256=Z0Wzu5Q9IVTnLGwWu54ozVx-fgnFz0IE3yrky8Y1IkQ,654
|
| 1062 |
+
babel/locale-data/wal.dat,sha256=AD9ZfdNNjEhX2n9T0ykd_XwEbXK-wxmsLqq39O4BjWU,8406
|
| 1063 |
+
babel/locale-data/wal_ET.dat,sha256=tNjeuU4GPTWtDmsroGmi4VUql0dA57v1tEtDF4rslVg,636
|
| 1064 |
+
babel/locale-data/wbp.dat,sha256=kzXK04f538n-PrJl6nRKIaYHMid6rJ4ACmzPcCz7NgU,746
|
| 1065 |
+
babel/locale-data/wbp_AU.dat,sha256=BT2E1-WiomuRrteCzN1_AfLyDUdEOm0ehT5miAiepBQ,636
|
| 1066 |
+
babel/locale-data/wo.dat,sha256=iB86SoTMrnphiHy_om1Yxs-J8L5YFWYlbmiQjK6jc2k,61849
|
| 1067 |
+
babel/locale-data/wo_SN.dat,sha256=fvlwe-ImWs04fsxSjTsXf8IPxEIiEi45BX8xhoBC_yg,616
|
| 1068 |
+
babel/locale-data/xh.dat,sha256=xRy095MO_brgAUoDB3UKwhgDvOkBlhJ3cWj9dM2fvHI,64334
|
| 1069 |
+
babel/locale-data/xh_ZA.dat,sha256=9p6wHW1sxOghJMAgsP6BC3RdUhuvLpHoCkqvjsCmPps,635
|
| 1070 |
+
babel/locale-data/xnr.dat,sha256=Ot10zi4F4H5Yqx6kIJGPay65Rm-Gam2eJ7kAOgoJoJ0,142585
|
| 1071 |
+
babel/locale-data/xnr_IN.dat,sha256=UbNwudCNihEFVZu3ymanDhJ52YoupG0SDGwmDByPhzQ,659
|
| 1072 |
+
babel/locale-data/xog.dat,sha256=V4U36ibPCWDoUMf31-o9mDCwylsYU0nZEx5pt-MWecM,15866
|
| 1073 |
+
babel/locale-data/xog_UG.dat,sha256=bMX0Tk5zS4P2LqlOLLpVP4nZxBFhS_qc-ndXjilDCNI,640
|
| 1074 |
+
babel/locale-data/yav.dat,sha256=UupgFFmPVcV-IgY3Fd8Y9GoOcOWgY1P22ZHuA-4QSMU,14543
|
| 1075 |
+
babel/locale-data/yav_CM.dat,sha256=CsaKwep5CARetyBX-JXHFvUVsFe1KTN4Pyz1Wh7NTHw,636
|
| 1076 |
+
babel/locale-data/yi.dat,sha256=OWr2zb3k_toEmkSXcPweqE13Tr5RhvlMm4z358uCQiY,24264
|
| 1077 |
+
babel/locale-data/yi_UA.dat,sha256=DesjWHTuxEBrjOeq8c-B82j4Hnwu0ElR2IH3fZPmq-A,635
|
| 1078 |
+
babel/locale-data/yo.dat,sha256=iWLg-08Fk9QJLZPuokgbCeXkyfyQNaov51TT3i1pKgY,110427
|
| 1079 |
+
babel/locale-data/yo_BJ.dat,sha256=CuxWXwNyq_dWEw-rEwu3-4HAmZfZGwPkljOt0ttEWRc,50090
|
| 1080 |
+
babel/locale-data/yo_NG.dat,sha256=BEIndIiMT1Mo18S5DAWpjefthptCVQkIPeVs0umSop0,616
|
| 1081 |
+
babel/locale-data/yrl.dat,sha256=2nwDuw5Q_dL4H2Oxl5ClzZU2Uw10j-koP5RgfnJ67y0,186854
|
| 1082 |
+
babel/locale-data/yrl_BR.dat,sha256=aUgLCNwgEORk2wtuez8AqkYahB8_mX41IWSqogt39YE,636
|
| 1083 |
+
babel/locale-data/yrl_CO.dat,sha256=pT0rllDKHZAUIK_itrkWP7irmih4im131Ume_wKzyks,9211
|
| 1084 |
+
babel/locale-data/yrl_VE.dat,sha256=_Tqu_pGUkzrd4M9SKXpn4g93z7Q5xlUMAtGvROS5x6M,9211
|
| 1085 |
+
babel/locale-data/yue.dat,sha256=lvTaoHXSVZHqcb5UCR8IeDiVRCE9IRsrDkhv0bGwzCg,143872
|
| 1086 |
+
babel/locale-data/yue_Hans.dat,sha256=ybTM8LU-H-QunhqnLmCQ9bE6zdsYMJPHdlh_hBv3AWk,145194
|
| 1087 |
+
babel/locale-data/yue_Hans_CN.dat,sha256=MOZnu5r0xokf672rwAXfgzG3VEeTfNlDbu36fR1bB6I,636
|
| 1088 |
+
babel/locale-data/yue_Hant.dat,sha256=76wefuhsGIjk0jT05KSTEU_pbb7AfNE2u56jdRoJaDM,1306
|
| 1089 |
+
babel/locale-data/yue_Hant_CN.dat,sha256=l0nSr9oItZCMdphhuVjzHML7FpqAKZorutkLijFAwm4,1196
|
| 1090 |
+
babel/locale-data/yue_Hant_HK.dat,sha256=eMZ7mOTEyKzQz0MDIjvP_Z57CS9nFIP4-Uf0Jpx1CY4,636
|
| 1091 |
+
babel/locale-data/yue_Hant_MO.dat,sha256=d6oknkpchm3cIK_Ylk-PjHAaPKhtyg8cGFVBdqtIJBg,636
|
| 1092 |
+
babel/locale-data/za.dat,sha256=5EbAmE-qqvt_e4geaFxBGJi81CVoZFK4dCcJ346P4yU,12705
|
| 1093 |
+
babel/locale-data/za_CN.dat,sha256=WzhnaughSM1C1twuKYBVrelLEer-guzT43a9yBNXCsg,635
|
| 1094 |
+
babel/locale-data/zgh.dat,sha256=Q2D9KQFgDfWk4fXOdEbPcLq3yX_zxjhlK_PVI61Ok4U,22018
|
| 1095 |
+
babel/locale-data/zgh_MA.dat,sha256=sV8aPBmHY23lKIzsRna-tPz3UiXoKCMQ1Ur2tCyx2YA,617
|
| 1096 |
+
babel/locale-data/zh.dat,sha256=SpSkmdVN5PX7CCdso1B-SyQZKMDTyZfZeT2l_kj2FoI,152100
|
| 1097 |
+
babel/locale-data/zh_Hans.dat,sha256=-wR64b65stjA2KWj4GWcBWiF3yI0A24p4K7wApj8qtc,1305
|
| 1098 |
+
babel/locale-data/zh_Hans_CN.dat,sha256=zz2qPpWEP9ba12T9cGsPXGI7Bg5LcmZ3NkAMiVTf61A,635
|
| 1099 |
+
babel/locale-data/zh_Hans_HK.dat,sha256=yPyZyU-xXSNyU1FYJIYpWwnh0d3uXOra9V9aj2j_YQU,3621
|
| 1100 |
+
babel/locale-data/zh_Hans_MO.dat,sha256=08kUXwHOXA0pRA8qIX7e4p0Nzl1XHSBjwhMh7f-nZBE,3752
|
| 1101 |
+
babel/locale-data/zh_Hans_MY.dat,sha256=iEFxl2XEm1zBzd1K0wXpiZFvU7l0UrNURh2p9DZdRLU,1300
|
| 1102 |
+
babel/locale-data/zh_Hans_SG.dat,sha256=OHZNiUfnteSXuzel-lZAMVgv58iiVTNhjq81T9Qu94s,3948
|
| 1103 |
+
babel/locale-data/zh_Hant.dat,sha256=31aRGt18bl6MdiI9iAozwltdkSQQ370TvzI8gid8CBI,154802
|
| 1104 |
+
babel/locale-data/zh_Hant_HK.dat,sha256=NXPCE_4pYgLatoeKLdQ0d8PQ-Mk_GeMF1s1JYX9m27M,49152
|
| 1105 |
+
babel/locale-data/zh_Hant_MO.dat,sha256=qCWPPEr87U1aemaIuf6nCYQ-Q3w_1HcXrYoncYVBd3g,657
|
| 1106 |
+
babel/locale-data/zh_Hant_MY.dat,sha256=3n4syQpQ9sXVe82sOEH7yQIdrU3dAtMhp7fEhzGN8_E,1203
|
| 1107 |
+
babel/locale-data/zh_Hant_TW.dat,sha256=5N4K8I3XG89knCaSoy97HGzTVOTiUcd_VmfvNJlA4Bg,635
|
| 1108 |
+
babel/locale-data/zh_Latn.dat,sha256=-wR64b65stjA2KWj4GWcBWiF3yI0A24p4K7wApj8qtc,1305
|
| 1109 |
+
babel/locale-data/zh_Latn_CN.dat,sha256=zz2qPpWEP9ba12T9cGsPXGI7Bg5LcmZ3NkAMiVTf61A,635
|
| 1110 |
+
babel/locale-data/zu.dat,sha256=e48g3oI1FjkROV3yHZ2GAwn_8wr2y3dMkj98NHW4X8Q,138626
|
| 1111 |
+
babel/locale-data/zu_ZA.dat,sha256=jHloBfkNbQETXgE-3xVxvESitWb994_-SoY0G4_JL5E,635
|
| 1112 |
+
babel/localedata.py,sha256=94b-NvjmQuidIpptiz2NM-d_3615AxMnV8rQcaWalp0,9133
|
| 1113 |
+
babel/localtime/__init__.py,sha256=EuxZJNvscBH6gM6XKF3pBLWaeRTK3GdNB12WxG3jhaA,1019
|
| 1114 |
+
babel/localtime/__pycache__/__init__.cpython-310.pyc,,
|
| 1115 |
+
babel/localtime/__pycache__/_fallback.cpython-310.pyc,,
|
| 1116 |
+
babel/localtime/__pycache__/_helpers.cpython-310.pyc,,
|
| 1117 |
+
babel/localtime/__pycache__/_unix.cpython-310.pyc,,
|
| 1118 |
+
babel/localtime/__pycache__/_win32.cpython-310.pyc,,
|
| 1119 |
+
babel/localtime/_fallback.py,sha256=9h1CFwVX3laiA2oaZgAywRqEr0ghI4PuTCBKkFgbamI,1199
|
| 1120 |
+
babel/localtime/_helpers.py,sha256=ZmLc8m46W-3GtsstLBdrw6BU3ZhSob8vKHkxgcZG9uw,1704
|
| 1121 |
+
babel/localtime/_unix.py,sha256=22Xkddk98UiDP1LkDDjvxTL9J_5UXIFyDbxj_gD-gv8,3903
|
| 1122 |
+
babel/localtime/_win32.py,sha256=cjImlpejBFxzeP-BqTN2OOevboB06kZAlT_GMqQPqAc,3198
|
| 1123 |
+
babel/messages/__init__.py,sha256=Km-kd7AFHT231GjF16TlHdlWn7s3zQh1xA9SbKrxkWQ,329
|
| 1124 |
+
babel/messages/__pycache__/__init__.cpython-310.pyc,,
|
| 1125 |
+
babel/messages/__pycache__/_compat.cpython-310.pyc,,
|
| 1126 |
+
babel/messages/__pycache__/catalog.cpython-310.pyc,,
|
| 1127 |
+
babel/messages/__pycache__/checkers.cpython-310.pyc,,
|
| 1128 |
+
babel/messages/__pycache__/extract.cpython-310.pyc,,
|
| 1129 |
+
babel/messages/__pycache__/frontend.cpython-310.pyc,,
|
| 1130 |
+
babel/messages/__pycache__/jslexer.cpython-310.pyc,,
|
| 1131 |
+
babel/messages/__pycache__/mofile.cpython-310.pyc,,
|
| 1132 |
+
babel/messages/__pycache__/plurals.cpython-310.pyc,,
|
| 1133 |
+
babel/messages/__pycache__/pofile.cpython-310.pyc,,
|
| 1134 |
+
babel/messages/__pycache__/setuptools_frontend.cpython-310.pyc,,
|
| 1135 |
+
babel/messages/_compat.py,sha256=DNyCNMwH5vXgl_pq7cUYz3VcRC2gIPqeQLO5nN5neWE,1163
|
| 1136 |
+
babel/messages/catalog.py,sha256=7mtA4SWOcJAK_wJvONRKt1AgOKmTVq7PTI1tP73-Jk8,38647
|
| 1137 |
+
babel/messages/checkers.py,sha256=KX50Rceb6rYuCndDYeDijvRe2w1jg4l7RQd7NpaXRY0,6209
|
| 1138 |
+
babel/messages/extract.py,sha256=Ss2wc-uYicxaZ1szXE2SPpWRYx4BxD6wsR-L0VFPd-M,36875
|
| 1139 |
+
babel/messages/frontend.py,sha256=hwbxnZkfeFRriKKAC8NHbb6rHSQ4xOVcE9pbP0Qce3M,47518
|
| 1140 |
+
babel/messages/jslexer.py,sha256=_RRI0T-MDby3sBykA4fEM28qDSBwqdjfsFR2HW6GlsA,7262
|
| 1141 |
+
babel/messages/mofile.py,sha256=GgCmyPLbbChLVMsC6Wk3fiEunnru4u8N0gEvoUxYDr0,6907
|
| 1142 |
+
babel/messages/plurals.py,sha256=Azqltuu3uRrDh0TM-nckgaHlsYLC9-_qcDmWvcRCOwI,7489
|
| 1143 |
+
babel/messages/pofile.py,sha256=aNynbXhhulJizuJQUYKvjbV7ktwWqHLINCzK3MdxZYE,25437
|
| 1144 |
+
babel/messages/setuptools_frontend.py,sha256=m1l9NHuawj1pSncZeC82cUJfdwxib_C7JSUb_2EhbUM,3485
|
| 1145 |
+
babel/numbers.py,sha256=meEj4-Rp5B_WXd-lmHGunWwrw8PL_1oyc5IOPePnHiI,63469
|
| 1146 |
+
babel/plural.py,sha256=zU3sxaLb-jYTcimy-QOZSnDuLv0it-BxcT5H9E49mM0,23186
|
| 1147 |
+
babel/py.typed,sha256=DtCsIDq6KOv2NOEdQjTbeMWJKRh6ZEL2E-6Mf1RLeMA,59
|
| 1148 |
+
babel/support.py,sha256=oYq9nmEbvqpSwTLO69hOZ1TGb51okrEoyFN6M8NklfM,27906
|
| 1149 |
+
babel/units.py,sha256=0WsfuBXU150pPwbznrnt6Mc6vyrij2d9yTJj9MXnbGw,13982
|
| 1150 |
+
babel/util.py,sha256=-Zch-KLaAZgpC4jGGV8twKH8R8pCwd731ozEkUUI1qg,9395
|
micromamba_root/Lib/site-packages/babel-2.18.0.dist-info/REQUESTED
ADDED
|
File without changes
|
micromamba_root/Lib/site-packages/babel-2.18.0.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: setuptools (82.0.0)
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py3-none-any
|
| 5 |
+
|
micromamba_root/Lib/site-packages/babel-2.18.0.dist-info/direct_url.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"dir_info": {}, "url": "file:///home/conda/feedstock_root/build_artifacts/bld/rattler-build_babel_1772555330/work"}
|
micromamba_root/Lib/site-packages/babel-2.18.0.dist-info/entry_points.txt
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[babel.checkers]
|
| 2 |
+
num_plurals = babel.messages.checkers:num_plurals
|
| 3 |
+
python_format = babel.messages.checkers:python_format
|
| 4 |
+
|
| 5 |
+
[babel.extractors]
|
| 6 |
+
ignore = babel.messages.extract:extract_nothing
|
| 7 |
+
javascript = babel.messages.extract:extract_javascript
|
| 8 |
+
python = babel.messages.extract:extract_python
|
| 9 |
+
|
| 10 |
+
[console_scripts]
|
| 11 |
+
pybabel = babel.messages.frontend:main
|
| 12 |
+
|
| 13 |
+
[distutils.commands]
|
| 14 |
+
compile_catalog = babel.messages.setuptools_frontend:compile_catalog
|
| 15 |
+
extract_messages = babel.messages.setuptools_frontend:extract_messages
|
| 16 |
+
init_catalog = babel.messages.setuptools_frontend:init_catalog
|
| 17 |
+
update_catalog = babel.messages.setuptools_frontend:update_catalog
|
| 18 |
+
|
| 19 |
+
[distutils.setup_keywords]
|
| 20 |
+
message_extractors = babel.messages.setuptools_frontend:check_message_extractors
|
micromamba_root/Lib/site-packages/babel-2.18.0.dist-info/top_level.txt
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
babel
|
micromamba_root/Lib/site-packages/babel/__init__.py
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
babel
|
| 3 |
+
~~~~~
|
| 4 |
+
|
| 5 |
+
Integrated collection of utilities that assist in internationalizing and
|
| 6 |
+
localizing applications.
|
| 7 |
+
|
| 8 |
+
This package is basically composed of two major parts:
|
| 9 |
+
|
| 10 |
+
* tools to build and work with ``gettext`` message catalogs
|
| 11 |
+
* a Python interface to the CLDR (Common Locale Data Repository), providing
|
| 12 |
+
access to various locale display names, localized number and date
|
| 13 |
+
formatting, etc.
|
| 14 |
+
|
| 15 |
+
:copyright: (c) 2013-2026 by the Babel Team.
|
| 16 |
+
:license: BSD, see LICENSE for more details.
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
from babel.core import (
|
| 20 |
+
Locale,
|
| 21 |
+
UnknownLocaleError,
|
| 22 |
+
default_locale,
|
| 23 |
+
get_locale_identifier,
|
| 24 |
+
negotiate_locale,
|
| 25 |
+
parse_locale,
|
| 26 |
+
)
|
| 27 |
+
|
| 28 |
+
__version__ = '2.18.0'
|
| 29 |
+
|
| 30 |
+
__all__ = [
|
| 31 |
+
'Locale',
|
| 32 |
+
'UnknownLocaleError',
|
| 33 |
+
'__version__',
|
| 34 |
+
'default_locale',
|
| 35 |
+
'get_locale_identifier',
|
| 36 |
+
'negotiate_locale',
|
| 37 |
+
'parse_locale',
|
| 38 |
+
]
|
micromamba_root/Lib/site-packages/babel/core.py
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
babel.core
|
| 3 |
+
~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Core locale representation and locale data access.
|
| 6 |
+
|
| 7 |
+
:copyright: (c) 2013-2026 by the Babel Team.
|
| 8 |
+
:license: BSD, see LICENSE for more details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from __future__ import annotations
|
| 12 |
+
|
| 13 |
+
import os
|
| 14 |
+
import pickle
|
| 15 |
+
from collections.abc import Iterable, Mapping
|
| 16 |
+
from typing import TYPE_CHECKING, Any, Literal
|
| 17 |
+
|
| 18 |
+
from babel import localedata
|
| 19 |
+
from babel.plural import PluralRule
|
| 20 |
+
|
| 21 |
+
__all__ = [
|
| 22 |
+
'Locale',
|
| 23 |
+
'UnknownLocaleError',
|
| 24 |
+
'default_locale',
|
| 25 |
+
'get_cldr_version',
|
| 26 |
+
'get_global',
|
| 27 |
+
'get_locale_identifier',
|
| 28 |
+
'negotiate_locale',
|
| 29 |
+
'parse_locale',
|
| 30 |
+
]
|
| 31 |
+
|
| 32 |
+
if TYPE_CHECKING:
|
| 33 |
+
from typing_extensions import TypeAlias
|
| 34 |
+
|
| 35 |
+
_GLOBAL_KEY: TypeAlias = Literal[
|
| 36 |
+
"all_currencies",
|
| 37 |
+
"cldr",
|
| 38 |
+
"currency_fractions",
|
| 39 |
+
"language_aliases",
|
| 40 |
+
"likely_subtags",
|
| 41 |
+
"meta_zones",
|
| 42 |
+
"parent_exceptions",
|
| 43 |
+
"script_aliases",
|
| 44 |
+
"territory_aliases",
|
| 45 |
+
"territory_currencies",
|
| 46 |
+
"territory_languages",
|
| 47 |
+
"territory_zones",
|
| 48 |
+
"variant_aliases",
|
| 49 |
+
"windows_zone_mapping",
|
| 50 |
+
"zone_aliases",
|
| 51 |
+
"zone_territories",
|
| 52 |
+
]
|
| 53 |
+
|
| 54 |
+
_global_data: Mapping[_GLOBAL_KEY, Mapping[str, Any]] | None
|
| 55 |
+
|
| 56 |
+
_global_data = None
|
| 57 |
+
_default_plural_rule = PluralRule({})
|
| 58 |
+
|
| 59 |
+
|
| 60 |
+
def _raise_no_data_error():
|
| 61 |
+
raise RuntimeError(
|
| 62 |
+
'The babel data files are not available. '
|
| 63 |
+
'This usually happens because you are using '
|
| 64 |
+
'a source checkout from Babel and you did '
|
| 65 |
+
'not build the data files. Just make sure '
|
| 66 |
+
'to run "python setup.py import_cldr" before '
|
| 67 |
+
'installing the library.',
|
| 68 |
+
)
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
def get_global(key: _GLOBAL_KEY) -> Mapping[str, Any]:
|
| 72 |
+
"""Return the dictionary for the given key in the global data.
|
| 73 |
+
|
| 74 |
+
The global data is stored in the ``babel/global.dat`` file and contains
|
| 75 |
+
information independent of individual locales.
|
| 76 |
+
|
| 77 |
+
>>> get_global('zone_aliases')['UTC']
|
| 78 |
+
'Etc/UTC'
|
| 79 |
+
>>> get_global('zone_territories')['Europe/Berlin']
|
| 80 |
+
'DE'
|
| 81 |
+
|
| 82 |
+
The keys available are:
|
| 83 |
+
|
| 84 |
+
- ``all_currencies``
|
| 85 |
+
- ``cldr`` (metadata)
|
| 86 |
+
- ``currency_fractions``
|
| 87 |
+
- ``language_aliases``
|
| 88 |
+
- ``likely_subtags``
|
| 89 |
+
- ``parent_exceptions``
|
| 90 |
+
- ``script_aliases``
|
| 91 |
+
- ``territory_aliases``
|
| 92 |
+
- ``territory_currencies``
|
| 93 |
+
- ``territory_languages``
|
| 94 |
+
- ``territory_zones``
|
| 95 |
+
- ``variant_aliases``
|
| 96 |
+
- ``windows_zone_mapping``
|
| 97 |
+
- ``zone_aliases``
|
| 98 |
+
- ``zone_territories``
|
| 99 |
+
|
| 100 |
+
.. note:: The internal structure of the data may change between versions.
|
| 101 |
+
|
| 102 |
+
.. versionadded:: 0.9
|
| 103 |
+
|
| 104 |
+
:param key: the data key
|
| 105 |
+
"""
|
| 106 |
+
global _global_data
|
| 107 |
+
if _global_data is None:
|
| 108 |
+
dirname = os.path.join(os.path.dirname(__file__))
|
| 109 |
+
filename = os.path.join(dirname, 'global.dat')
|
| 110 |
+
if not os.path.isfile(filename):
|
| 111 |
+
_raise_no_data_error()
|
| 112 |
+
with open(filename, 'rb') as fileobj:
|
| 113 |
+
_global_data = pickle.load(fileobj)
|
| 114 |
+
assert _global_data is not None
|
| 115 |
+
return _global_data.get(key, {})
|
| 116 |
+
|
| 117 |
+
|
| 118 |
+
LOCALE_ALIASES = {
|
| 119 |
+
'ar': 'ar_SY', 'bg': 'bg_BG', 'bs': 'bs_BA', 'ca': 'ca_ES', 'cs': 'cs_CZ',
|
| 120 |
+
'da': 'da_DK', 'de': 'de_DE', 'el': 'el_GR', 'en': 'en_US', 'es': 'es_ES',
|
| 121 |
+
'et': 'et_EE', 'fa': 'fa_IR', 'fi': 'fi_FI', 'fr': 'fr_FR', 'gl': 'gl_ES',
|
| 122 |
+
'he': 'he_IL', 'hu': 'hu_HU', 'id': 'id_ID', 'is': 'is_IS', 'it': 'it_IT',
|
| 123 |
+
'ja': 'ja_JP', 'km': 'km_KH', 'ko': 'ko_KR', 'lt': 'lt_LT', 'lv': 'lv_LV',
|
| 124 |
+
'mk': 'mk_MK', 'nl': 'nl_NL', 'nn': 'nn_NO', 'no': 'nb_NO', 'pl': 'pl_PL',
|
| 125 |
+
'pt': 'pt_PT', 'ro': 'ro_RO', 'ru': 'ru_RU', 'sk': 'sk_SK', 'sl': 'sl_SI',
|
| 126 |
+
'sv': 'sv_SE', 'th': 'th_TH', 'tr': 'tr_TR', 'uk': 'uk_UA',
|
| 127 |
+
} # fmt: skip
|
| 128 |
+
|
| 129 |
+
|
| 130 |
+
class UnknownLocaleError(Exception):
|
| 131 |
+
"""Exception thrown when a locale is requested for which no locale data
|
| 132 |
+
is available.
|
| 133 |
+
"""
|
| 134 |
+
|
| 135 |
+
def __init__(self, identifier: str) -> None:
|
| 136 |
+
"""Create the exception.
|
| 137 |
+
|
| 138 |
+
:param identifier: the identifier string of the unsupported locale
|
| 139 |
+
"""
|
| 140 |
+
Exception.__init__(self, f"unknown locale {identifier!r}")
|
| 141 |
+
|
| 142 |
+
#: The identifier of the locale that could not be found.
|
| 143 |
+
self.identifier = identifier
|
| 144 |
+
|
| 145 |
+
|
| 146 |
+
class Locale:
|
| 147 |
+
"""Representation of a specific locale.
|
| 148 |
+
|
| 149 |
+
>>> locale = Locale('en', 'US')
|
| 150 |
+
>>> repr(locale)
|
| 151 |
+
"Locale('en', territory='US')"
|
| 152 |
+
>>> locale.display_name
|
| 153 |
+
'English (United States)'
|
| 154 |
+
|
| 155 |
+
A `Locale` object can also be instantiated from a raw locale string:
|
| 156 |
+
|
| 157 |
+
>>> locale = Locale.parse('en-US', sep='-')
|
| 158 |
+
>>> repr(locale)
|
| 159 |
+
"Locale('en', territory='US')"
|
| 160 |
+
|
| 161 |
+
`Locale` objects provide access to a collection of locale data, such as
|
| 162 |
+
territory and language names, number and date format patterns, and more:
|
| 163 |
+
|
| 164 |
+
>>> locale.number_symbols['latn']['decimal']
|
| 165 |
+
'.'
|
| 166 |
+
|
| 167 |
+
If a locale is requested for which no locale data is available, an
|
| 168 |
+
`UnknownLocaleError` is raised:
|
| 169 |
+
|
| 170 |
+
>>> Locale.parse('en_XX')
|
| 171 |
+
Traceback (most recent call last):
|
| 172 |
+
...
|
| 173 |
+
UnknownLocaleError: unknown locale 'en_XX'
|
| 174 |
+
|
| 175 |
+
For more information see :rfc:`3066`.
|
| 176 |
+
"""
|
| 177 |
+
|
| 178 |
+
def __init__(
|
| 179 |
+
self,
|
| 180 |
+
language: str,
|
| 181 |
+
territory: str | None = None,
|
| 182 |
+
script: str | None = None,
|
| 183 |
+
variant: str | None = None,
|
| 184 |
+
modifier: str | None = None,
|
| 185 |
+
) -> None:
|
| 186 |
+
"""Initialize the locale object from the given identifier components.
|
| 187 |
+
|
| 188 |
+
>>> locale = Locale('en', 'US')
|
| 189 |
+
>>> locale.language
|
| 190 |
+
'en'
|
| 191 |
+
>>> locale.territory
|
| 192 |
+
'US'
|
| 193 |
+
|
| 194 |
+
:param language: the language code
|
| 195 |
+
:param territory: the territory (country or region) code
|
| 196 |
+
:param script: the script code
|
| 197 |
+
:param variant: the variant code
|
| 198 |
+
:param modifier: a modifier (following the '@' symbol, sometimes called '@variant')
|
| 199 |
+
:raise `UnknownLocaleError`: if no locale data is available for the
|
| 200 |
+
requested locale
|
| 201 |
+
"""
|
| 202 |
+
#: the language code
|
| 203 |
+
self.language = language
|
| 204 |
+
#: the territory (country or region) code
|
| 205 |
+
self.territory = territory
|
| 206 |
+
#: the script code
|
| 207 |
+
self.script = script
|
| 208 |
+
#: the variant code
|
| 209 |
+
self.variant = variant
|
| 210 |
+
#: the modifier
|
| 211 |
+
self.modifier = modifier
|
| 212 |
+
self.__data: localedata.LocaleDataDict | None = None
|
| 213 |
+
|
| 214 |
+
identifier = str(self)
|
| 215 |
+
identifier_without_modifier = identifier.partition('@')[0]
|
| 216 |
+
if localedata.exists(identifier):
|
| 217 |
+
self.__data_identifier = identifier
|
| 218 |
+
elif localedata.exists(identifier_without_modifier):
|
| 219 |
+
self.__data_identifier = identifier_without_modifier
|
| 220 |
+
else:
|
| 221 |
+
raise UnknownLocaleError(identifier)
|
| 222 |
+
|
| 223 |
+
@classmethod
|
| 224 |
+
def default(
|
| 225 |
+
cls,
|
| 226 |
+
category: str | None = None,
|
| 227 |
+
aliases: Mapping[str, str] = LOCALE_ALIASES,
|
| 228 |
+
) -> Locale:
|
| 229 |
+
"""Return the system default locale for the specified category.
|
| 230 |
+
|
| 231 |
+
>>> for name in ['LANGUAGE', 'LC_ALL', 'LC_CTYPE', 'LC_MESSAGES']:
|
| 232 |
+
... os.environ[name] = ''
|
| 233 |
+
>>> os.environ['LANG'] = 'fr_FR.UTF-8'
|
| 234 |
+
>>> Locale.default('LC_MESSAGES')
|
| 235 |
+
Locale('fr', territory='FR')
|
| 236 |
+
|
| 237 |
+
The following fallbacks to the variable are always considered:
|
| 238 |
+
|
| 239 |
+
- ``LANGUAGE``
|
| 240 |
+
- ``LC_ALL``
|
| 241 |
+
- ``LC_CTYPE``
|
| 242 |
+
- ``LANG``
|
| 243 |
+
|
| 244 |
+
:param category: one of the ``LC_XXX`` environment variable names
|
| 245 |
+
:param aliases: a dictionary of aliases for locale identifiers
|
| 246 |
+
"""
|
| 247 |
+
# XXX: use likely subtag expansion here instead of the
|
| 248 |
+
# aliases dictionary.
|
| 249 |
+
locale_string = default_locale(category, aliases=aliases)
|
| 250 |
+
return cls.parse(locale_string)
|
| 251 |
+
|
| 252 |
+
@classmethod
|
| 253 |
+
def negotiate(
|
| 254 |
+
cls,
|
| 255 |
+
preferred: Iterable[str],
|
| 256 |
+
available: Iterable[str],
|
| 257 |
+
sep: str = '_',
|
| 258 |
+
aliases: Mapping[str, str] = LOCALE_ALIASES,
|
| 259 |
+
) -> Locale | None:
|
| 260 |
+
"""Find the best match between available and requested locale strings.
|
| 261 |
+
|
| 262 |
+
>>> Locale.negotiate(['de_DE', 'en_US'], ['de_DE', 'de_AT'])
|
| 263 |
+
Locale('de', territory='DE')
|
| 264 |
+
>>> Locale.negotiate(['de_DE', 'en_US'], ['en', 'de'])
|
| 265 |
+
Locale('de')
|
| 266 |
+
>>> Locale.negotiate(['de_DE', 'de'], ['en_US'])
|
| 267 |
+
|
| 268 |
+
You can specify the character used in the locale identifiers to separate
|
| 269 |
+
the different components. This separator is applied to both lists. Also,
|
| 270 |
+
case is ignored in the comparison:
|
| 271 |
+
|
| 272 |
+
>>> Locale.negotiate(['de-DE', 'de'], ['en-us', 'de-de'], sep='-')
|
| 273 |
+
Locale('de', territory='DE')
|
| 274 |
+
|
| 275 |
+
:param preferred: the list of locale identifiers preferred by the user
|
| 276 |
+
:param available: the list of locale identifiers available
|
| 277 |
+
:param aliases: a dictionary of aliases for locale identifiers
|
| 278 |
+
:param sep: separator for parsing; e.g. Windows tends to use '-' instead of '_'.
|
| 279 |
+
"""
|
| 280 |
+
identifier = negotiate_locale(preferred, available, sep=sep, aliases=aliases)
|
| 281 |
+
if identifier:
|
| 282 |
+
return Locale.parse(identifier, sep=sep)
|
| 283 |
+
return None
|
| 284 |
+
|
| 285 |
+
@classmethod
|
| 286 |
+
def parse(
|
| 287 |
+
cls,
|
| 288 |
+
identifier: Locale | str | None,
|
| 289 |
+
sep: str = '_',
|
| 290 |
+
resolve_likely_subtags: bool = True,
|
| 291 |
+
) -> Locale:
|
| 292 |
+
"""Create a `Locale` instance for the given locale identifier.
|
| 293 |
+
|
| 294 |
+
>>> l = Locale.parse('de-DE', sep='-')
|
| 295 |
+
>>> l.display_name
|
| 296 |
+
'Deutsch (Deutschland)'
|
| 297 |
+
|
| 298 |
+
If the `identifier` parameter is not a string, but actually a `Locale`
|
| 299 |
+
object, that object is returned:
|
| 300 |
+
|
| 301 |
+
>>> Locale.parse(l)
|
| 302 |
+
Locale('de', territory='DE')
|
| 303 |
+
|
| 304 |
+
If the `identifier` parameter is neither of these, such as `None`
|
| 305 |
+
or an empty string, e.g. because a default locale identifier
|
| 306 |
+
could not be determined, a `TypeError` is raised:
|
| 307 |
+
|
| 308 |
+
>>> Locale.parse(None)
|
| 309 |
+
Traceback (most recent call last):
|
| 310 |
+
...
|
| 311 |
+
TypeError: ...
|
| 312 |
+
|
| 313 |
+
This also can perform resolving of likely subtags which it does
|
| 314 |
+
by default. This is for instance useful to figure out the most
|
| 315 |
+
likely locale for a territory you can use ``'und'`` as the
|
| 316 |
+
language tag:
|
| 317 |
+
|
| 318 |
+
>>> Locale.parse('und_AT')
|
| 319 |
+
Locale('de', territory='AT')
|
| 320 |
+
|
| 321 |
+
Modifiers are optional, and always at the end, separated by "@":
|
| 322 |
+
|
| 323 |
+
>>> Locale.parse('de_AT@euro')
|
| 324 |
+
Locale('de', territory='AT', modifier='euro')
|
| 325 |
+
|
| 326 |
+
:param identifier: the locale identifier string
|
| 327 |
+
:param sep: optional component separator
|
| 328 |
+
:param resolve_likely_subtags: if this is specified then a locale will
|
| 329 |
+
have its likely subtag resolved if the
|
| 330 |
+
locale otherwise does not exist. For
|
| 331 |
+
instance ``zh_TW`` by itself is not a
|
| 332 |
+
locale that exists but Babel can
|
| 333 |
+
automatically expand it to the full
|
| 334 |
+
form of ``zh_hant_TW``. Note that this
|
| 335 |
+
expansion is only taking place if no
|
| 336 |
+
locale exists otherwise. For instance
|
| 337 |
+
there is a locale ``en`` that can exist
|
| 338 |
+
by itself.
|
| 339 |
+
:raise `ValueError`: if the string does not appear to be a valid locale
|
| 340 |
+
identifier
|
| 341 |
+
:raise `UnknownLocaleError`: if no locale data is available for the
|
| 342 |
+
requested locale
|
| 343 |
+
:raise `TypeError`: if the identifier is not a string or a `Locale`
|
| 344 |
+
:raise `ValueError`: if the identifier is not a valid string
|
| 345 |
+
"""
|
| 346 |
+
if isinstance(identifier, Locale):
|
| 347 |
+
return identifier
|
| 348 |
+
|
| 349 |
+
if not identifier:
|
| 350 |
+
msg = (
|
| 351 |
+
f"Empty locale identifier value: {identifier!r}\n\n"
|
| 352 |
+
f"If you didn't explicitly pass an empty value to a Babel function, "
|
| 353 |
+
f"this could be caused by there being no suitable locale environment "
|
| 354 |
+
f"variables for the API you tried to use."
|
| 355 |
+
)
|
| 356 |
+
if isinstance(identifier, str):
|
| 357 |
+
# `parse_locale` would raise a ValueError, so let's do that here
|
| 358 |
+
raise ValueError(msg)
|
| 359 |
+
raise TypeError(msg)
|
| 360 |
+
|
| 361 |
+
if not isinstance(identifier, str):
|
| 362 |
+
raise TypeError(f"Unexpected value for identifier: {identifier!r}")
|
| 363 |
+
|
| 364 |
+
parts = parse_locale(identifier, sep=sep)
|
| 365 |
+
input_id = get_locale_identifier(parts)
|
| 366 |
+
|
| 367 |
+
def _try_load(parts):
|
| 368 |
+
try:
|
| 369 |
+
return cls(*parts)
|
| 370 |
+
except UnknownLocaleError:
|
| 371 |
+
return None
|
| 372 |
+
|
| 373 |
+
def _try_load_reducing(parts):
|
| 374 |
+
# Success on first hit, return it.
|
| 375 |
+
locale = _try_load(parts)
|
| 376 |
+
if locale is not None:
|
| 377 |
+
return locale
|
| 378 |
+
|
| 379 |
+
# Now try without script and variant
|
| 380 |
+
locale = _try_load(parts[:2])
|
| 381 |
+
if locale is not None:
|
| 382 |
+
return locale
|
| 383 |
+
|
| 384 |
+
locale = _try_load(parts)
|
| 385 |
+
if locale is not None:
|
| 386 |
+
return locale
|
| 387 |
+
if not resolve_likely_subtags:
|
| 388 |
+
raise UnknownLocaleError(input_id)
|
| 389 |
+
|
| 390 |
+
# From here onwards is some very bad likely subtag resolving. This
|
| 391 |
+
# whole logic is not entirely correct but good enough (tm) for the
|
| 392 |
+
# time being. This has been added so that zh_TW does not cause
|
| 393 |
+
# errors for people when they upgrade. Later we should properly
|
| 394 |
+
# implement ICU like fuzzy locale objects and provide a way to
|
| 395 |
+
# maximize and minimize locale tags.
|
| 396 |
+
|
| 397 |
+
if len(parts) == 5:
|
| 398 |
+
language, territory, script, variant, modifier = parts
|
| 399 |
+
else:
|
| 400 |
+
language, territory, script, variant = parts
|
| 401 |
+
modifier = None
|
| 402 |
+
language = get_global('language_aliases').get(language, language)
|
| 403 |
+
territory = get_global('territory_aliases').get(territory or '', (territory,))[0]
|
| 404 |
+
script = get_global('script_aliases').get(script or '', script)
|
| 405 |
+
variant = get_global('variant_aliases').get(variant or '', variant)
|
| 406 |
+
|
| 407 |
+
if territory == 'ZZ':
|
| 408 |
+
territory = None
|
| 409 |
+
if script == 'Zzzz':
|
| 410 |
+
script = None
|
| 411 |
+
|
| 412 |
+
parts = language, territory, script, variant, modifier
|
| 413 |
+
|
| 414 |
+
# First match: try the whole identifier
|
| 415 |
+
new_id = get_locale_identifier(parts)
|
| 416 |
+
likely_subtag = get_global('likely_subtags').get(new_id)
|
| 417 |
+
if likely_subtag is not None:
|
| 418 |
+
locale = _try_load_reducing(parse_locale(likely_subtag))
|
| 419 |
+
if locale is not None:
|
| 420 |
+
return locale
|
| 421 |
+
|
| 422 |
+
# If we did not find anything so far, try again with a
|
| 423 |
+
# simplified identifier that is just the language
|
| 424 |
+
likely_subtag = get_global('likely_subtags').get(language)
|
| 425 |
+
if likely_subtag is not None:
|
| 426 |
+
parts2 = parse_locale(likely_subtag)
|
| 427 |
+
if len(parts2) == 5:
|
| 428 |
+
language2, _, script2, variant2, modifier2 = parts2
|
| 429 |
+
else:
|
| 430 |
+
language2, _, script2, variant2 = parts2
|
| 431 |
+
modifier2 = None
|
| 432 |
+
locale = _try_load_reducing(
|
| 433 |
+
(language2, territory, script2, variant2, modifier2),
|
| 434 |
+
)
|
| 435 |
+
if locale is not None:
|
| 436 |
+
return locale
|
| 437 |
+
|
| 438 |
+
raise UnknownLocaleError(input_id)
|
| 439 |
+
|
| 440 |
+
def __eq__(self, other: object) -> bool:
|
| 441 |
+
for key in ('language', 'territory', 'script', 'variant', 'modifier'):
|
| 442 |
+
if not hasattr(other, key):
|
| 443 |
+
return False
|
| 444 |
+
return (
|
| 445 |
+
self.language == getattr(other, 'language') # noqa: B009
|
| 446 |
+
and self.territory == getattr(other, 'territory') # noqa: B009
|
| 447 |
+
and self.script == getattr(other, 'script') # noqa: B009
|
| 448 |
+
and self.variant == getattr(other, 'variant') # noqa: B009
|
| 449 |
+
and self.modifier == getattr(other, 'modifier') # noqa: B009
|
| 450 |
+
)
|
| 451 |
+
|
| 452 |
+
def __ne__(self, other: object) -> bool:
|
| 453 |
+
return not self.__eq__(other)
|
| 454 |
+
|
| 455 |
+
def __hash__(self) -> int:
|
| 456 |
+
return hash((self.language, self.territory, self.script, self.variant, self.modifier))
|
| 457 |
+
|
| 458 |
+
def __repr__(self) -> str:
|
| 459 |
+
parameters = ['']
|
| 460 |
+
for key in ('territory', 'script', 'variant', 'modifier'):
|
| 461 |
+
value = getattr(self, key)
|
| 462 |
+
if value is not None:
|
| 463 |
+
parameters.append(f"{key}={value!r}")
|
| 464 |
+
return f"Locale({self.language!r}{', '.join(parameters)})"
|
| 465 |
+
|
| 466 |
+
def __str__(self) -> str:
|
| 467 |
+
return get_locale_identifier(
|
| 468 |
+
(self.language, self.territory, self.script, self.variant, self.modifier),
|
| 469 |
+
)
|
| 470 |
+
|
| 471 |
+
@property
|
| 472 |
+
def _data(self) -> localedata.LocaleDataDict:
|
| 473 |
+
if self.__data is None:
|
| 474 |
+
self.__data = localedata.LocaleDataDict(localedata.load(self.__data_identifier))
|
| 475 |
+
return self.__data
|
| 476 |
+
|
| 477 |
+
def get_display_name(self, locale: Locale | str | None = None) -> str | None:
|
| 478 |
+
"""Return the display name of the locale using the given locale.
|
| 479 |
+
|
| 480 |
+
The display name will include the language, territory, script, and
|
| 481 |
+
variant, if those are specified.
|
| 482 |
+
|
| 483 |
+
>>> Locale('zh', 'CN', script='Hans').get_display_name('en')
|
| 484 |
+
'Chinese (Simplified, China)'
|
| 485 |
+
|
| 486 |
+
Modifiers are currently passed through verbatim:
|
| 487 |
+
|
| 488 |
+
>>> Locale('it', 'IT', modifier='euro').get_display_name('en')
|
| 489 |
+
'Italian (Italy, euro)'
|
| 490 |
+
|
| 491 |
+
:param locale: the locale to use
|
| 492 |
+
"""
|
| 493 |
+
if locale is None:
|
| 494 |
+
locale = self
|
| 495 |
+
locale = Locale.parse(locale)
|
| 496 |
+
retval = locale.languages.get(self.language)
|
| 497 |
+
if retval and (self.territory or self.script or self.variant):
|
| 498 |
+
details = []
|
| 499 |
+
if self.script:
|
| 500 |
+
details.append(locale.scripts.get(self.script))
|
| 501 |
+
if self.territory:
|
| 502 |
+
details.append(locale.territories.get(self.territory))
|
| 503 |
+
if self.variant:
|
| 504 |
+
details.append(locale.variants.get(self.variant))
|
| 505 |
+
if self.modifier:
|
| 506 |
+
details.append(self.modifier)
|
| 507 |
+
detail_string = ', '.join(atom for atom in details if atom)
|
| 508 |
+
if detail_string:
|
| 509 |
+
retval += f" ({detail_string})"
|
| 510 |
+
return retval
|
| 511 |
+
|
| 512 |
+
display_name = property(
|
| 513 |
+
get_display_name,
|
| 514 |
+
doc="""\
|
| 515 |
+
The localized display name of the locale.
|
| 516 |
+
|
| 517 |
+
>>> Locale('en').display_name
|
| 518 |
+
'English'
|
| 519 |
+
>>> Locale('en', 'US').display_name
|
| 520 |
+
'English (United States)'
|
| 521 |
+
>>> Locale('sv').display_name
|
| 522 |
+
'svenska'
|
| 523 |
+
|
| 524 |
+
:type: `unicode`
|
| 525 |
+
""",
|
| 526 |
+
)
|
| 527 |
+
|
| 528 |
+
def get_language_name(self, locale: Locale | str | None = None) -> str | None:
|
| 529 |
+
"""Return the language of this locale in the given locale.
|
| 530 |
+
|
| 531 |
+
>>> Locale('zh', 'CN', script='Hans').get_language_name('de')
|
| 532 |
+
'Chinesisch'
|
| 533 |
+
|
| 534 |
+
.. versionadded:: 1.0
|
| 535 |
+
|
| 536 |
+
:param locale: the locale to use
|
| 537 |
+
"""
|
| 538 |
+
if locale is None:
|
| 539 |
+
locale = self
|
| 540 |
+
locale = Locale.parse(locale)
|
| 541 |
+
return locale.languages.get(self.language)
|
| 542 |
+
|
| 543 |
+
language_name = property(
|
| 544 |
+
get_language_name,
|
| 545 |
+
doc="""\
|
| 546 |
+
The localized language name of the locale.
|
| 547 |
+
|
| 548 |
+
>>> Locale('en', 'US').language_name
|
| 549 |
+
'English'
|
| 550 |
+
""",
|
| 551 |
+
)
|
| 552 |
+
|
| 553 |
+
def get_territory_name(self, locale: Locale | str | None = None) -> str | None:
|
| 554 |
+
"""Return the territory name in the given locale."""
|
| 555 |
+
if locale is None:
|
| 556 |
+
locale = self
|
| 557 |
+
locale = Locale.parse(locale)
|
| 558 |
+
return locale.territories.get(self.territory or '')
|
| 559 |
+
|
| 560 |
+
territory_name = property(
|
| 561 |
+
get_territory_name,
|
| 562 |
+
doc="""\
|
| 563 |
+
The localized territory name of the locale if available.
|
| 564 |
+
|
| 565 |
+
>>> Locale('de', 'DE').territory_name
|
| 566 |
+
'Deutschland'
|
| 567 |
+
""",
|
| 568 |
+
)
|
| 569 |
+
|
| 570 |
+
def get_script_name(self, locale: Locale | str | None = None) -> str | None:
|
| 571 |
+
"""Return the script name in the given locale."""
|
| 572 |
+
if locale is None:
|
| 573 |
+
locale = self
|
| 574 |
+
locale = Locale.parse(locale)
|
| 575 |
+
return locale.scripts.get(self.script or '')
|
| 576 |
+
|
| 577 |
+
script_name = property(
|
| 578 |
+
get_script_name,
|
| 579 |
+
doc="""\
|
| 580 |
+
The localized script name of the locale if available.
|
| 581 |
+
|
| 582 |
+
>>> Locale('sr', 'ME', script='Latn').script_name
|
| 583 |
+
'latinica'
|
| 584 |
+
""",
|
| 585 |
+
)
|
| 586 |
+
|
| 587 |
+
@property
|
| 588 |
+
def english_name(self) -> str | None:
|
| 589 |
+
"""The english display name of the locale.
|
| 590 |
+
|
| 591 |
+
>>> Locale('de').english_name
|
| 592 |
+
'German'
|
| 593 |
+
>>> Locale('de', 'DE').english_name
|
| 594 |
+
'German (Germany)'
|
| 595 |
+
|
| 596 |
+
:type: `unicode`"""
|
| 597 |
+
return self.get_display_name(Locale('en'))
|
| 598 |
+
|
| 599 |
+
# { General Locale Display Names
|
| 600 |
+
|
| 601 |
+
@property
|
| 602 |
+
def languages(self) -> localedata.LocaleDataDict:
|
| 603 |
+
"""Mapping of language codes to translated language names.
|
| 604 |
+
|
| 605 |
+
>>> Locale('de', 'DE').languages['ja']
|
| 606 |
+
'Japanisch'
|
| 607 |
+
|
| 608 |
+
See `ISO 639 <https://www.loc.gov/standards/iso639-2/>`_ for
|
| 609 |
+
more information.
|
| 610 |
+
"""
|
| 611 |
+
return self._data['languages']
|
| 612 |
+
|
| 613 |
+
@property
|
| 614 |
+
def scripts(self) -> localedata.LocaleDataDict:
|
| 615 |
+
"""Mapping of script codes to translated script names.
|
| 616 |
+
|
| 617 |
+
>>> Locale('en', 'US').scripts['Hira']
|
| 618 |
+
'Hiragana'
|
| 619 |
+
|
| 620 |
+
See `ISO 15924 <https://www.unicode.org/iso15924/>`_
|
| 621 |
+
for more information.
|
| 622 |
+
"""
|
| 623 |
+
return self._data['scripts']
|
| 624 |
+
|
| 625 |
+
@property
|
| 626 |
+
def territories(self) -> localedata.LocaleDataDict:
|
| 627 |
+
"""Mapping of script codes to translated script names.
|
| 628 |
+
|
| 629 |
+
>>> Locale('es', 'CO').territories['DE']
|
| 630 |
+
'Alemania'
|
| 631 |
+
|
| 632 |
+
See `ISO 3166 <https://en.wikipedia.org/wiki/ISO_3166>`_
|
| 633 |
+
for more information.
|
| 634 |
+
"""
|
| 635 |
+
return self._data['territories']
|
| 636 |
+
|
| 637 |
+
@property
|
| 638 |
+
def variants(self) -> localedata.LocaleDataDict:
|
| 639 |
+
"""Mapping of script codes to translated script names.
|
| 640 |
+
|
| 641 |
+
>>> Locale('de', 'DE').variants['1901']
|
| 642 |
+
'Alte deutsche Rechtschreibung'
|
| 643 |
+
"""
|
| 644 |
+
return self._data['variants']
|
| 645 |
+
|
| 646 |
+
# { Number Formatting
|
| 647 |
+
|
| 648 |
+
@property
|
| 649 |
+
def currencies(self) -> localedata.LocaleDataDict:
|
| 650 |
+
"""Mapping of currency codes to translated currency names. This
|
| 651 |
+
only returns the generic form of the currency name, not the count
|
| 652 |
+
specific one. If an actual number is requested use the
|
| 653 |
+
:func:`babel.numbers.get_currency_name` function.
|
| 654 |
+
|
| 655 |
+
>>> Locale('en').currencies['COP']
|
| 656 |
+
'Colombian Peso'
|
| 657 |
+
>>> Locale('de', 'DE').currencies['COP']
|
| 658 |
+
'Kolumbianischer Peso'
|
| 659 |
+
"""
|
| 660 |
+
return self._data['currency_names']
|
| 661 |
+
|
| 662 |
+
@property
|
| 663 |
+
def currency_symbols(self) -> localedata.LocaleDataDict:
|
| 664 |
+
"""Mapping of currency codes to symbols.
|
| 665 |
+
|
| 666 |
+
>>> Locale('en', 'US').currency_symbols['USD']
|
| 667 |
+
'$'
|
| 668 |
+
>>> Locale('es', 'CO').currency_symbols['USD']
|
| 669 |
+
'US$'
|
| 670 |
+
"""
|
| 671 |
+
return self._data['currency_symbols']
|
| 672 |
+
|
| 673 |
+
@property
|
| 674 |
+
def number_symbols(self) -> localedata.LocaleDataDict:
|
| 675 |
+
"""Symbols used in number formatting by number system.
|
| 676 |
+
|
| 677 |
+
.. note:: The format of the value returned may change between
|
| 678 |
+
Babel versions.
|
| 679 |
+
|
| 680 |
+
>>> Locale('fr', 'FR').number_symbols["latn"]['decimal']
|
| 681 |
+
','
|
| 682 |
+
>>> Locale('fa', 'IR').number_symbols["arabext"]['decimal']
|
| 683 |
+
'٫'
|
| 684 |
+
>>> Locale('fa', 'IR').number_symbols["latn"]['decimal']
|
| 685 |
+
'.'
|
| 686 |
+
"""
|
| 687 |
+
return self._data['number_symbols']
|
| 688 |
+
|
| 689 |
+
@property
|
| 690 |
+
def other_numbering_systems(self) -> localedata.LocaleDataDict:
|
| 691 |
+
"""
|
| 692 |
+
Mapping of other numbering systems available for the locale.
|
| 693 |
+
See: https://www.unicode.org/reports/tr35/tr35-numbers.html#otherNumberingSystems
|
| 694 |
+
|
| 695 |
+
>>> Locale('el', 'GR').other_numbering_systems['traditional']
|
| 696 |
+
'grek'
|
| 697 |
+
|
| 698 |
+
.. note:: The format of the value returned may change between
|
| 699 |
+
Babel versions.
|
| 700 |
+
"""
|
| 701 |
+
return self._data['numbering_systems']
|
| 702 |
+
|
| 703 |
+
@property
|
| 704 |
+
def default_numbering_system(self) -> str:
|
| 705 |
+
"""The default numbering system used by the locale.
|
| 706 |
+
>>> Locale('el', 'GR').default_numbering_system
|
| 707 |
+
'latn'
|
| 708 |
+
"""
|
| 709 |
+
return self._data['default_numbering_system']
|
| 710 |
+
|
| 711 |
+
@property
|
| 712 |
+
def decimal_formats(self) -> localedata.LocaleDataDict:
|
| 713 |
+
"""Locale patterns for decimal number formatting.
|
| 714 |
+
|
| 715 |
+
.. note:: The format of the value returned may change between
|
| 716 |
+
Babel versions.
|
| 717 |
+
|
| 718 |
+
>>> Locale('en', 'US').decimal_formats[None]
|
| 719 |
+
<NumberPattern '#,##0.###'>
|
| 720 |
+
"""
|
| 721 |
+
return self._data['decimal_formats']
|
| 722 |
+
|
| 723 |
+
@property
|
| 724 |
+
def compact_decimal_formats(self) -> localedata.LocaleDataDict:
|
| 725 |
+
"""Locale patterns for compact decimal number formatting.
|
| 726 |
+
|
| 727 |
+
.. note:: The format of the value returned may change between
|
| 728 |
+
Babel versions.
|
| 729 |
+
|
| 730 |
+
>>> Locale('en', 'US').compact_decimal_formats["short"]["one"]["1000"]
|
| 731 |
+
<NumberPattern '0K'>
|
| 732 |
+
"""
|
| 733 |
+
return self._data['compact_decimal_formats']
|
| 734 |
+
|
| 735 |
+
@property
|
| 736 |
+
def currency_formats(self) -> localedata.LocaleDataDict:
|
| 737 |
+
"""Locale patterns for currency number formatting.
|
| 738 |
+
|
| 739 |
+
.. note:: The format of the value returned may change between
|
| 740 |
+
Babel versions.
|
| 741 |
+
|
| 742 |
+
>>> Locale('en', 'US').currency_formats['standard']
|
| 743 |
+
<NumberPattern '\\xa4#,##0.00'>
|
| 744 |
+
>>> Locale('en', 'US').currency_formats['accounting']
|
| 745 |
+
<NumberPattern '\\xa4#,##0.00;(\\xa4#,##0.00)'>
|
| 746 |
+
"""
|
| 747 |
+
return self._data['currency_formats']
|
| 748 |
+
|
| 749 |
+
@property
|
| 750 |
+
def compact_currency_formats(self) -> localedata.LocaleDataDict:
|
| 751 |
+
"""Locale patterns for compact currency number formatting.
|
| 752 |
+
|
| 753 |
+
.. note:: The format of the value returned may change between
|
| 754 |
+
Babel versions.
|
| 755 |
+
|
| 756 |
+
>>> Locale('en', 'US').compact_currency_formats["short"]["one"]["1000"]
|
| 757 |
+
<NumberPattern '¤0K'>
|
| 758 |
+
"""
|
| 759 |
+
return self._data['compact_currency_formats']
|
| 760 |
+
|
| 761 |
+
@property
|
| 762 |
+
def percent_formats(self) -> localedata.LocaleDataDict:
|
| 763 |
+
"""Locale patterns for percent number formatting.
|
| 764 |
+
|
| 765 |
+
.. note:: The format of the value returned may change between
|
| 766 |
+
Babel versions.
|
| 767 |
+
|
| 768 |
+
>>> Locale('en', 'US').percent_formats[None]
|
| 769 |
+
<NumberPattern '#,##0%'>
|
| 770 |
+
"""
|
| 771 |
+
return self._data['percent_formats']
|
| 772 |
+
|
| 773 |
+
@property
|
| 774 |
+
def scientific_formats(self) -> localedata.LocaleDataDict:
|
| 775 |
+
"""Locale patterns for scientific number formatting.
|
| 776 |
+
|
| 777 |
+
.. note:: The format of the value returned may change between
|
| 778 |
+
Babel versions.
|
| 779 |
+
|
| 780 |
+
>>> Locale('en', 'US').scientific_formats[None]
|
| 781 |
+
<NumberPattern '#E0'>
|
| 782 |
+
"""
|
| 783 |
+
return self._data['scientific_formats']
|
| 784 |
+
|
| 785 |
+
# { Calendar Information and Date Formatting
|
| 786 |
+
|
| 787 |
+
@property
|
| 788 |
+
def periods(self) -> localedata.LocaleDataDict:
|
| 789 |
+
"""Locale display names for day periods (AM/PM).
|
| 790 |
+
|
| 791 |
+
>>> Locale('en', 'US').periods['am']
|
| 792 |
+
'AM'
|
| 793 |
+
"""
|
| 794 |
+
try:
|
| 795 |
+
return self._data['day_periods']['stand-alone']['wide']
|
| 796 |
+
except KeyError:
|
| 797 |
+
return localedata.LocaleDataDict({}) # pragma: no cover
|
| 798 |
+
|
| 799 |
+
@property
|
| 800 |
+
def day_periods(self) -> localedata.LocaleDataDict:
|
| 801 |
+
"""Locale display names for various day periods (not necessarily only AM/PM).
|
| 802 |
+
|
| 803 |
+
These are not meant to be used without the relevant `day_period_rules`.
|
| 804 |
+
"""
|
| 805 |
+
return self._data['day_periods']
|
| 806 |
+
|
| 807 |
+
@property
|
| 808 |
+
def day_period_rules(self) -> localedata.LocaleDataDict:
|
| 809 |
+
"""Day period rules for the locale. Used by `get_period_id`."""
|
| 810 |
+
return self._data.get('day_period_rules', localedata.LocaleDataDict({}))
|
| 811 |
+
|
| 812 |
+
@property
|
| 813 |
+
def days(self) -> localedata.LocaleDataDict:
|
| 814 |
+
"""Locale display names for weekdays.
|
| 815 |
+
|
| 816 |
+
>>> Locale('de', 'DE').days['format']['wide'][3]
|
| 817 |
+
'Donnerstag'
|
| 818 |
+
"""
|
| 819 |
+
return self._data['days']
|
| 820 |
+
|
| 821 |
+
@property
|
| 822 |
+
def months(self) -> localedata.LocaleDataDict:
|
| 823 |
+
"""Locale display names for months.
|
| 824 |
+
|
| 825 |
+
>>> Locale('de', 'DE').months['format']['wide'][10]
|
| 826 |
+
'Oktober'
|
| 827 |
+
"""
|
| 828 |
+
return self._data['months']
|
| 829 |
+
|
| 830 |
+
@property
|
| 831 |
+
def quarters(self) -> localedata.LocaleDataDict:
|
| 832 |
+
"""Locale display names for quarters.
|
| 833 |
+
|
| 834 |
+
>>> Locale('de', 'DE').quarters['format']['wide'][1]
|
| 835 |
+
'1. Quartal'
|
| 836 |
+
"""
|
| 837 |
+
return self._data['quarters']
|
| 838 |
+
|
| 839 |
+
@property
|
| 840 |
+
def eras(self) -> localedata.LocaleDataDict:
|
| 841 |
+
"""Locale display names for eras.
|
| 842 |
+
|
| 843 |
+
.. note:: The format of the value returned may change between
|
| 844 |
+
Babel versions.
|
| 845 |
+
|
| 846 |
+
>>> Locale('en', 'US').eras['wide'][1]
|
| 847 |
+
'Anno Domini'
|
| 848 |
+
>>> Locale('en', 'US').eras['abbreviated'][0]
|
| 849 |
+
'BC'
|
| 850 |
+
"""
|
| 851 |
+
return self._data['eras']
|
| 852 |
+
|
| 853 |
+
@property
|
| 854 |
+
def time_zones(self) -> localedata.LocaleDataDict:
|
| 855 |
+
"""Locale display names for time zones.
|
| 856 |
+
|
| 857 |
+
.. note:: The format of the value returned may change between
|
| 858 |
+
Babel versions.
|
| 859 |
+
|
| 860 |
+
>>> Locale('en', 'US').time_zones['Europe/London']['long']['daylight']
|
| 861 |
+
'British Summer Time'
|
| 862 |
+
>>> Locale('en', 'US').time_zones['America/St_Johns']['city']
|
| 863 |
+
'St. John’s'
|
| 864 |
+
"""
|
| 865 |
+
return self._data['time_zones']
|
| 866 |
+
|
| 867 |
+
@property
|
| 868 |
+
def meta_zones(self) -> localedata.LocaleDataDict:
|
| 869 |
+
"""Locale display names for meta time zones.
|
| 870 |
+
|
| 871 |
+
Meta time zones are basically groups of different Olson time zones that
|
| 872 |
+
have the same GMT offset and daylight savings time.
|
| 873 |
+
|
| 874 |
+
.. note:: The format of the value returned may change between
|
| 875 |
+
Babel versions.
|
| 876 |
+
|
| 877 |
+
>>> Locale('en', 'US').meta_zones['Europe_Central']['long']['daylight']
|
| 878 |
+
'Central European Summer Time'
|
| 879 |
+
|
| 880 |
+
.. versionadded:: 0.9
|
| 881 |
+
"""
|
| 882 |
+
return self._data['meta_zones']
|
| 883 |
+
|
| 884 |
+
@property
|
| 885 |
+
def zone_formats(self) -> localedata.LocaleDataDict:
|
| 886 |
+
"""Patterns related to the formatting of time zones.
|
| 887 |
+
|
| 888 |
+
.. note:: The format of the value returned may change between
|
| 889 |
+
Babel versions.
|
| 890 |
+
|
| 891 |
+
>>> Locale('en', 'US').zone_formats['fallback']
|
| 892 |
+
'%(1)s (%(0)s)'
|
| 893 |
+
>>> Locale('pt', 'BR').zone_formats['region']
|
| 894 |
+
'Horário %s'
|
| 895 |
+
|
| 896 |
+
.. versionadded:: 0.9
|
| 897 |
+
"""
|
| 898 |
+
return self._data['zone_formats']
|
| 899 |
+
|
| 900 |
+
@property
|
| 901 |
+
def first_week_day(self) -> int:
|
| 902 |
+
"""The first day of a week, with 0 being Monday.
|
| 903 |
+
|
| 904 |
+
>>> Locale('de', 'DE').first_week_day
|
| 905 |
+
0
|
| 906 |
+
>>> Locale('en', 'US').first_week_day
|
| 907 |
+
6
|
| 908 |
+
"""
|
| 909 |
+
return self._data['week_data']['first_day']
|
| 910 |
+
|
| 911 |
+
@property
|
| 912 |
+
def weekend_start(self) -> int:
|
| 913 |
+
"""The day the weekend starts, with 0 being Monday.
|
| 914 |
+
|
| 915 |
+
>>> Locale('de', 'DE').weekend_start
|
| 916 |
+
5
|
| 917 |
+
"""
|
| 918 |
+
return self._data['week_data']['weekend_start']
|
| 919 |
+
|
| 920 |
+
@property
|
| 921 |
+
def weekend_end(self) -> int:
|
| 922 |
+
"""The day the weekend ends, with 0 being Monday.
|
| 923 |
+
|
| 924 |
+
>>> Locale('de', 'DE').weekend_end
|
| 925 |
+
6
|
| 926 |
+
"""
|
| 927 |
+
return self._data['week_data']['weekend_end']
|
| 928 |
+
|
| 929 |
+
@property
|
| 930 |
+
def min_week_days(self) -> int:
|
| 931 |
+
"""The minimum number of days in a week so that the week is counted as
|
| 932 |
+
the first week of a year or month.
|
| 933 |
+
|
| 934 |
+
>>> Locale('de', 'DE').min_week_days
|
| 935 |
+
4
|
| 936 |
+
"""
|
| 937 |
+
return self._data['week_data']['min_days']
|
| 938 |
+
|
| 939 |
+
@property
|
| 940 |
+
def date_formats(self) -> localedata.LocaleDataDict:
|
| 941 |
+
"""Locale patterns for date formatting.
|
| 942 |
+
|
| 943 |
+
.. note:: The format of the value returned may change between
|
| 944 |
+
Babel versions.
|
| 945 |
+
|
| 946 |
+
>>> Locale('en', 'US').date_formats['short']
|
| 947 |
+
<DateTimePattern 'M/d/yy'>
|
| 948 |
+
>>> Locale('fr', 'FR').date_formats['long']
|
| 949 |
+
<DateTimePattern 'd MMMM y'>
|
| 950 |
+
"""
|
| 951 |
+
return self._data['date_formats']
|
| 952 |
+
|
| 953 |
+
@property
|
| 954 |
+
def time_formats(self) -> localedata.LocaleDataDict:
|
| 955 |
+
"""Locale patterns for time formatting.
|
| 956 |
+
|
| 957 |
+
.. note:: The format of the value returned may change between
|
| 958 |
+
Babel versions.
|
| 959 |
+
|
| 960 |
+
>>> Locale('en', 'US').time_formats['short']
|
| 961 |
+
<DateTimePattern 'h:mm\\u202fa'>
|
| 962 |
+
>>> Locale('fr', 'FR').time_formats['long']
|
| 963 |
+
<DateTimePattern 'HH:mm:ss z'>
|
| 964 |
+
"""
|
| 965 |
+
return self._data['time_formats']
|
| 966 |
+
|
| 967 |
+
@property
|
| 968 |
+
def datetime_formats(self) -> localedata.LocaleDataDict:
|
| 969 |
+
"""Locale patterns for datetime formatting.
|
| 970 |
+
|
| 971 |
+
.. note:: The format of the value returned may change between
|
| 972 |
+
Babel versions.
|
| 973 |
+
|
| 974 |
+
>>> Locale('en').datetime_formats['full']
|
| 975 |
+
'{1}, {0}'
|
| 976 |
+
>>> Locale('th').datetime_formats['medium']
|
| 977 |
+
'{1} {0}'
|
| 978 |
+
"""
|
| 979 |
+
return self._data['datetime_formats']
|
| 980 |
+
|
| 981 |
+
@property
|
| 982 |
+
def datetime_skeletons(self) -> localedata.LocaleDataDict:
|
| 983 |
+
"""Locale patterns for formatting parts of a datetime.
|
| 984 |
+
|
| 985 |
+
>>> Locale('en').datetime_skeletons['MEd']
|
| 986 |
+
<DateTimePattern 'E, M/d'>
|
| 987 |
+
>>> Locale('fr').datetime_skeletons['MEd']
|
| 988 |
+
<DateTimePattern 'E dd/MM'>
|
| 989 |
+
>>> Locale('fr').datetime_skeletons['H']
|
| 990 |
+
<DateTimePattern "HH 'h'">
|
| 991 |
+
"""
|
| 992 |
+
return self._data['datetime_skeletons']
|
| 993 |
+
|
| 994 |
+
@property
|
| 995 |
+
def interval_formats(self) -> localedata.LocaleDataDict:
|
| 996 |
+
"""Locale patterns for interval formatting.
|
| 997 |
+
|
| 998 |
+
.. note:: The format of the value returned may change between
|
| 999 |
+
Babel versions.
|
| 1000 |
+
|
| 1001 |
+
How to format date intervals in Finnish when the day is the
|
| 1002 |
+
smallest changing component:
|
| 1003 |
+
|
| 1004 |
+
>>> Locale('fi_FI').interval_formats['MEd']['d']
|
| 1005 |
+
['E d.\\u2009–\\u2009', 'E d.M.']
|
| 1006 |
+
|
| 1007 |
+
.. seealso::
|
| 1008 |
+
|
| 1009 |
+
The primary API to use this data is :py:func:`babel.dates.format_interval`.
|
| 1010 |
+
|
| 1011 |
+
|
| 1012 |
+
:rtype: dict[str, dict[str, list[str]]]
|
| 1013 |
+
"""
|
| 1014 |
+
return self._data['interval_formats']
|
| 1015 |
+
|
| 1016 |
+
@property
|
| 1017 |
+
def plural_form(self) -> PluralRule:
|
| 1018 |
+
"""Plural rules for the locale.
|
| 1019 |
+
|
| 1020 |
+
>>> Locale('en').plural_form(1)
|
| 1021 |
+
'one'
|
| 1022 |
+
>>> Locale('en').plural_form(0)
|
| 1023 |
+
'other'
|
| 1024 |
+
>>> Locale('fr').plural_form(0)
|
| 1025 |
+
'one'
|
| 1026 |
+
>>> Locale('ru').plural_form(100)
|
| 1027 |
+
'many'
|
| 1028 |
+
"""
|
| 1029 |
+
return self._data.get('plural_form', _default_plural_rule)
|
| 1030 |
+
|
| 1031 |
+
@property
|
| 1032 |
+
def list_patterns(self) -> localedata.LocaleDataDict:
|
| 1033 |
+
"""Patterns for generating lists
|
| 1034 |
+
|
| 1035 |
+
.. note:: The format of the value returned may change between
|
| 1036 |
+
Babel versions.
|
| 1037 |
+
|
| 1038 |
+
>>> Locale('en').list_patterns['standard']['start']
|
| 1039 |
+
'{0}, {1}'
|
| 1040 |
+
>>> Locale('en').list_patterns['standard']['end']
|
| 1041 |
+
'{0}, and {1}'
|
| 1042 |
+
>>> Locale('en_GB').list_patterns['standard']['end']
|
| 1043 |
+
'{0} and {1}'
|
| 1044 |
+
"""
|
| 1045 |
+
return self._data['list_patterns']
|
| 1046 |
+
|
| 1047 |
+
@property
|
| 1048 |
+
def ordinal_form(self) -> PluralRule:
|
| 1049 |
+
"""Plural rules for the locale.
|
| 1050 |
+
|
| 1051 |
+
>>> Locale('en').ordinal_form(1)
|
| 1052 |
+
'one'
|
| 1053 |
+
>>> Locale('en').ordinal_form(2)
|
| 1054 |
+
'two'
|
| 1055 |
+
>>> Locale('en').ordinal_form(3)
|
| 1056 |
+
'few'
|
| 1057 |
+
>>> Locale('fr').ordinal_form(2)
|
| 1058 |
+
'other'
|
| 1059 |
+
>>> Locale('ru').ordinal_form(100)
|
| 1060 |
+
'other'
|
| 1061 |
+
"""
|
| 1062 |
+
return self._data.get('ordinal_form', _default_plural_rule)
|
| 1063 |
+
|
| 1064 |
+
@property
|
| 1065 |
+
def measurement_systems(self) -> localedata.LocaleDataDict:
|
| 1066 |
+
"""Localized names for various measurement systems.
|
| 1067 |
+
|
| 1068 |
+
>>> Locale('fr', 'FR').measurement_systems['US']
|
| 1069 |
+
'américain'
|
| 1070 |
+
>>> Locale('en', 'US').measurement_systems['US']
|
| 1071 |
+
'US'
|
| 1072 |
+
|
| 1073 |
+
"""
|
| 1074 |
+
return self._data['measurement_systems']
|
| 1075 |
+
|
| 1076 |
+
@property
|
| 1077 |
+
def character_order(self) -> str:
|
| 1078 |
+
"""The text direction for the language.
|
| 1079 |
+
|
| 1080 |
+
>>> Locale('de', 'DE').character_order
|
| 1081 |
+
'left-to-right'
|
| 1082 |
+
>>> Locale('ar', 'SA').character_order
|
| 1083 |
+
'right-to-left'
|
| 1084 |
+
"""
|
| 1085 |
+
return self._data['character_order']
|
| 1086 |
+
|
| 1087 |
+
@property
|
| 1088 |
+
def text_direction(self) -> str:
|
| 1089 |
+
"""The text direction for the language in CSS short-hand form.
|
| 1090 |
+
|
| 1091 |
+
>>> Locale('de', 'DE').text_direction
|
| 1092 |
+
'ltr'
|
| 1093 |
+
>>> Locale('ar', 'SA').text_direction
|
| 1094 |
+
'rtl'
|
| 1095 |
+
"""
|
| 1096 |
+
return ''.join(word[0] for word in self.character_order.split('-'))
|
| 1097 |
+
|
| 1098 |
+
@property
|
| 1099 |
+
def unit_display_names(self) -> localedata.LocaleDataDict:
|
| 1100 |
+
"""Display names for units of measurement.
|
| 1101 |
+
|
| 1102 |
+
.. seealso::
|
| 1103 |
+
|
| 1104 |
+
You may want to use :py:func:`babel.units.get_unit_name` instead.
|
| 1105 |
+
|
| 1106 |
+
.. note:: The format of the value returned may change between
|
| 1107 |
+
Babel versions.
|
| 1108 |
+
|
| 1109 |
+
"""
|
| 1110 |
+
return self._data['unit_display_names']
|
| 1111 |
+
|
| 1112 |
+
|
| 1113 |
+
def default_locale(
|
| 1114 |
+
category: str | tuple[str, ...] | list[str] | None = None,
|
| 1115 |
+
aliases: Mapping[str, str] = LOCALE_ALIASES,
|
| 1116 |
+
) -> str | None:
|
| 1117 |
+
"""Returns the system default locale for a given category, based on
|
| 1118 |
+
environment variables.
|
| 1119 |
+
|
| 1120 |
+
>>> for name in ['LANGUAGE', 'LC_ALL', 'LC_CTYPE']:
|
| 1121 |
+
... os.environ[name] = ''
|
| 1122 |
+
>>> os.environ['LANG'] = 'fr_FR.UTF-8'
|
| 1123 |
+
>>> default_locale('LC_MESSAGES')
|
| 1124 |
+
'fr_FR'
|
| 1125 |
+
|
| 1126 |
+
The "C" or "POSIX" pseudo-locales are treated as aliases for the
|
| 1127 |
+
"en_US_POSIX" locale:
|
| 1128 |
+
|
| 1129 |
+
>>> os.environ['LC_MESSAGES'] = 'POSIX'
|
| 1130 |
+
>>> default_locale('LC_MESSAGES')
|
| 1131 |
+
'en_US_POSIX'
|
| 1132 |
+
|
| 1133 |
+
The following fallbacks to the variable are always considered:
|
| 1134 |
+
|
| 1135 |
+
- ``LANGUAGE``
|
| 1136 |
+
- ``LC_ALL``
|
| 1137 |
+
- ``LC_CTYPE``
|
| 1138 |
+
- ``LANG``
|
| 1139 |
+
|
| 1140 |
+
:param category: one or more of the ``LC_XXX`` environment variable names
|
| 1141 |
+
:param aliases: a dictionary of aliases for locale identifiers
|
| 1142 |
+
"""
|
| 1143 |
+
|
| 1144 |
+
varnames = ('LANGUAGE', 'LC_ALL', 'LC_CTYPE', 'LANG')
|
| 1145 |
+
if category:
|
| 1146 |
+
if isinstance(category, str):
|
| 1147 |
+
varnames = (category, *varnames)
|
| 1148 |
+
elif isinstance(category, (list, tuple)):
|
| 1149 |
+
varnames = (*category, *varnames)
|
| 1150 |
+
else:
|
| 1151 |
+
raise TypeError(f"Invalid type for category: {category!r}")
|
| 1152 |
+
|
| 1153 |
+
for name in varnames:
|
| 1154 |
+
if not name:
|
| 1155 |
+
continue
|
| 1156 |
+
locale = os.getenv(name)
|
| 1157 |
+
if locale:
|
| 1158 |
+
if name == 'LANGUAGE' and ':' in locale:
|
| 1159 |
+
# the LANGUAGE variable may contain a colon-separated list of
|
| 1160 |
+
# language codes; we just pick the language on the list
|
| 1161 |
+
locale = locale.split(':')[0]
|
| 1162 |
+
if locale.split('.')[0] in ('C', 'POSIX'):
|
| 1163 |
+
locale = 'en_US_POSIX'
|
| 1164 |
+
elif aliases and locale in aliases:
|
| 1165 |
+
locale = aliases[locale]
|
| 1166 |
+
try:
|
| 1167 |
+
return get_locale_identifier(parse_locale(locale))
|
| 1168 |
+
except ValueError:
|
| 1169 |
+
pass
|
| 1170 |
+
return None
|
| 1171 |
+
|
| 1172 |
+
|
| 1173 |
+
def negotiate_locale(
|
| 1174 |
+
preferred: Iterable[str],
|
| 1175 |
+
available: Iterable[str],
|
| 1176 |
+
sep: str = '_',
|
| 1177 |
+
aliases: Mapping[str, str] = LOCALE_ALIASES,
|
| 1178 |
+
) -> str | None:
|
| 1179 |
+
"""Find the best match between available and requested locale strings.
|
| 1180 |
+
|
| 1181 |
+
>>> negotiate_locale(['de_DE', 'en_US'], ['de_DE', 'de_AT'])
|
| 1182 |
+
'de_DE'
|
| 1183 |
+
>>> negotiate_locale(['de_DE', 'en_US'], ['en', 'de'])
|
| 1184 |
+
'de'
|
| 1185 |
+
|
| 1186 |
+
Case is ignored by the algorithm, the result uses the case of the preferred
|
| 1187 |
+
locale identifier:
|
| 1188 |
+
|
| 1189 |
+
>>> negotiate_locale(['de_DE', 'en_US'], ['de_de', 'de_at'])
|
| 1190 |
+
'de_DE'
|
| 1191 |
+
|
| 1192 |
+
>>> negotiate_locale(['de_DE', 'en_US'], ['de_de', 'de_at'])
|
| 1193 |
+
'de_DE'
|
| 1194 |
+
|
| 1195 |
+
By default, some web browsers unfortunately do not include the territory
|
| 1196 |
+
in the locale identifier for many locales, and some don't even allow the
|
| 1197 |
+
user to easily add the territory. So while you may prefer using qualified
|
| 1198 |
+
locale identifiers in your web-application, they would not normally match
|
| 1199 |
+
the language-only locale sent by such browsers. To workaround that, this
|
| 1200 |
+
function uses a default mapping of commonly used language-only locale
|
| 1201 |
+
identifiers to identifiers including the territory:
|
| 1202 |
+
|
| 1203 |
+
>>> negotiate_locale(['ja', 'en_US'], ['ja_JP', 'en_US'])
|
| 1204 |
+
'ja_JP'
|
| 1205 |
+
|
| 1206 |
+
Some browsers even use an incorrect or outdated language code, such as "no"
|
| 1207 |
+
for Norwegian, where the correct locale identifier would actually be "nb_NO"
|
| 1208 |
+
(Bokmål) or "nn_NO" (Nynorsk). The aliases are intended to take care of
|
| 1209 |
+
such cases, too:
|
| 1210 |
+
|
| 1211 |
+
>>> negotiate_locale(['no', 'sv'], ['nb_NO', 'sv_SE'])
|
| 1212 |
+
'nb_NO'
|
| 1213 |
+
|
| 1214 |
+
You can override this default mapping by passing a different `aliases`
|
| 1215 |
+
dictionary to this function, or you can bypass the behavior althogher by
|
| 1216 |
+
setting the `aliases` parameter to `None`.
|
| 1217 |
+
|
| 1218 |
+
:param preferred: the list of locale strings preferred by the user
|
| 1219 |
+
:param available: the list of locale strings available
|
| 1220 |
+
:param sep: character that separates the different parts of the locale
|
| 1221 |
+
strings
|
| 1222 |
+
:param aliases: a dictionary of aliases for locale identifiers
|
| 1223 |
+
"""
|
| 1224 |
+
available = [a.lower() for a in available if a]
|
| 1225 |
+
for locale in preferred:
|
| 1226 |
+
ll = locale.lower()
|
| 1227 |
+
if ll in available:
|
| 1228 |
+
return locale
|
| 1229 |
+
if aliases:
|
| 1230 |
+
alias = aliases.get(ll)
|
| 1231 |
+
if alias:
|
| 1232 |
+
alias = alias.replace('_', sep)
|
| 1233 |
+
if alias.lower() in available:
|
| 1234 |
+
return alias
|
| 1235 |
+
parts = locale.split(sep)
|
| 1236 |
+
if len(parts) > 1 and parts[0].lower() in available:
|
| 1237 |
+
return parts[0]
|
| 1238 |
+
return None
|
| 1239 |
+
|
| 1240 |
+
|
| 1241 |
+
def parse_locale(
|
| 1242 |
+
identifier: str,
|
| 1243 |
+
sep: str = '_',
|
| 1244 |
+
) -> (
|
| 1245 |
+
tuple[str, str | None, str | None, str | None]
|
| 1246 |
+
| tuple[str, str | None, str | None, str | None, str | None]
|
| 1247 |
+
):
|
| 1248 |
+
"""Parse a locale identifier into a tuple of the form ``(language,
|
| 1249 |
+
territory, script, variant, modifier)``.
|
| 1250 |
+
|
| 1251 |
+
>>> parse_locale('zh_CN')
|
| 1252 |
+
('zh', 'CN', None, None)
|
| 1253 |
+
>>> parse_locale('zh_Hans_CN')
|
| 1254 |
+
('zh', 'CN', 'Hans', None)
|
| 1255 |
+
>>> parse_locale('ca_es_valencia')
|
| 1256 |
+
('ca', 'ES', None, 'VALENCIA')
|
| 1257 |
+
>>> parse_locale('en_150')
|
| 1258 |
+
('en', '150', None, None)
|
| 1259 |
+
>>> parse_locale('en_us_posix')
|
| 1260 |
+
('en', 'US', None, 'POSIX')
|
| 1261 |
+
>>> parse_locale('it_IT@euro')
|
| 1262 |
+
('it', 'IT', None, None, 'euro')
|
| 1263 |
+
>>> parse_locale('it_IT@custom')
|
| 1264 |
+
('it', 'IT', None, None, 'custom')
|
| 1265 |
+
>>> parse_locale('it_IT@')
|
| 1266 |
+
('it', 'IT', None, None)
|
| 1267 |
+
|
| 1268 |
+
The default component separator is "_", but a different separator can be
|
| 1269 |
+
specified using the `sep` parameter.
|
| 1270 |
+
|
| 1271 |
+
The optional modifier is always separated with "@" and at the end:
|
| 1272 |
+
|
| 1273 |
+
>>> parse_locale('zh-CN', sep='-')
|
| 1274 |
+
('zh', 'CN', None, None)
|
| 1275 |
+
>>> parse_locale('zh-CN@custom', sep='-')
|
| 1276 |
+
('zh', 'CN', None, None, 'custom')
|
| 1277 |
+
|
| 1278 |
+
If the identifier cannot be parsed into a locale, a `ValueError` exception
|
| 1279 |
+
is raised:
|
| 1280 |
+
|
| 1281 |
+
>>> parse_locale('not_a_LOCALE_String')
|
| 1282 |
+
Traceback (most recent call last):
|
| 1283 |
+
...
|
| 1284 |
+
ValueError: 'not_a_LOCALE_String' is not a valid locale identifier
|
| 1285 |
+
|
| 1286 |
+
Encoding information is removed from the identifier, while modifiers are
|
| 1287 |
+
kept:
|
| 1288 |
+
|
| 1289 |
+
>>> parse_locale('en_US.UTF-8')
|
| 1290 |
+
('en', 'US', None, None)
|
| 1291 |
+
>>> parse_locale('de_DE.iso885915@euro')
|
| 1292 |
+
('de', 'DE', None, None, 'euro')
|
| 1293 |
+
|
| 1294 |
+
See :rfc:`4646` for more information.
|
| 1295 |
+
|
| 1296 |
+
:param identifier: the locale identifier string
|
| 1297 |
+
:param sep: character that separates the different components of the locale
|
| 1298 |
+
identifier
|
| 1299 |
+
:raise `ValueError`: if the string does not appear to be a valid locale
|
| 1300 |
+
identifier
|
| 1301 |
+
"""
|
| 1302 |
+
if not identifier:
|
| 1303 |
+
raise ValueError("empty locale identifier")
|
| 1304 |
+
identifier, _, modifier = identifier.partition('@')
|
| 1305 |
+
if '.' in identifier:
|
| 1306 |
+
# this is probably the charset/encoding, which we don't care about
|
| 1307 |
+
identifier = identifier.split('.', 1)[0]
|
| 1308 |
+
|
| 1309 |
+
parts = identifier.split(sep)
|
| 1310 |
+
lang = parts.pop(0).lower()
|
| 1311 |
+
if not lang.isalpha():
|
| 1312 |
+
raise ValueError(f"expected only letters, got {lang!r}")
|
| 1313 |
+
|
| 1314 |
+
script = territory = variant = None
|
| 1315 |
+
if parts and len(parts[0]) == 4 and parts[0].isalpha():
|
| 1316 |
+
script = parts.pop(0).title()
|
| 1317 |
+
|
| 1318 |
+
if parts:
|
| 1319 |
+
if len(parts[0]) == 2 and parts[0].isalpha():
|
| 1320 |
+
territory = parts.pop(0).upper()
|
| 1321 |
+
elif len(parts[0]) == 3 and parts[0].isdigit():
|
| 1322 |
+
territory = parts.pop(0)
|
| 1323 |
+
|
| 1324 |
+
if parts and (
|
| 1325 |
+
len(parts[0]) == 4
|
| 1326 |
+
and parts[0][0].isdigit()
|
| 1327 |
+
or len(parts[0]) >= 5
|
| 1328 |
+
and parts[0][0].isalpha()
|
| 1329 |
+
):
|
| 1330 |
+
variant = parts.pop().upper()
|
| 1331 |
+
|
| 1332 |
+
if parts:
|
| 1333 |
+
raise ValueError(f"{identifier!r} is not a valid locale identifier")
|
| 1334 |
+
|
| 1335 |
+
# TODO(3.0): always return a 5-tuple
|
| 1336 |
+
if modifier:
|
| 1337 |
+
return lang, territory, script, variant, modifier
|
| 1338 |
+
else:
|
| 1339 |
+
return lang, territory, script, variant
|
| 1340 |
+
|
| 1341 |
+
|
| 1342 |
+
def get_locale_identifier(
|
| 1343 |
+
tup: tuple[str]
|
| 1344 |
+
| tuple[str, str | None]
|
| 1345 |
+
| tuple[str, str | None, str | None]
|
| 1346 |
+
| tuple[str, str | None, str | None, str | None]
|
| 1347 |
+
| tuple[str, str | None, str | None, str | None, str | None],
|
| 1348 |
+
sep: str = "_",
|
| 1349 |
+
) -> str:
|
| 1350 |
+
"""The reverse of :func:`parse_locale`. It creates a locale identifier out
|
| 1351 |
+
of a ``(language, territory, script, variant, modifier)`` tuple. Items can be set to
|
| 1352 |
+
``None`` and trailing ``None``\\s can also be left out of the tuple.
|
| 1353 |
+
|
| 1354 |
+
>>> get_locale_identifier(('de', 'DE', None, '1999', 'custom'))
|
| 1355 |
+
'de_DE_1999@custom'
|
| 1356 |
+
>>> get_locale_identifier(('fi', None, None, None, 'custom'))
|
| 1357 |
+
'fi@custom'
|
| 1358 |
+
|
| 1359 |
+
|
| 1360 |
+
.. versionadded:: 1.0
|
| 1361 |
+
|
| 1362 |
+
:param tup: the tuple as returned by :func:`parse_locale`.
|
| 1363 |
+
:param sep: the separator for the identifier.
|
| 1364 |
+
"""
|
| 1365 |
+
tup = tuple(tup[:5]) # type: ignore # length should be no more than 5
|
| 1366 |
+
lang, territory, script, variant, modifier = tup + (None,) * (5 - len(tup))
|
| 1367 |
+
ret = sep.join(filter(None, (lang, script, territory, variant)))
|
| 1368 |
+
return f'{ret}@{modifier}' if modifier else ret
|
| 1369 |
+
|
| 1370 |
+
|
| 1371 |
+
def get_cldr_version() -> str:
|
| 1372 |
+
"""Return the Unicode CLDR version used by this Babel installation.
|
| 1373 |
+
|
| 1374 |
+
Generally, you should be able to assume that the return value of this
|
| 1375 |
+
function is a string representing a version number, e.g. '47'.
|
| 1376 |
+
|
| 1377 |
+
>>> get_cldr_version()
|
| 1378 |
+
'47'
|
| 1379 |
+
|
| 1380 |
+
.. versionadded:: 2.18
|
| 1381 |
+
|
| 1382 |
+
:rtype: str
|
| 1383 |
+
"""
|
| 1384 |
+
return str(get_global("cldr")["version"])
|
micromamba_root/Lib/site-packages/babel/dates.py
ADDED
|
@@ -0,0 +1,2040 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
babel.dates
|
| 3 |
+
~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Locale dependent formatting and parsing of dates and times.
|
| 6 |
+
|
| 7 |
+
The default locale for the functions in this module is determined by the
|
| 8 |
+
following environment variables, in that order:
|
| 9 |
+
|
| 10 |
+
* ``LC_TIME``,
|
| 11 |
+
* ``LC_ALL``, and
|
| 12 |
+
* ``LANG``
|
| 13 |
+
|
| 14 |
+
:copyright: (c) 2013-2026 by the Babel Team.
|
| 15 |
+
:license: BSD, see LICENSE for more details.
|
| 16 |
+
"""
|
| 17 |
+
|
| 18 |
+
from __future__ import annotations
|
| 19 |
+
|
| 20 |
+
import math
|
| 21 |
+
import re
|
| 22 |
+
import warnings
|
| 23 |
+
from functools import lru_cache
|
| 24 |
+
from typing import TYPE_CHECKING, Literal, SupportsInt
|
| 25 |
+
|
| 26 |
+
try:
|
| 27 |
+
import pytz
|
| 28 |
+
except ModuleNotFoundError:
|
| 29 |
+
pytz = None
|
| 30 |
+
import zoneinfo
|
| 31 |
+
|
| 32 |
+
import datetime
|
| 33 |
+
from collections.abc import Iterable
|
| 34 |
+
|
| 35 |
+
from babel import localtime
|
| 36 |
+
from babel.core import Locale, default_locale, get_global
|
| 37 |
+
from babel.localedata import LocaleDataDict
|
| 38 |
+
|
| 39 |
+
if TYPE_CHECKING:
|
| 40 |
+
from typing_extensions import TypeAlias
|
| 41 |
+
|
| 42 |
+
_Instant: TypeAlias = datetime.date | datetime.time | float | None
|
| 43 |
+
_PredefinedTimeFormat: TypeAlias = Literal['full', 'long', 'medium', 'short']
|
| 44 |
+
_Context: TypeAlias = Literal['format', 'stand-alone']
|
| 45 |
+
_DtOrTzinfo: TypeAlias = datetime.datetime | datetime.tzinfo | str | int | datetime.time | None # fmt: skip
|
| 46 |
+
|
| 47 |
+
# "If a given short metazone form is known NOT to be understood in a given
|
| 48 |
+
# locale and the parent locale has this value such that it would normally
|
| 49 |
+
# be inherited, the inheritance of this value can be explicitly disabled by
|
| 50 |
+
# use of the 'no inheritance marker' as the value, which is 3 simultaneous [sic]
|
| 51 |
+
# empty set characters ( U+2205 )."
|
| 52 |
+
# - https://www.unicode.org/reports/tr35/tr35-dates.html#Metazone_Names
|
| 53 |
+
|
| 54 |
+
NO_INHERITANCE_MARKER = '\u2205\u2205\u2205'
|
| 55 |
+
|
| 56 |
+
UTC = datetime.timezone.utc
|
| 57 |
+
LOCALTZ = localtime.LOCALTZ
|
| 58 |
+
|
| 59 |
+
LC_TIME = default_locale('LC_TIME')
|
| 60 |
+
|
| 61 |
+
|
| 62 |
+
def _localize(tz: datetime.tzinfo, dt: datetime.datetime) -> datetime.datetime:
|
| 63 |
+
# Support localizing with both pytz and zoneinfo tzinfos
|
| 64 |
+
# nothing to do
|
| 65 |
+
if dt.tzinfo is tz:
|
| 66 |
+
return dt
|
| 67 |
+
|
| 68 |
+
if hasattr(tz, 'localize'): # pytz
|
| 69 |
+
return tz.localize(dt)
|
| 70 |
+
|
| 71 |
+
if dt.tzinfo is None:
|
| 72 |
+
# convert naive to localized
|
| 73 |
+
return dt.replace(tzinfo=tz)
|
| 74 |
+
|
| 75 |
+
# convert timezones
|
| 76 |
+
return dt.astimezone(tz)
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
def _get_dt_and_tzinfo(
|
| 80 |
+
dt_or_tzinfo: _DtOrTzinfo,
|
| 81 |
+
) -> tuple[datetime.datetime | None, datetime.tzinfo]:
|
| 82 |
+
"""
|
| 83 |
+
Parse a `dt_or_tzinfo` value into a datetime and a tzinfo.
|
| 84 |
+
|
| 85 |
+
See the docs for this function's callers for semantics.
|
| 86 |
+
|
| 87 |
+
:rtype: tuple[datetime, tzinfo]
|
| 88 |
+
"""
|
| 89 |
+
if dt_or_tzinfo is None:
|
| 90 |
+
dt = datetime.datetime.now()
|
| 91 |
+
tzinfo = LOCALTZ
|
| 92 |
+
elif isinstance(dt_or_tzinfo, str):
|
| 93 |
+
dt = None
|
| 94 |
+
tzinfo = get_timezone(dt_or_tzinfo)
|
| 95 |
+
elif isinstance(dt_or_tzinfo, int):
|
| 96 |
+
dt = None
|
| 97 |
+
tzinfo = UTC
|
| 98 |
+
elif isinstance(dt_or_tzinfo, (datetime.datetime, datetime.time)):
|
| 99 |
+
dt = _get_datetime(dt_or_tzinfo)
|
| 100 |
+
tzinfo = dt.tzinfo if dt.tzinfo is not None else UTC
|
| 101 |
+
else:
|
| 102 |
+
dt = None
|
| 103 |
+
tzinfo = dt_or_tzinfo
|
| 104 |
+
return dt, tzinfo
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
def _get_tz_name(dt_or_tzinfo: _DtOrTzinfo) -> str:
|
| 108 |
+
"""
|
| 109 |
+
Get the timezone name out of a time, datetime, or tzinfo object.
|
| 110 |
+
|
| 111 |
+
:rtype: str
|
| 112 |
+
"""
|
| 113 |
+
dt, tzinfo = _get_dt_and_tzinfo(dt_or_tzinfo)
|
| 114 |
+
if hasattr(tzinfo, 'zone'): # pytz object
|
| 115 |
+
return tzinfo.zone
|
| 116 |
+
elif hasattr(tzinfo, 'key') and tzinfo.key is not None: # ZoneInfo object
|
| 117 |
+
return tzinfo.key
|
| 118 |
+
else:
|
| 119 |
+
return tzinfo.tzname(dt or datetime.datetime.now(UTC))
|
| 120 |
+
|
| 121 |
+
|
| 122 |
+
def _get_datetime(instant: _Instant) -> datetime.datetime:
|
| 123 |
+
"""
|
| 124 |
+
Get a datetime out of an "instant" (date, time, datetime, number).
|
| 125 |
+
|
| 126 |
+
.. warning:: The return values of this function may depend on the system clock.
|
| 127 |
+
|
| 128 |
+
If the instant is None, the current moment is used.
|
| 129 |
+
If the instant is a time, it's augmented with today's date.
|
| 130 |
+
|
| 131 |
+
Dates are converted to naive datetimes with midnight as the time component.
|
| 132 |
+
|
| 133 |
+
>>> from datetime import date, datetime
|
| 134 |
+
>>> _get_datetime(date(2015, 1, 1))
|
| 135 |
+
datetime.datetime(2015, 1, 1, 0, 0)
|
| 136 |
+
|
| 137 |
+
UNIX timestamps are converted to datetimes.
|
| 138 |
+
|
| 139 |
+
>>> _get_datetime(1400000000)
|
| 140 |
+
datetime.datetime(2014, 5, 13, 16, 53, 20)
|
| 141 |
+
|
| 142 |
+
Other values are passed through as-is.
|
| 143 |
+
|
| 144 |
+
>>> x = datetime(2015, 1, 1)
|
| 145 |
+
>>> _get_datetime(x) is x
|
| 146 |
+
True
|
| 147 |
+
|
| 148 |
+
:param instant: date, time, datetime, integer, float or None
|
| 149 |
+
:type instant: date|time|datetime|int|float|None
|
| 150 |
+
:return: a datetime
|
| 151 |
+
:rtype: datetime
|
| 152 |
+
"""
|
| 153 |
+
if instant is None:
|
| 154 |
+
return datetime.datetime.now(UTC).replace(tzinfo=None)
|
| 155 |
+
elif isinstance(instant, (int, float)):
|
| 156 |
+
return datetime.datetime.fromtimestamp(instant, UTC).replace(tzinfo=None)
|
| 157 |
+
elif isinstance(instant, datetime.time):
|
| 158 |
+
return datetime.datetime.combine(datetime.date.today(), instant)
|
| 159 |
+
elif isinstance(instant, datetime.date) and not isinstance(instant, datetime.datetime): # fmt: skip
|
| 160 |
+
return datetime.datetime.combine(instant, datetime.time())
|
| 161 |
+
# TODO (3.x): Add an assertion/type check for this fallthrough branch:
|
| 162 |
+
return instant
|
| 163 |
+
|
| 164 |
+
|
| 165 |
+
def _ensure_datetime_tzinfo(
|
| 166 |
+
dt: datetime.datetime,
|
| 167 |
+
tzinfo: datetime.tzinfo | None = None,
|
| 168 |
+
) -> datetime.datetime:
|
| 169 |
+
"""
|
| 170 |
+
Ensure the datetime passed has an attached tzinfo.
|
| 171 |
+
|
| 172 |
+
If the datetime is tz-naive to begin with, UTC is attached.
|
| 173 |
+
|
| 174 |
+
If a tzinfo is passed in, the datetime is normalized to that timezone.
|
| 175 |
+
|
| 176 |
+
>>> from datetime import datetime
|
| 177 |
+
>>> _get_tz_name(_ensure_datetime_tzinfo(datetime(2015, 1, 1)))
|
| 178 |
+
'UTC'
|
| 179 |
+
|
| 180 |
+
>>> tz = get_timezone("Europe/Stockholm")
|
| 181 |
+
>>> _ensure_datetime_tzinfo(datetime(2015, 1, 1, 13, 15, tzinfo=UTC), tzinfo=tz).hour
|
| 182 |
+
14
|
| 183 |
+
|
| 184 |
+
:param datetime: Datetime to augment.
|
| 185 |
+
:param tzinfo: optional tzinfo
|
| 186 |
+
:return: datetime with tzinfo
|
| 187 |
+
:rtype: datetime
|
| 188 |
+
"""
|
| 189 |
+
if dt.tzinfo is None:
|
| 190 |
+
dt = dt.replace(tzinfo=UTC)
|
| 191 |
+
if tzinfo is not None:
|
| 192 |
+
dt = dt.astimezone(get_timezone(tzinfo))
|
| 193 |
+
if hasattr(tzinfo, 'normalize'): # pytz
|
| 194 |
+
dt = tzinfo.normalize(dt)
|
| 195 |
+
return dt
|
| 196 |
+
|
| 197 |
+
|
| 198 |
+
def _get_time(
|
| 199 |
+
time: datetime.time | datetime.datetime | None,
|
| 200 |
+
tzinfo: datetime.tzinfo | None = None,
|
| 201 |
+
) -> datetime.time:
|
| 202 |
+
"""
|
| 203 |
+
Get a timezoned time from a given instant.
|
| 204 |
+
|
| 205 |
+
.. warning:: The return values of this function may depend on the system clock.
|
| 206 |
+
|
| 207 |
+
:param time: time, datetime or None
|
| 208 |
+
:rtype: time
|
| 209 |
+
"""
|
| 210 |
+
if time is None:
|
| 211 |
+
time = datetime.datetime.now(UTC)
|
| 212 |
+
elif isinstance(time, (int, float)):
|
| 213 |
+
time = datetime.datetime.fromtimestamp(time, UTC)
|
| 214 |
+
|
| 215 |
+
if time.tzinfo is None:
|
| 216 |
+
time = time.replace(tzinfo=UTC)
|
| 217 |
+
|
| 218 |
+
if isinstance(time, datetime.datetime):
|
| 219 |
+
if tzinfo is not None:
|
| 220 |
+
time = time.astimezone(tzinfo)
|
| 221 |
+
if hasattr(tzinfo, 'normalize'): # pytz
|
| 222 |
+
time = tzinfo.normalize(time)
|
| 223 |
+
time = time.timetz()
|
| 224 |
+
elif tzinfo is not None:
|
| 225 |
+
time = time.replace(tzinfo=tzinfo)
|
| 226 |
+
return time
|
| 227 |
+
|
| 228 |
+
|
| 229 |
+
def get_timezone(zone: str | datetime.tzinfo | None = None) -> datetime.tzinfo:
|
| 230 |
+
"""Looks up a timezone by name and returns it. The timezone object
|
| 231 |
+
returned comes from ``pytz`` or ``zoneinfo``, whichever is available.
|
| 232 |
+
It corresponds to the `tzinfo` interface and can be used with all of
|
| 233 |
+
the functions of Babel that operate with dates.
|
| 234 |
+
|
| 235 |
+
If a timezone is not known a :exc:`LookupError` is raised. If `zone`
|
| 236 |
+
is ``None`` a local zone object is returned.
|
| 237 |
+
|
| 238 |
+
:param zone: the name of the timezone to look up. If a timezone object
|
| 239 |
+
itself is passed in, it's returned unchanged.
|
| 240 |
+
"""
|
| 241 |
+
if zone is None:
|
| 242 |
+
return LOCALTZ
|
| 243 |
+
if not isinstance(zone, str):
|
| 244 |
+
return zone
|
| 245 |
+
|
| 246 |
+
if pytz:
|
| 247 |
+
try:
|
| 248 |
+
return pytz.timezone(zone)
|
| 249 |
+
except pytz.UnknownTimeZoneError as e:
|
| 250 |
+
exc = e
|
| 251 |
+
else:
|
| 252 |
+
assert zoneinfo
|
| 253 |
+
try:
|
| 254 |
+
return zoneinfo.ZoneInfo(zone)
|
| 255 |
+
except zoneinfo.ZoneInfoNotFoundError as e:
|
| 256 |
+
exc = e
|
| 257 |
+
|
| 258 |
+
raise LookupError(f"Unknown timezone {zone}") from exc
|
| 259 |
+
|
| 260 |
+
|
| 261 |
+
def get_period_names(
|
| 262 |
+
width: Literal['abbreviated', 'narrow', 'wide'] = 'wide',
|
| 263 |
+
context: _Context = 'stand-alone',
|
| 264 |
+
locale: Locale | str | None = None,
|
| 265 |
+
) -> LocaleDataDict:
|
| 266 |
+
"""Return the names for day periods (AM/PM) used by the locale.
|
| 267 |
+
|
| 268 |
+
>>> get_period_names(locale='en_US')['am']
|
| 269 |
+
'AM'
|
| 270 |
+
|
| 271 |
+
:param width: the width to use, one of "abbreviated", "narrow", or "wide"
|
| 272 |
+
:param context: the context, either "format" or "stand-alone"
|
| 273 |
+
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
|
| 274 |
+
"""
|
| 275 |
+
return Locale.parse(locale or LC_TIME).day_periods[context][width]
|
| 276 |
+
|
| 277 |
+
|
| 278 |
+
def get_day_names(
|
| 279 |
+
width: Literal['abbreviated', 'narrow', 'short', 'wide'] = 'wide',
|
| 280 |
+
context: _Context = 'format',
|
| 281 |
+
locale: Locale | str | None = None,
|
| 282 |
+
) -> LocaleDataDict:
|
| 283 |
+
"""Return the day names used by the locale for the specified format.
|
| 284 |
+
|
| 285 |
+
>>> get_day_names('wide', locale='en_US')[1]
|
| 286 |
+
'Tuesday'
|
| 287 |
+
>>> get_day_names('short', locale='en_US')[1]
|
| 288 |
+
'Tu'
|
| 289 |
+
>>> get_day_names('abbreviated', locale='es')[1]
|
| 290 |
+
'mar'
|
| 291 |
+
>>> get_day_names('narrow', context='stand-alone', locale='de_DE')[1]
|
| 292 |
+
'D'
|
| 293 |
+
|
| 294 |
+
:param width: the width to use, one of "wide", "abbreviated", "short" or "narrow"
|
| 295 |
+
:param context: the context, either "format" or "stand-alone"
|
| 296 |
+
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
|
| 297 |
+
"""
|
| 298 |
+
return Locale.parse(locale or LC_TIME).days[context][width]
|
| 299 |
+
|
| 300 |
+
|
| 301 |
+
def get_month_names(
|
| 302 |
+
width: Literal['abbreviated', 'narrow', 'wide'] = 'wide',
|
| 303 |
+
context: _Context = 'format',
|
| 304 |
+
locale: Locale | str | None = None,
|
| 305 |
+
) -> LocaleDataDict:
|
| 306 |
+
"""Return the month names used by the locale for the specified format.
|
| 307 |
+
|
| 308 |
+
>>> get_month_names('wide', locale='en_US')[1]
|
| 309 |
+
'January'
|
| 310 |
+
>>> get_month_names('abbreviated', locale='es')[1]
|
| 311 |
+
'ene'
|
| 312 |
+
>>> get_month_names('narrow', context='stand-alone', locale='de_DE')[1]
|
| 313 |
+
'J'
|
| 314 |
+
|
| 315 |
+
:param width: the width to use, one of "wide", "abbreviated", or "narrow"
|
| 316 |
+
:param context: the context, either "format" or "stand-alone"
|
| 317 |
+
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
|
| 318 |
+
"""
|
| 319 |
+
return Locale.parse(locale or LC_TIME).months[context][width]
|
| 320 |
+
|
| 321 |
+
|
| 322 |
+
def get_quarter_names(
|
| 323 |
+
width: Literal['abbreviated', 'narrow', 'wide'] = 'wide',
|
| 324 |
+
context: _Context = 'format',
|
| 325 |
+
locale: Locale | str | None = None,
|
| 326 |
+
) -> LocaleDataDict:
|
| 327 |
+
"""Return the quarter names used by the locale for the specified format.
|
| 328 |
+
|
| 329 |
+
>>> get_quarter_names('wide', locale='en_US')[1]
|
| 330 |
+
'1st quarter'
|
| 331 |
+
>>> get_quarter_names('abbreviated', locale='de_DE')[1]
|
| 332 |
+
'Q1'
|
| 333 |
+
>>> get_quarter_names('narrow', locale='de_DE')[1]
|
| 334 |
+
'1'
|
| 335 |
+
|
| 336 |
+
:param width: the width to use, one of "wide", "abbreviated", or "narrow"
|
| 337 |
+
:param context: the context, either "format" or "stand-alone"
|
| 338 |
+
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
|
| 339 |
+
"""
|
| 340 |
+
return Locale.parse(locale or LC_TIME).quarters[context][width]
|
| 341 |
+
|
| 342 |
+
|
| 343 |
+
def get_era_names(
|
| 344 |
+
width: Literal['abbreviated', 'narrow', 'wide'] = 'wide',
|
| 345 |
+
locale: Locale | str | None = None,
|
| 346 |
+
) -> LocaleDataDict:
|
| 347 |
+
"""Return the era names used by the locale for the specified format.
|
| 348 |
+
|
| 349 |
+
>>> get_era_names('wide', locale='en_US')[1]
|
| 350 |
+
'Anno Domini'
|
| 351 |
+
>>> get_era_names('abbreviated', locale='de_DE')[1]
|
| 352 |
+
'n. Chr.'
|
| 353 |
+
|
| 354 |
+
:param width: the width to use, either "wide", "abbreviated", or "narrow"
|
| 355 |
+
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
|
| 356 |
+
"""
|
| 357 |
+
return Locale.parse(locale or LC_TIME).eras[width]
|
| 358 |
+
|
| 359 |
+
|
| 360 |
+
def get_date_format(
|
| 361 |
+
format: _PredefinedTimeFormat = 'medium',
|
| 362 |
+
locale: Locale | str | None = None,
|
| 363 |
+
) -> DateTimePattern:
|
| 364 |
+
"""Return the date formatting patterns used by the locale for the specified
|
| 365 |
+
format.
|
| 366 |
+
|
| 367 |
+
>>> get_date_format(locale='en_US')
|
| 368 |
+
<DateTimePattern 'MMM d, y'>
|
| 369 |
+
>>> get_date_format('full', locale='de_DE')
|
| 370 |
+
<DateTimePattern 'EEEE, d. MMMM y'>
|
| 371 |
+
|
| 372 |
+
:param format: the format to use, one of "full", "long", "medium", or
|
| 373 |
+
"short"
|
| 374 |
+
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
|
| 375 |
+
"""
|
| 376 |
+
return Locale.parse(locale or LC_TIME).date_formats[format]
|
| 377 |
+
|
| 378 |
+
|
| 379 |
+
def get_datetime_format(
|
| 380 |
+
format: _PredefinedTimeFormat = 'medium',
|
| 381 |
+
locale: Locale | str | None = None,
|
| 382 |
+
) -> DateTimePattern:
|
| 383 |
+
"""Return the datetime formatting patterns used by the locale for the
|
| 384 |
+
specified format.
|
| 385 |
+
|
| 386 |
+
>>> get_datetime_format(locale='en_US')
|
| 387 |
+
'{1}, {0}'
|
| 388 |
+
|
| 389 |
+
:param format: the format to use, one of "full", "long", "medium", or
|
| 390 |
+
"short"
|
| 391 |
+
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
|
| 392 |
+
"""
|
| 393 |
+
patterns = Locale.parse(locale or LC_TIME).datetime_formats
|
| 394 |
+
if format not in patterns:
|
| 395 |
+
format = None
|
| 396 |
+
return patterns[format]
|
| 397 |
+
|
| 398 |
+
|
| 399 |
+
def get_time_format(
|
| 400 |
+
format: _PredefinedTimeFormat = 'medium',
|
| 401 |
+
locale: Locale | str | None = None,
|
| 402 |
+
) -> DateTimePattern:
|
| 403 |
+
"""Return the time formatting patterns used by the locale for the specified
|
| 404 |
+
format.
|
| 405 |
+
|
| 406 |
+
>>> get_time_format(locale='en_US')
|
| 407 |
+
<DateTimePattern 'h:mm:ss\\u202fa'>
|
| 408 |
+
>>> get_time_format('full', locale='de_DE')
|
| 409 |
+
<DateTimePattern 'HH:mm:ss zzzz'>
|
| 410 |
+
|
| 411 |
+
:param format: the format to use, one of "full", "long", "medium", or
|
| 412 |
+
"short"
|
| 413 |
+
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
|
| 414 |
+
"""
|
| 415 |
+
return Locale.parse(locale or LC_TIME).time_formats[format]
|
| 416 |
+
|
| 417 |
+
|
| 418 |
+
def get_timezone_gmt(
|
| 419 |
+
datetime: _Instant = None,
|
| 420 |
+
width: Literal['long', 'short', 'iso8601', 'iso8601_short'] = 'long',
|
| 421 |
+
locale: Locale | str | None = None,
|
| 422 |
+
return_z: bool = False,
|
| 423 |
+
) -> str:
|
| 424 |
+
"""Return the timezone associated with the given `datetime` object formatted
|
| 425 |
+
as string indicating the offset from GMT.
|
| 426 |
+
|
| 427 |
+
>>> from datetime import datetime
|
| 428 |
+
>>> dt = datetime(2007, 4, 1, 15, 30)
|
| 429 |
+
>>> get_timezone_gmt(dt, locale='en')
|
| 430 |
+
'GMT+00:00'
|
| 431 |
+
>>> get_timezone_gmt(dt, locale='en', return_z=True)
|
| 432 |
+
'Z'
|
| 433 |
+
>>> get_timezone_gmt(dt, locale='en', width='iso8601_short')
|
| 434 |
+
'+00'
|
| 435 |
+
>>> tz = get_timezone('America/Los_Angeles')
|
| 436 |
+
>>> dt = _localize(tz, datetime(2007, 4, 1, 15, 30))
|
| 437 |
+
>>> get_timezone_gmt(dt, locale='en')
|
| 438 |
+
'GMT-07:00'
|
| 439 |
+
>>> get_timezone_gmt(dt, 'short', locale='en')
|
| 440 |
+
'-0700'
|
| 441 |
+
>>> get_timezone_gmt(dt, locale='en', width='iso8601_short')
|
| 442 |
+
'-07'
|
| 443 |
+
|
| 444 |
+
The long format depends on the locale, for example in France the acronym
|
| 445 |
+
UTC string is used instead of GMT:
|
| 446 |
+
|
| 447 |
+
>>> get_timezone_gmt(dt, 'long', locale='fr_FR')
|
| 448 |
+
'UTC-07:00'
|
| 449 |
+
|
| 450 |
+
.. versionadded:: 0.9
|
| 451 |
+
|
| 452 |
+
:param datetime: the ``datetime`` object; if `None`, the current date and
|
| 453 |
+
time in UTC is used
|
| 454 |
+
:param width: either "long" or "short" or "iso8601" or "iso8601_short"
|
| 455 |
+
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
|
| 456 |
+
:param return_z: True or False; Function returns indicator "Z"
|
| 457 |
+
when local time offset is 0
|
| 458 |
+
"""
|
| 459 |
+
datetime = _ensure_datetime_tzinfo(_get_datetime(datetime))
|
| 460 |
+
locale = Locale.parse(locale or LC_TIME)
|
| 461 |
+
|
| 462 |
+
offset = datetime.tzinfo.utcoffset(datetime)
|
| 463 |
+
seconds = offset.days * 24 * 60 * 60 + offset.seconds
|
| 464 |
+
hours, seconds = divmod(seconds, 3600)
|
| 465 |
+
if return_z and hours == 0 and seconds == 0:
|
| 466 |
+
return 'Z'
|
| 467 |
+
elif seconds == 0 and width == 'iso8601_short':
|
| 468 |
+
return '%+03d' % hours
|
| 469 |
+
elif width == 'short' or width == 'iso8601_short':
|
| 470 |
+
pattern = '%+03d%02d'
|
| 471 |
+
elif width == 'iso8601':
|
| 472 |
+
pattern = '%+03d:%02d'
|
| 473 |
+
else:
|
| 474 |
+
pattern = locale.zone_formats['gmt'] % '%+03d:%02d'
|
| 475 |
+
return pattern % (hours, seconds // 60)
|
| 476 |
+
|
| 477 |
+
|
| 478 |
+
def get_timezone_location(
|
| 479 |
+
dt_or_tzinfo: _DtOrTzinfo = None,
|
| 480 |
+
locale: Locale | str | None = None,
|
| 481 |
+
return_city: bool = False,
|
| 482 |
+
) -> str:
|
| 483 |
+
"""Return a representation of the given timezone using "location format".
|
| 484 |
+
|
| 485 |
+
The result depends on both the local display name of the country and the
|
| 486 |
+
city associated with the time zone:
|
| 487 |
+
|
| 488 |
+
>>> tz = get_timezone('America/St_Johns')
|
| 489 |
+
>>> print(get_timezone_location(tz, locale='de_DE'))
|
| 490 |
+
Kanada (St. John’s) (Ortszeit)
|
| 491 |
+
>>> print(get_timezone_location(tz, locale='en'))
|
| 492 |
+
Canada (St. John’s) Time
|
| 493 |
+
>>> print(get_timezone_location(tz, locale='en', return_city=True))
|
| 494 |
+
St. John’s
|
| 495 |
+
>>> tz = get_timezone('America/Mexico_City')
|
| 496 |
+
>>> get_timezone_location(tz, locale='de_DE')
|
| 497 |
+
'Mexiko (Mexiko-Stadt) (Ortszeit)'
|
| 498 |
+
|
| 499 |
+
If the timezone is associated with a country that uses only a single
|
| 500 |
+
timezone, just the localized country name is returned:
|
| 501 |
+
|
| 502 |
+
>>> tz = get_timezone('Europe/Berlin')
|
| 503 |
+
>>> get_timezone_name(tz, locale='de_DE')
|
| 504 |
+
'Mitteleuropäische Zeit'
|
| 505 |
+
|
| 506 |
+
.. versionadded:: 0.9
|
| 507 |
+
|
| 508 |
+
:param dt_or_tzinfo: the ``datetime`` or ``tzinfo`` object that determines
|
| 509 |
+
the timezone; if `None`, the current date and time in
|
| 510 |
+
UTC is assumed
|
| 511 |
+
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
|
| 512 |
+
:param return_city: True or False, if True then return exemplar city (location)
|
| 513 |
+
for the time zone
|
| 514 |
+
:return: the localized timezone name using location format
|
| 515 |
+
|
| 516 |
+
"""
|
| 517 |
+
locale = Locale.parse(locale or LC_TIME)
|
| 518 |
+
|
| 519 |
+
zone = _get_tz_name(dt_or_tzinfo)
|
| 520 |
+
|
| 521 |
+
# Get the canonical time-zone code
|
| 522 |
+
zone = get_global('zone_aliases').get(zone, zone)
|
| 523 |
+
|
| 524 |
+
info = locale.time_zones.get(zone, {})
|
| 525 |
+
|
| 526 |
+
# Otherwise, if there is only one timezone for the country, return the
|
| 527 |
+
# localized country name
|
| 528 |
+
region_format = locale.zone_formats['region']
|
| 529 |
+
territory = get_global('zone_territories').get(zone)
|
| 530 |
+
if territory not in locale.territories:
|
| 531 |
+
territory = 'ZZ' # invalid/unknown
|
| 532 |
+
territory_name = locale.territories[territory]
|
| 533 |
+
if (
|
| 534 |
+
not return_city
|
| 535 |
+
and territory
|
| 536 |
+
and len(get_global('territory_zones').get(territory, [])) == 1
|
| 537 |
+
):
|
| 538 |
+
return region_format % territory_name
|
| 539 |
+
|
| 540 |
+
# Otherwise, include the city in the output
|
| 541 |
+
fallback_format = locale.zone_formats['fallback']
|
| 542 |
+
if 'city' in info:
|
| 543 |
+
city_name = info['city']
|
| 544 |
+
else:
|
| 545 |
+
metazone = get_global('meta_zones').get(zone)
|
| 546 |
+
metazone_info = locale.meta_zones.get(metazone, {})
|
| 547 |
+
if 'city' in metazone_info:
|
| 548 |
+
city_name = metazone_info['city']
|
| 549 |
+
elif '/' in zone:
|
| 550 |
+
city_name = zone.split('/', 1)[1].replace('_', ' ')
|
| 551 |
+
else:
|
| 552 |
+
city_name = zone.replace('_', ' ')
|
| 553 |
+
|
| 554 |
+
if return_city:
|
| 555 |
+
return city_name
|
| 556 |
+
return region_format % (
|
| 557 |
+
fallback_format
|
| 558 |
+
% {
|
| 559 |
+
'0': city_name,
|
| 560 |
+
'1': territory_name,
|
| 561 |
+
}
|
| 562 |
+
)
|
| 563 |
+
|
| 564 |
+
|
| 565 |
+
def get_timezone_name(
|
| 566 |
+
dt_or_tzinfo: _DtOrTzinfo = None,
|
| 567 |
+
width: Literal['long', 'short'] = 'long',
|
| 568 |
+
uncommon: bool = False,
|
| 569 |
+
locale: Locale | str | None = None,
|
| 570 |
+
zone_variant: Literal['generic', 'daylight', 'standard'] | None = None,
|
| 571 |
+
return_zone: bool = False,
|
| 572 |
+
) -> str:
|
| 573 |
+
r"""Return the localized display name for the given timezone. The timezone
|
| 574 |
+
may be specified using a ``datetime`` or `tzinfo` object.
|
| 575 |
+
|
| 576 |
+
>>> from datetime import time
|
| 577 |
+
>>> dt = time(15, 30, tzinfo=get_timezone('America/Los_Angeles'))
|
| 578 |
+
>>> get_timezone_name(dt, locale='en_US') # doctest: +SKIP
|
| 579 |
+
'Pacific Standard Time'
|
| 580 |
+
>>> get_timezone_name(dt, locale='en_US', return_zone=True)
|
| 581 |
+
'America/Los_Angeles'
|
| 582 |
+
>>> get_timezone_name(dt, width='short', locale='en_US') # doctest: +SKIP
|
| 583 |
+
'PST'
|
| 584 |
+
|
| 585 |
+
If this function gets passed only a `tzinfo` object and no concrete
|
| 586 |
+
`datetime`, the returned display name is independent of daylight savings
|
| 587 |
+
time. This can be used for example for selecting timezones, or to set the
|
| 588 |
+
time of events that recur across DST changes:
|
| 589 |
+
|
| 590 |
+
>>> tz = get_timezone('America/Los_Angeles')
|
| 591 |
+
>>> get_timezone_name(tz, locale='en_US')
|
| 592 |
+
'Pacific Time'
|
| 593 |
+
>>> get_timezone_name(tz, 'short', locale='en_US')
|
| 594 |
+
'PT'
|
| 595 |
+
|
| 596 |
+
If no localized display name for the timezone is available, and the timezone
|
| 597 |
+
is associated with a country that uses only a single timezone, the name of
|
| 598 |
+
that country is returned, formatted according to the locale:
|
| 599 |
+
|
| 600 |
+
>>> tz = get_timezone('Europe/Berlin')
|
| 601 |
+
>>> get_timezone_name(tz, locale='de_DE')
|
| 602 |
+
'Mitteleuropäische Zeit'
|
| 603 |
+
>>> get_timezone_name(tz, locale='pt_BR')
|
| 604 |
+
'Horário da Europa Central'
|
| 605 |
+
|
| 606 |
+
On the other hand, if the country uses multiple timezones, the city is also
|
| 607 |
+
included in the representation:
|
| 608 |
+
|
| 609 |
+
>>> tz = get_timezone('America/St_Johns')
|
| 610 |
+
>>> get_timezone_name(tz, locale='de_DE')
|
| 611 |
+
'Neufundland-Zeit'
|
| 612 |
+
|
| 613 |
+
Note that short format is currently not supported for all timezones and
|
| 614 |
+
all locales. This is partially because not every timezone has a short
|
| 615 |
+
code in every locale. In that case it currently falls back to the long
|
| 616 |
+
format.
|
| 617 |
+
|
| 618 |
+
For more information see `LDML Appendix J: Time Zone Display Names
|
| 619 |
+
<https://www.unicode.org/reports/tr35/#Time_Zone_Fallback>`_
|
| 620 |
+
|
| 621 |
+
.. versionadded:: 0.9
|
| 622 |
+
|
| 623 |
+
.. versionchanged:: 1.0
|
| 624 |
+
Added `zone_variant` support.
|
| 625 |
+
|
| 626 |
+
:param dt_or_tzinfo: the ``datetime`` or ``tzinfo`` object that determines
|
| 627 |
+
the timezone; if a ``tzinfo`` object is used, the
|
| 628 |
+
resulting display name will be generic, i.e.
|
| 629 |
+
independent of daylight savings time; if `None`, the
|
| 630 |
+
current date in UTC is assumed
|
| 631 |
+
:param width: either "long" or "short"
|
| 632 |
+
:param uncommon: deprecated and ignored
|
| 633 |
+
:param zone_variant: defines the zone variation to return. By default the
|
| 634 |
+
variation is defined from the datetime object
|
| 635 |
+
passed in. If no datetime object is passed in, the
|
| 636 |
+
``'generic'`` variation is assumed. The following
|
| 637 |
+
values are valid: ``'generic'``, ``'daylight'`` and
|
| 638 |
+
``'standard'``.
|
| 639 |
+
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
|
| 640 |
+
:param return_zone: True or False. If true then function
|
| 641 |
+
returns long time zone ID
|
| 642 |
+
"""
|
| 643 |
+
dt, tzinfo = _get_dt_and_tzinfo(dt_or_tzinfo)
|
| 644 |
+
locale = Locale.parse(locale or LC_TIME)
|
| 645 |
+
|
| 646 |
+
zone = _get_tz_name(dt_or_tzinfo)
|
| 647 |
+
|
| 648 |
+
if zone_variant is None:
|
| 649 |
+
if dt is None:
|
| 650 |
+
zone_variant = 'generic'
|
| 651 |
+
else:
|
| 652 |
+
dst = tzinfo.dst(dt)
|
| 653 |
+
zone_variant = "daylight" if dst else "standard"
|
| 654 |
+
else:
|
| 655 |
+
if zone_variant not in ('generic', 'standard', 'daylight'):
|
| 656 |
+
raise ValueError('Invalid zone variation')
|
| 657 |
+
|
| 658 |
+
# Get the canonical time-zone code
|
| 659 |
+
zone = get_global('zone_aliases').get(zone, zone)
|
| 660 |
+
if return_zone:
|
| 661 |
+
return zone
|
| 662 |
+
info = locale.time_zones.get(zone, {})
|
| 663 |
+
# Try explicitly translated zone names first
|
| 664 |
+
if width in info and zone_variant in info[width]:
|
| 665 |
+
value = info[width][zone_variant]
|
| 666 |
+
if value != NO_INHERITANCE_MARKER:
|
| 667 |
+
return value
|
| 668 |
+
|
| 669 |
+
metazone = get_global('meta_zones').get(zone)
|
| 670 |
+
if metazone:
|
| 671 |
+
metazone_info = locale.meta_zones.get(metazone, {})
|
| 672 |
+
if width in metazone_info:
|
| 673 |
+
name = metazone_info[width].get(zone_variant)
|
| 674 |
+
if width == 'short' and name == NO_INHERITANCE_MARKER:
|
| 675 |
+
# If the short form is marked no-inheritance,
|
| 676 |
+
# try to fall back to the long name instead.
|
| 677 |
+
name = metazone_info.get('long', {}).get(zone_variant)
|
| 678 |
+
if name and name != NO_INHERITANCE_MARKER:
|
| 679 |
+
return name
|
| 680 |
+
|
| 681 |
+
# If we have a concrete datetime, we assume that the result can't be
|
| 682 |
+
# independent of daylight savings time, so we return the GMT offset
|
| 683 |
+
if dt is not None:
|
| 684 |
+
return get_timezone_gmt(dt, width=width, locale=locale)
|
| 685 |
+
|
| 686 |
+
return get_timezone_location(dt_or_tzinfo, locale=locale)
|
| 687 |
+
|
| 688 |
+
|
| 689 |
+
def format_date(
|
| 690 |
+
date: datetime.date | None = None,
|
| 691 |
+
format: _PredefinedTimeFormat | str = 'medium',
|
| 692 |
+
locale: Locale | str | None = None,
|
| 693 |
+
) -> str:
|
| 694 |
+
"""Return a date formatted according to the given pattern.
|
| 695 |
+
|
| 696 |
+
>>> from datetime import date
|
| 697 |
+
>>> d = date(2007, 4, 1)
|
| 698 |
+
>>> format_date(d, locale='en_US')
|
| 699 |
+
'Apr 1, 2007'
|
| 700 |
+
>>> format_date(d, format='full', locale='de_DE')
|
| 701 |
+
'Sonntag, 1. April 2007'
|
| 702 |
+
|
| 703 |
+
If you don't want to use the locale default formats, you can specify a
|
| 704 |
+
custom date pattern:
|
| 705 |
+
|
| 706 |
+
>>> format_date(d, "EEE, MMM d, ''yy", locale='en')
|
| 707 |
+
"Sun, Apr 1, '07"
|
| 708 |
+
|
| 709 |
+
:param date: the ``date`` or ``datetime`` object; if `None`, the current
|
| 710 |
+
date is used
|
| 711 |
+
:param format: one of "full", "long", "medium", or "short", or a custom
|
| 712 |
+
date/time pattern
|
| 713 |
+
:param locale: a `Locale` object or a locale identifier. Defaults to the system time locale.
|
| 714 |
+
"""
|
| 715 |
+
if date is None:
|
| 716 |
+
date = datetime.date.today()
|
| 717 |
+
elif isinstance(date, datetime.datetime):
|
| 718 |
+
date = date.date()
|
| 719 |
+
|
| 720 |
+
locale = Locale.parse(locale or LC_TIME)
|
| 721 |
+
if format in ('full', 'long', 'medium', 'short'):
|
| 722 |
+
format = get_date_format(format, locale=locale)
|
| 723 |
+
pattern = parse_pattern(format)
|
| 724 |
+
return pattern.apply(date, locale)
|
| 725 |
+
|
| 726 |
+
|
| 727 |
+
def format_datetime(
|
| 728 |
+
datetime: _Instant = None,
|
| 729 |
+
format: _PredefinedTimeFormat | str = 'medium',
|
| 730 |
+
tzinfo: datetime.tzinfo | None = None,
|
| 731 |
+
locale: Locale | str | None = None,
|
| 732 |
+
) -> str:
|
| 733 |
+
r"""Return a date formatted according to the given pattern.
|
| 734 |
+
|
| 735 |
+
>>> from datetime import datetime
|
| 736 |
+
>>> dt = datetime(2007, 4, 1, 15, 30)
|
| 737 |
+
>>> format_datetime(dt, locale='en_US')
|
| 738 |
+
'Apr 1, 2007, 3:30:00\u202fPM'
|
| 739 |
+
|
| 740 |
+
For any pattern requiring the display of the timezone:
|
| 741 |
+
|
| 742 |
+
>>> format_datetime(dt, 'full', tzinfo=get_timezone('Europe/Paris'),
|
| 743 |
+
... locale='fr_FR')
|
| 744 |
+
'dimanche 1 avril 2007, 17:30:00 heure d’été d’Europe centrale'
|
| 745 |
+
>>> format_datetime(dt, "yyyy.MM.dd G 'at' HH:mm:ss zzz",
|
| 746 |
+
... tzinfo=get_timezone('US/Eastern'), locale='en')
|
| 747 |
+
'2007.04.01 AD at 11:30:00 EDT'
|
| 748 |
+
|
| 749 |
+
:param datetime: the `datetime` object; if `None`, the current date and
|
| 750 |
+
time is used
|
| 751 |
+
:param format: one of "full", "long", "medium", or "short", or a custom
|
| 752 |
+
date/time pattern
|
| 753 |
+
:param tzinfo: the timezone to apply to the time for display
|
| 754 |
+
:param locale: a `Locale` object or a locale identifier. Defaults to the system time locale.
|
| 755 |
+
"""
|
| 756 |
+
datetime = _ensure_datetime_tzinfo(_get_datetime(datetime), tzinfo)
|
| 757 |
+
|
| 758 |
+
locale = Locale.parse(locale or LC_TIME)
|
| 759 |
+
if format in ('full', 'long', 'medium', 'short'):
|
| 760 |
+
return (
|
| 761 |
+
get_datetime_format(format, locale=locale)
|
| 762 |
+
.replace("'", "")
|
| 763 |
+
.replace('{0}', format_time(datetime, format, tzinfo=None, locale=locale))
|
| 764 |
+
.replace('{1}', format_date(datetime, format, locale=locale))
|
| 765 |
+
)
|
| 766 |
+
else:
|
| 767 |
+
return parse_pattern(format).apply(datetime, locale)
|
| 768 |
+
|
| 769 |
+
|
| 770 |
+
def format_time(
|
| 771 |
+
time: datetime.time | datetime.datetime | float | None = None,
|
| 772 |
+
format: _PredefinedTimeFormat | str = 'medium',
|
| 773 |
+
tzinfo: datetime.tzinfo | None = None,
|
| 774 |
+
locale: Locale | str | None = None,
|
| 775 |
+
) -> str:
|
| 776 |
+
r"""Return a time formatted according to the given pattern.
|
| 777 |
+
|
| 778 |
+
>>> from datetime import datetime, time
|
| 779 |
+
>>> t = time(15, 30)
|
| 780 |
+
>>> format_time(t, locale='en_US')
|
| 781 |
+
'3:30:00\u202fPM'
|
| 782 |
+
>>> format_time(t, format='short', locale='de_DE')
|
| 783 |
+
'15:30'
|
| 784 |
+
|
| 785 |
+
If you don't want to use the locale default formats, you can specify a
|
| 786 |
+
custom time pattern:
|
| 787 |
+
|
| 788 |
+
>>> format_time(t, "hh 'o''clock' a", locale='en')
|
| 789 |
+
"03 o'clock PM"
|
| 790 |
+
|
| 791 |
+
For any pattern requiring the display of the time-zone a
|
| 792 |
+
timezone has to be specified explicitly:
|
| 793 |
+
|
| 794 |
+
>>> t = datetime(2007, 4, 1, 15, 30)
|
| 795 |
+
>>> tzinfo = get_timezone('Europe/Paris')
|
| 796 |
+
>>> t = _localize(tzinfo, t)
|
| 797 |
+
>>> format_time(t, format='full', tzinfo=tzinfo, locale='fr_FR')
|
| 798 |
+
'15:30:00 heure d’été d’Europe centrale'
|
| 799 |
+
>>> format_time(t, "hh 'o''clock' a, zzzz", tzinfo=get_timezone('US/Eastern'),
|
| 800 |
+
... locale='en')
|
| 801 |
+
"09 o'clock AM, Eastern Daylight Time"
|
| 802 |
+
|
| 803 |
+
As that example shows, when this function gets passed a
|
| 804 |
+
``datetime.datetime`` value, the actual time in the formatted string is
|
| 805 |
+
adjusted to the timezone specified by the `tzinfo` parameter. If the
|
| 806 |
+
``datetime`` is "naive" (i.e. it has no associated timezone information),
|
| 807 |
+
it is assumed to be in UTC.
|
| 808 |
+
|
| 809 |
+
These timezone calculations are **not** performed if the value is of type
|
| 810 |
+
``datetime.time``, as without date information there's no way to determine
|
| 811 |
+
what a given time would translate to in a different timezone without
|
| 812 |
+
information about whether daylight savings time is in effect or not. This
|
| 813 |
+
means that time values are left as-is, and the value of the `tzinfo`
|
| 814 |
+
parameter is only used to display the timezone name if needed:
|
| 815 |
+
|
| 816 |
+
>>> t = time(15, 30)
|
| 817 |
+
>>> format_time(t, format='full', tzinfo=get_timezone('Europe/Paris'),
|
| 818 |
+
... locale='fr_FR') # doctest: +SKIP
|
| 819 |
+
'15:30:00 heure normale d\u2019Europe centrale'
|
| 820 |
+
>>> format_time(t, format='full', tzinfo=get_timezone('US/Eastern'),
|
| 821 |
+
... locale='en_US') # doctest: +SKIP
|
| 822 |
+
'3:30:00\u202fPM Eastern Standard Time'
|
| 823 |
+
|
| 824 |
+
:param time: the ``time`` or ``datetime`` object; if `None`, the current
|
| 825 |
+
time in UTC is used
|
| 826 |
+
:param format: one of "full", "long", "medium", or "short", or a custom
|
| 827 |
+
date/time pattern
|
| 828 |
+
:param tzinfo: the time-zone to apply to the time for display
|
| 829 |
+
:param locale: a `Locale` object or a locale identifier. Defaults to the system time locale.
|
| 830 |
+
"""
|
| 831 |
+
|
| 832 |
+
# get reference date for if we need to find the right timezone variant
|
| 833 |
+
# in the pattern
|
| 834 |
+
ref_date = time.date() if isinstance(time, datetime.datetime) else None
|
| 835 |
+
|
| 836 |
+
time = _get_time(time, tzinfo)
|
| 837 |
+
|
| 838 |
+
locale = Locale.parse(locale or LC_TIME)
|
| 839 |
+
if format in ('full', 'long', 'medium', 'short'):
|
| 840 |
+
format = get_time_format(format, locale=locale)
|
| 841 |
+
return parse_pattern(format).apply(time, locale, reference_date=ref_date)
|
| 842 |
+
|
| 843 |
+
|
| 844 |
+
def format_skeleton(
|
| 845 |
+
skeleton: str,
|
| 846 |
+
datetime: _Instant = None,
|
| 847 |
+
tzinfo: datetime.tzinfo | None = None,
|
| 848 |
+
fuzzy: bool = True,
|
| 849 |
+
locale: Locale | str | None = None,
|
| 850 |
+
) -> str:
|
| 851 |
+
r"""Return a time and/or date formatted according to the given pattern.
|
| 852 |
+
|
| 853 |
+
The skeletons are defined in the CLDR data and provide more flexibility
|
| 854 |
+
than the simple short/long/medium formats, but are a bit harder to use.
|
| 855 |
+
The are defined using the date/time symbols without order or punctuation
|
| 856 |
+
and map to a suitable format for the given locale.
|
| 857 |
+
|
| 858 |
+
>>> from datetime import datetime
|
| 859 |
+
>>> t = datetime(2007, 4, 1, 15, 30)
|
| 860 |
+
>>> format_skeleton('MMMEd', t, locale='fr')
|
| 861 |
+
'dim. 1 avr.'
|
| 862 |
+
>>> format_skeleton('MMMEd', t, locale='en')
|
| 863 |
+
'Sun, Apr 1'
|
| 864 |
+
>>> format_skeleton('yMMd', t, locale='fi') # yMMd is not in the Finnish locale; yMd gets used
|
| 865 |
+
'1.4.2007'
|
| 866 |
+
>>> format_skeleton('yMMd', t, fuzzy=False, locale='fi') # yMMd is not in the Finnish locale, an error is thrown
|
| 867 |
+
Traceback (most recent call last):
|
| 868 |
+
...
|
| 869 |
+
KeyError: yMMd
|
| 870 |
+
>>> format_skeleton('GH', t, fuzzy=True, locale='fi_FI') # GH is not in the Finnish locale and there is no close match, an error is thrown
|
| 871 |
+
Traceback (most recent call last):
|
| 872 |
+
...
|
| 873 |
+
KeyError: None
|
| 874 |
+
|
| 875 |
+
After the skeleton is resolved to a pattern `format_datetime` is called so
|
| 876 |
+
all timezone processing etc is the same as for that.
|
| 877 |
+
|
| 878 |
+
:param skeleton: A date time skeleton as defined in the cldr data.
|
| 879 |
+
:param datetime: the ``time`` or ``datetime`` object; if `None`, the current
|
| 880 |
+
time in UTC is used
|
| 881 |
+
:param tzinfo: the time-zone to apply to the time for display
|
| 882 |
+
:param fuzzy: If the skeleton is not found, allow choosing a skeleton that's
|
| 883 |
+
close enough to it. If there is no close match, a `KeyError`
|
| 884 |
+
is thrown.
|
| 885 |
+
:param locale: a `Locale` object or a locale identifier. Defaults to the system time locale.
|
| 886 |
+
"""
|
| 887 |
+
locale = Locale.parse(locale or LC_TIME)
|
| 888 |
+
if fuzzy and skeleton not in locale.datetime_skeletons:
|
| 889 |
+
skeleton = match_skeleton(skeleton, locale.datetime_skeletons)
|
| 890 |
+
format = locale.datetime_skeletons[skeleton]
|
| 891 |
+
return format_datetime(datetime, format, tzinfo, locale)
|
| 892 |
+
|
| 893 |
+
|
| 894 |
+
TIMEDELTA_UNITS: tuple[tuple[str, int], ...] = (
|
| 895 |
+
('year', 3600 * 24 * 365),
|
| 896 |
+
('month', 3600 * 24 * 30),
|
| 897 |
+
('week', 3600 * 24 * 7),
|
| 898 |
+
('day', 3600 * 24),
|
| 899 |
+
('hour', 3600),
|
| 900 |
+
('minute', 60),
|
| 901 |
+
('second', 1),
|
| 902 |
+
)
|
| 903 |
+
|
| 904 |
+
|
| 905 |
+
def format_timedelta(
|
| 906 |
+
delta: datetime.timedelta | int,
|
| 907 |
+
granularity: Literal[
|
| 908 |
+
'year',
|
| 909 |
+
'month',
|
| 910 |
+
'week',
|
| 911 |
+
'day',
|
| 912 |
+
'hour',
|
| 913 |
+
'minute',
|
| 914 |
+
'second',
|
| 915 |
+
] = 'second',
|
| 916 |
+
threshold: float = 0.85,
|
| 917 |
+
add_direction: bool = False,
|
| 918 |
+
format: Literal['narrow', 'short', 'medium', 'long'] = 'long',
|
| 919 |
+
locale: Locale | str | None = None,
|
| 920 |
+
) -> str:
|
| 921 |
+
"""Return a time delta according to the rules of the given locale.
|
| 922 |
+
|
| 923 |
+
>>> from datetime import timedelta
|
| 924 |
+
>>> format_timedelta(timedelta(weeks=12), locale='en_US')
|
| 925 |
+
'3 months'
|
| 926 |
+
>>> format_timedelta(timedelta(seconds=1), locale='es')
|
| 927 |
+
'1 segundo'
|
| 928 |
+
|
| 929 |
+
The granularity parameter can be provided to alter the lowest unit
|
| 930 |
+
presented, which defaults to a second.
|
| 931 |
+
|
| 932 |
+
>>> format_timedelta(timedelta(hours=3), granularity='day', locale='en_US')
|
| 933 |
+
'1 day'
|
| 934 |
+
|
| 935 |
+
The threshold parameter can be used to determine at which value the
|
| 936 |
+
presentation switches to the next higher unit. A higher threshold factor
|
| 937 |
+
means the presentation will switch later. For example:
|
| 938 |
+
|
| 939 |
+
>>> format_timedelta(timedelta(hours=23), threshold=0.9, locale='en_US')
|
| 940 |
+
'1 day'
|
| 941 |
+
>>> format_timedelta(timedelta(hours=23), threshold=1.1, locale='en_US')
|
| 942 |
+
'23 hours'
|
| 943 |
+
|
| 944 |
+
In addition directional information can be provided that informs
|
| 945 |
+
the user if the date is in the past or in the future:
|
| 946 |
+
|
| 947 |
+
>>> format_timedelta(timedelta(hours=1), add_direction=True, locale='en')
|
| 948 |
+
'in 1 hour'
|
| 949 |
+
>>> format_timedelta(timedelta(hours=-1), add_direction=True, locale='en')
|
| 950 |
+
'1 hour ago'
|
| 951 |
+
|
| 952 |
+
The format parameter controls how compact or wide the presentation is:
|
| 953 |
+
|
| 954 |
+
>>> format_timedelta(timedelta(hours=3), format='short', locale='en')
|
| 955 |
+
'3 hr'
|
| 956 |
+
>>> format_timedelta(timedelta(hours=3), format='narrow', locale='en')
|
| 957 |
+
'3h'
|
| 958 |
+
|
| 959 |
+
:param delta: a ``timedelta`` object representing the time difference to
|
| 960 |
+
format, or the delta in seconds as an `int` value
|
| 961 |
+
:param granularity: determines the smallest unit that should be displayed,
|
| 962 |
+
the value can be one of "year", "month", "week", "day",
|
| 963 |
+
"hour", "minute" or "second"
|
| 964 |
+
:param threshold: factor that determines at which point the presentation
|
| 965 |
+
switches to the next higher unit
|
| 966 |
+
:param add_direction: if this flag is set to `True` the return value will
|
| 967 |
+
include directional information. For instance a
|
| 968 |
+
positive timedelta will include the information about
|
| 969 |
+
it being in the future, a negative will be information
|
| 970 |
+
about the value being in the past.
|
| 971 |
+
:param format: the format, can be "narrow", "short" or "long". (
|
| 972 |
+
"medium" is deprecated, currently converted to "long" to
|
| 973 |
+
maintain compatibility)
|
| 974 |
+
:param locale: a `Locale` object or a locale identifier. Defaults to the system time locale.
|
| 975 |
+
"""
|
| 976 |
+
if format not in ('narrow', 'short', 'medium', 'long'):
|
| 977 |
+
raise TypeError('Format must be one of "narrow", "short" or "long"')
|
| 978 |
+
if format == 'medium':
|
| 979 |
+
warnings.warn(
|
| 980 |
+
'"medium" value for format param of format_timedelta is deprecated. Use "long" instead',
|
| 981 |
+
category=DeprecationWarning,
|
| 982 |
+
stacklevel=2,
|
| 983 |
+
)
|
| 984 |
+
format = 'long'
|
| 985 |
+
if isinstance(delta, datetime.timedelta):
|
| 986 |
+
seconds = int((delta.days * 86400) + delta.seconds)
|
| 987 |
+
else:
|
| 988 |
+
seconds = delta
|
| 989 |
+
locale = Locale.parse(locale or LC_TIME)
|
| 990 |
+
date_fields = locale._data["date_fields"]
|
| 991 |
+
unit_patterns = locale._data["unit_patterns"]
|
| 992 |
+
|
| 993 |
+
def _iter_patterns(a_unit):
|
| 994 |
+
if add_direction:
|
| 995 |
+
# Try to find the length variant version first ("year-narrow")
|
| 996 |
+
# before falling back to the default.
|
| 997 |
+
unit_rel_patterns = date_fields.get(f"{a_unit}-{format}") or date_fields[a_unit]
|
| 998 |
+
if seconds >= 0:
|
| 999 |
+
yield unit_rel_patterns['future']
|
| 1000 |
+
else:
|
| 1001 |
+
yield unit_rel_patterns['past']
|
| 1002 |
+
a_unit = f"duration-{a_unit}"
|
| 1003 |
+
unit_pats = unit_patterns.get(a_unit, {})
|
| 1004 |
+
yield unit_pats.get(format)
|
| 1005 |
+
# We do not support `<alias>` tags at all while ingesting CLDR data,
|
| 1006 |
+
# so these aliases specified in `root.xml` are hard-coded here:
|
| 1007 |
+
# <unitLength type="long"><alias source="locale" path="../unitLength[@type='short']"/></unitLength>
|
| 1008 |
+
# <unitLength type="narrow"><alias source="locale" path="../unitLength[@type='short']"/></unitLength>
|
| 1009 |
+
if format in ("long", "narrow"):
|
| 1010 |
+
yield unit_pats.get("short")
|
| 1011 |
+
|
| 1012 |
+
for unit, secs_per_unit in TIMEDELTA_UNITS:
|
| 1013 |
+
value = abs(seconds) / secs_per_unit
|
| 1014 |
+
if value >= threshold or unit == granularity:
|
| 1015 |
+
if unit == granularity and value > 0:
|
| 1016 |
+
value = max(1, value)
|
| 1017 |
+
value = int(round(value))
|
| 1018 |
+
plural_form = locale.plural_form(value)
|
| 1019 |
+
pattern = None
|
| 1020 |
+
for patterns in _iter_patterns(unit):
|
| 1021 |
+
if patterns is not None:
|
| 1022 |
+
pattern = patterns.get(plural_form) or patterns.get('other')
|
| 1023 |
+
if pattern:
|
| 1024 |
+
break
|
| 1025 |
+
# This really should not happen
|
| 1026 |
+
if pattern is None:
|
| 1027 |
+
return ''
|
| 1028 |
+
return pattern.replace('{0}', str(value))
|
| 1029 |
+
|
| 1030 |
+
return ''
|
| 1031 |
+
|
| 1032 |
+
|
| 1033 |
+
def _format_fallback_interval(
|
| 1034 |
+
start: _Instant,
|
| 1035 |
+
end: _Instant,
|
| 1036 |
+
skeleton: str | None,
|
| 1037 |
+
tzinfo: datetime.tzinfo | None,
|
| 1038 |
+
locale: Locale,
|
| 1039 |
+
) -> str:
|
| 1040 |
+
if skeleton in locale.datetime_skeletons: # Use the given skeleton
|
| 1041 |
+
format = lambda dt: format_skeleton(skeleton, dt, tzinfo, locale=locale)
|
| 1042 |
+
elif all(
|
| 1043 |
+
# Both are just dates
|
| 1044 |
+
(isinstance(d, datetime.date) and not isinstance(d, datetime.datetime))
|
| 1045 |
+
for d in (start, end)
|
| 1046 |
+
):
|
| 1047 |
+
format = lambda dt: format_date(dt, locale=locale)
|
| 1048 |
+
elif all(
|
| 1049 |
+
# Both are times
|
| 1050 |
+
(isinstance(d, datetime.time) and not isinstance(d, datetime.date))
|
| 1051 |
+
for d in (start, end)
|
| 1052 |
+
):
|
| 1053 |
+
format = lambda dt: format_time(dt, tzinfo=tzinfo, locale=locale)
|
| 1054 |
+
else:
|
| 1055 |
+
format = lambda dt: format_datetime(dt, tzinfo=tzinfo, locale=locale)
|
| 1056 |
+
|
| 1057 |
+
formatted_start = format(start)
|
| 1058 |
+
formatted_end = format(end)
|
| 1059 |
+
|
| 1060 |
+
if formatted_start == formatted_end:
|
| 1061 |
+
return format(start)
|
| 1062 |
+
|
| 1063 |
+
return (
|
| 1064 |
+
locale.interval_formats.get(None, "{0}-{1}")
|
| 1065 |
+
.replace("{0}", formatted_start)
|
| 1066 |
+
.replace("{1}", formatted_end)
|
| 1067 |
+
)
|
| 1068 |
+
|
| 1069 |
+
|
| 1070 |
+
def format_interval(
|
| 1071 |
+
start: _Instant,
|
| 1072 |
+
end: _Instant,
|
| 1073 |
+
skeleton: str | None = None,
|
| 1074 |
+
tzinfo: datetime.tzinfo | None = None,
|
| 1075 |
+
fuzzy: bool = True,
|
| 1076 |
+
locale: Locale | str | None = None,
|
| 1077 |
+
) -> str:
|
| 1078 |
+
"""
|
| 1079 |
+
Format an interval between two instants according to the locale's rules.
|
| 1080 |
+
|
| 1081 |
+
>>> from datetime import date, time
|
| 1082 |
+
>>> format_interval(date(2016, 1, 15), date(2016, 1, 17), "yMd", locale="fi")
|
| 1083 |
+
'15.–17.1.2016'
|
| 1084 |
+
|
| 1085 |
+
>>> format_interval(time(12, 12), time(16, 16), "Hm", locale="en_GB")
|
| 1086 |
+
'12:12–16:16'
|
| 1087 |
+
|
| 1088 |
+
>>> format_interval(time(5, 12), time(16, 16), "hm", locale="en_US")
|
| 1089 |
+
'5:12\\u202fAM\\u2009–\\u20094:16\\u202fPM'
|
| 1090 |
+
|
| 1091 |
+
>>> format_interval(time(16, 18), time(16, 24), "Hm", locale="it")
|
| 1092 |
+
'16:18–16:24'
|
| 1093 |
+
|
| 1094 |
+
If the start instant equals the end instant, the interval is formatted like the instant.
|
| 1095 |
+
|
| 1096 |
+
>>> format_interval(time(16, 18), time(16, 18), "Hm", locale="it")
|
| 1097 |
+
'16:18'
|
| 1098 |
+
|
| 1099 |
+
Unknown skeletons fall back to "default" formatting.
|
| 1100 |
+
|
| 1101 |
+
>>> format_interval(date(2015, 1, 1), date(2017, 1, 1), "wzq", locale="ja")
|
| 1102 |
+
'2015/01/01~2017/01/01'
|
| 1103 |
+
|
| 1104 |
+
>>> format_interval(time(16, 18), time(16, 24), "xxx", locale="ja")
|
| 1105 |
+
'16:18:00~16:24:00'
|
| 1106 |
+
|
| 1107 |
+
>>> format_interval(date(2016, 1, 15), date(2016, 1, 17), "xxx", locale="de")
|
| 1108 |
+
'15.01.2016\\u2009–\\u200917.01.2016'
|
| 1109 |
+
|
| 1110 |
+
:param start: First instant (datetime/date/time)
|
| 1111 |
+
:param end: Second instant (datetime/date/time)
|
| 1112 |
+
:param skeleton: The "skeleton format" to use for formatting.
|
| 1113 |
+
:param tzinfo: tzinfo to use (if none is already attached)
|
| 1114 |
+
:param fuzzy: If the skeleton is not found, allow choosing a skeleton that's
|
| 1115 |
+
close enough to it.
|
| 1116 |
+
:param locale: A locale object or identifier. Defaults to the system time locale.
|
| 1117 |
+
:return: Formatted interval
|
| 1118 |
+
"""
|
| 1119 |
+
locale = Locale.parse(locale or LC_TIME)
|
| 1120 |
+
|
| 1121 |
+
# NB: The quote comments below are from the algorithm description in
|
| 1122 |
+
# https://www.unicode.org/reports/tr35/tr35-dates.html#intervalFormats
|
| 1123 |
+
|
| 1124 |
+
# > Look for the intervalFormatItem element that matches the "skeleton",
|
| 1125 |
+
# > starting in the current locale and then following the locale fallback
|
| 1126 |
+
# > chain up to, but not including root.
|
| 1127 |
+
|
| 1128 |
+
interval_formats = locale.interval_formats
|
| 1129 |
+
|
| 1130 |
+
if skeleton not in interval_formats or not skeleton:
|
| 1131 |
+
# > If no match was found from the previous step, check what the closest
|
| 1132 |
+
# > match is in the fallback locale chain, as in availableFormats. That
|
| 1133 |
+
# > is, this allows for adjusting the string value field's width,
|
| 1134 |
+
# > including adjusting between "MMM" and "MMMM", and using different
|
| 1135 |
+
# > variants of the same field, such as 'v' and 'z'.
|
| 1136 |
+
if skeleton and fuzzy:
|
| 1137 |
+
skeleton = match_skeleton(skeleton, interval_formats)
|
| 1138 |
+
else:
|
| 1139 |
+
skeleton = None
|
| 1140 |
+
if not skeleton: # Still no match whatsoever?
|
| 1141 |
+
# > Otherwise, format the start and end datetime using the fallback pattern.
|
| 1142 |
+
return _format_fallback_interval(start, end, skeleton, tzinfo, locale)
|
| 1143 |
+
|
| 1144 |
+
skel_formats = interval_formats[skeleton]
|
| 1145 |
+
|
| 1146 |
+
if start == end:
|
| 1147 |
+
return format_skeleton(skeleton, start, tzinfo, fuzzy=fuzzy, locale=locale)
|
| 1148 |
+
|
| 1149 |
+
start = _ensure_datetime_tzinfo(_get_datetime(start), tzinfo=tzinfo)
|
| 1150 |
+
end = _ensure_datetime_tzinfo(_get_datetime(end), tzinfo=tzinfo)
|
| 1151 |
+
|
| 1152 |
+
start_fmt = DateTimeFormat(start, locale=locale)
|
| 1153 |
+
end_fmt = DateTimeFormat(end, locale=locale)
|
| 1154 |
+
|
| 1155 |
+
# > If a match is found from previous steps, compute the calendar field
|
| 1156 |
+
# > with the greatest difference between start and end datetime. If there
|
| 1157 |
+
# > is no difference among any of the fields in the pattern, format as a
|
| 1158 |
+
# > single date using availableFormats, and return.
|
| 1159 |
+
|
| 1160 |
+
for field in PATTERN_CHAR_ORDER: # These are in largest-to-smallest order
|
| 1161 |
+
if field in skel_formats and start_fmt.extract(field) != end_fmt.extract(field):
|
| 1162 |
+
# > If there is a match, use the pieces of the corresponding pattern to
|
| 1163 |
+
# > format the start and end datetime, as above.
|
| 1164 |
+
return "".join(
|
| 1165 |
+
parse_pattern(pattern).apply(instant, locale)
|
| 1166 |
+
for pattern, instant in zip(skel_formats[field], (start, end))
|
| 1167 |
+
)
|
| 1168 |
+
|
| 1169 |
+
# > Otherwise, format the start and end datetime using the fallback pattern.
|
| 1170 |
+
|
| 1171 |
+
return _format_fallback_interval(start, end, skeleton, tzinfo, locale)
|
| 1172 |
+
|
| 1173 |
+
|
| 1174 |
+
def get_period_id(
|
| 1175 |
+
time: _Instant,
|
| 1176 |
+
tzinfo: datetime.tzinfo | None = None,
|
| 1177 |
+
type: Literal['selection'] | None = None,
|
| 1178 |
+
locale: Locale | str | None = None,
|
| 1179 |
+
) -> str:
|
| 1180 |
+
"""
|
| 1181 |
+
Get the day period ID for a given time.
|
| 1182 |
+
|
| 1183 |
+
This ID can be used as a key for the period name dictionary.
|
| 1184 |
+
|
| 1185 |
+
>>> from datetime import time
|
| 1186 |
+
>>> get_period_names(locale="de")[get_period_id(time(7, 42), locale="de")]
|
| 1187 |
+
'Morgen'
|
| 1188 |
+
|
| 1189 |
+
>>> get_period_id(time(0), locale="en_US")
|
| 1190 |
+
'midnight'
|
| 1191 |
+
|
| 1192 |
+
>>> get_period_id(time(0), type="selection", locale="en_US")
|
| 1193 |
+
'morning1'
|
| 1194 |
+
|
| 1195 |
+
:param time: The time to inspect.
|
| 1196 |
+
:param tzinfo: The timezone for the time. See ``format_time``.
|
| 1197 |
+
:param type: The period type to use. Either "selection" or None.
|
| 1198 |
+
The selection type is used for selecting among phrases such as
|
| 1199 |
+
“Your email arrived yesterday evening” or “Your email arrived last night”.
|
| 1200 |
+
:param locale: the `Locale` object, or a locale string. Defaults to the system time locale.
|
| 1201 |
+
:return: period ID. Something is always returned -- even if it's just "am" or "pm".
|
| 1202 |
+
"""
|
| 1203 |
+
time = _get_time(time, tzinfo)
|
| 1204 |
+
seconds_past_midnight = int(time.hour * 60 * 60 + time.minute * 60 + time.second)
|
| 1205 |
+
locale = Locale.parse(locale or LC_TIME)
|
| 1206 |
+
|
| 1207 |
+
# The LDML rules state that the rules may not overlap, so iterating in arbitrary
|
| 1208 |
+
# order should be alright, though `at` periods should be preferred.
|
| 1209 |
+
rulesets = locale.day_period_rules.get(type, {}).items()
|
| 1210 |
+
|
| 1211 |
+
for rule_id, rules in rulesets:
|
| 1212 |
+
for rule in rules:
|
| 1213 |
+
if "at" in rule and rule["at"] == seconds_past_midnight:
|
| 1214 |
+
return rule_id
|
| 1215 |
+
|
| 1216 |
+
for rule_id, rules in rulesets:
|
| 1217 |
+
for rule in rules:
|
| 1218 |
+
if "from" in rule and "before" in rule:
|
| 1219 |
+
if rule["from"] < rule["before"]:
|
| 1220 |
+
if rule["from"] <= seconds_past_midnight < rule["before"]:
|
| 1221 |
+
return rule_id
|
| 1222 |
+
else:
|
| 1223 |
+
# e.g. from="21:00" before="06:00"
|
| 1224 |
+
if (
|
| 1225 |
+
rule["from"] <= seconds_past_midnight < 86400
|
| 1226 |
+
or 0 <= seconds_past_midnight < rule["before"]
|
| 1227 |
+
):
|
| 1228 |
+
return rule_id
|
| 1229 |
+
|
| 1230 |
+
start_ok = end_ok = False
|
| 1231 |
+
|
| 1232 |
+
if "from" in rule and seconds_past_midnight >= rule["from"]:
|
| 1233 |
+
start_ok = True
|
| 1234 |
+
if "to" in rule and seconds_past_midnight <= rule["to"]:
|
| 1235 |
+
# This rule type does not exist in the present CLDR data;
|
| 1236 |
+
# excuse the lack of test coverage.
|
| 1237 |
+
end_ok = True
|
| 1238 |
+
if "before" in rule and seconds_past_midnight < rule["before"]:
|
| 1239 |
+
end_ok = True
|
| 1240 |
+
if "after" in rule:
|
| 1241 |
+
raise NotImplementedError("'after' is deprecated as of CLDR 29.")
|
| 1242 |
+
|
| 1243 |
+
if start_ok and end_ok:
|
| 1244 |
+
return rule_id
|
| 1245 |
+
|
| 1246 |
+
if seconds_past_midnight < 43200:
|
| 1247 |
+
return "am"
|
| 1248 |
+
else:
|
| 1249 |
+
return "pm"
|
| 1250 |
+
|
| 1251 |
+
|
| 1252 |
+
class ParseError(ValueError):
|
| 1253 |
+
pass
|
| 1254 |
+
|
| 1255 |
+
|
| 1256 |
+
def parse_date(
|
| 1257 |
+
string: str,
|
| 1258 |
+
locale: Locale | str | None = None,
|
| 1259 |
+
format: _PredefinedTimeFormat | str = 'medium',
|
| 1260 |
+
) -> datetime.date:
|
| 1261 |
+
"""Parse a date from a string.
|
| 1262 |
+
|
| 1263 |
+
If an explicit format is provided, it is used to parse the date.
|
| 1264 |
+
|
| 1265 |
+
>>> parse_date('01.04.2004', format='dd.MM.yyyy')
|
| 1266 |
+
datetime.date(2004, 4, 1)
|
| 1267 |
+
|
| 1268 |
+
If no format is given, or if it is one of "full", "long", "medium",
|
| 1269 |
+
or "short", the function first tries to interpret the string as
|
| 1270 |
+
ISO-8601 date format and then uses the date format for the locale
|
| 1271 |
+
as a hint to determine the order in which the date fields appear in
|
| 1272 |
+
the string.
|
| 1273 |
+
|
| 1274 |
+
>>> parse_date('4/1/04', locale='en_US')
|
| 1275 |
+
datetime.date(2004, 4, 1)
|
| 1276 |
+
>>> parse_date('01.04.2004', locale='de_DE')
|
| 1277 |
+
datetime.date(2004, 4, 1)
|
| 1278 |
+
>>> parse_date('2004-04-01', locale='en_US')
|
| 1279 |
+
datetime.date(2004, 4, 1)
|
| 1280 |
+
>>> parse_date('2004-04-01', locale='de_DE')
|
| 1281 |
+
datetime.date(2004, 4, 1)
|
| 1282 |
+
>>> parse_date('01.04.04', locale='de_DE', format='short')
|
| 1283 |
+
datetime.date(2004, 4, 1)
|
| 1284 |
+
|
| 1285 |
+
:param string: the string containing the date
|
| 1286 |
+
:param locale: a `Locale` object or a locale identifier
|
| 1287 |
+
:param locale: a `Locale` object or a locale identifier. Defaults to the system time locale.
|
| 1288 |
+
:param format: the format to use, either an explicit date format,
|
| 1289 |
+
or one of "full", "long", "medium", or "short"
|
| 1290 |
+
(see ``get_time_format``)
|
| 1291 |
+
"""
|
| 1292 |
+
numbers = re.findall(r'(\d+)', string)
|
| 1293 |
+
if not numbers:
|
| 1294 |
+
raise ParseError("No numbers were found in input")
|
| 1295 |
+
|
| 1296 |
+
use_predefined_format = format in ('full', 'long', 'medium', 'short')
|
| 1297 |
+
# we try ISO-8601 format first, meaning similar to formats
|
| 1298 |
+
# extended YYYY-MM-DD or basic YYYYMMDD
|
| 1299 |
+
iso_alike = re.match(
|
| 1300 |
+
r'^(\d{4})-?([01]\d)-?([0-3]\d)$',
|
| 1301 |
+
string,
|
| 1302 |
+
flags=re.ASCII, # allow only ASCII digits
|
| 1303 |
+
)
|
| 1304 |
+
if iso_alike and use_predefined_format:
|
| 1305 |
+
try:
|
| 1306 |
+
return datetime.date(*map(int, iso_alike.groups()))
|
| 1307 |
+
except ValueError:
|
| 1308 |
+
pass # a locale format might fit better, so let's continue
|
| 1309 |
+
|
| 1310 |
+
if use_predefined_format:
|
| 1311 |
+
fmt = get_date_format(format=format, locale=locale)
|
| 1312 |
+
else:
|
| 1313 |
+
fmt = parse_pattern(format)
|
| 1314 |
+
format_str = fmt.pattern.lower()
|
| 1315 |
+
year_idx = format_str.index('y')
|
| 1316 |
+
month_idx = format_str.find('m')
|
| 1317 |
+
if month_idx < 0:
|
| 1318 |
+
month_idx = format_str.index('l')
|
| 1319 |
+
day_idx = format_str.index('d')
|
| 1320 |
+
|
| 1321 |
+
indexes = sorted([(year_idx, 'Y'), (month_idx, 'M'), (day_idx, 'D')])
|
| 1322 |
+
indexes = {item[1]: idx for idx, item in enumerate(indexes)}
|
| 1323 |
+
|
| 1324 |
+
# FIXME: this currently only supports numbers, but should also support month
|
| 1325 |
+
# names, both in the requested locale, and english
|
| 1326 |
+
|
| 1327 |
+
year = numbers[indexes['Y']]
|
| 1328 |
+
year = 2000 + int(year) if len(year) == 2 else int(year)
|
| 1329 |
+
month = int(numbers[indexes['M']])
|
| 1330 |
+
day = int(numbers[indexes['D']])
|
| 1331 |
+
if month > 12:
|
| 1332 |
+
month, day = day, month
|
| 1333 |
+
return datetime.date(year, month, day)
|
| 1334 |
+
|
| 1335 |
+
|
| 1336 |
+
def parse_time(
|
| 1337 |
+
string: str,
|
| 1338 |
+
locale: Locale | str | None = None,
|
| 1339 |
+
format: _PredefinedTimeFormat | str = 'medium',
|
| 1340 |
+
) -> datetime.time:
|
| 1341 |
+
"""Parse a time from a string.
|
| 1342 |
+
|
| 1343 |
+
This function uses the time format for the locale as a hint to determine
|
| 1344 |
+
the order in which the time fields appear in the string.
|
| 1345 |
+
|
| 1346 |
+
If an explicit format is provided, the function will use it to parse
|
| 1347 |
+
the time instead.
|
| 1348 |
+
|
| 1349 |
+
>>> parse_time('15:30:00', locale='en_US')
|
| 1350 |
+
datetime.time(15, 30)
|
| 1351 |
+
>>> parse_time('15:30:00', format='H:mm:ss')
|
| 1352 |
+
datetime.time(15, 30)
|
| 1353 |
+
|
| 1354 |
+
:param string: the string containing the time
|
| 1355 |
+
:param locale: a `Locale` object or a locale identifier. Defaults to the system time locale.
|
| 1356 |
+
:param format: the format to use, either an explicit time format,
|
| 1357 |
+
or one of "full", "long", "medium", or "short"
|
| 1358 |
+
(see ``get_time_format``)
|
| 1359 |
+
:return: the parsed time
|
| 1360 |
+
:rtype: `time`
|
| 1361 |
+
"""
|
| 1362 |
+
numbers = re.findall(r'(\d+)', string)
|
| 1363 |
+
if not numbers:
|
| 1364 |
+
raise ParseError("No numbers were found in input")
|
| 1365 |
+
|
| 1366 |
+
# TODO: try ISO format first?
|
| 1367 |
+
if format in ('full', 'long', 'medium', 'short'):
|
| 1368 |
+
fmt = get_time_format(format=format, locale=locale)
|
| 1369 |
+
else:
|
| 1370 |
+
fmt = parse_pattern(format)
|
| 1371 |
+
format_str = fmt.pattern.lower()
|
| 1372 |
+
hour_idx = format_str.find('h')
|
| 1373 |
+
if hour_idx < 0:
|
| 1374 |
+
hour_idx = format_str.index('k')
|
| 1375 |
+
min_idx = format_str.index('m')
|
| 1376 |
+
# format might not contain seconds
|
| 1377 |
+
if (sec_idx := format_str.find('s')) < 0:
|
| 1378 |
+
sec_idx = math.inf
|
| 1379 |
+
|
| 1380 |
+
indexes = sorted([(hour_idx, 'H'), (min_idx, 'M'), (sec_idx, 'S')])
|
| 1381 |
+
indexes = {item[1]: idx for idx, item in enumerate(indexes)}
|
| 1382 |
+
|
| 1383 |
+
# TODO: support time zones
|
| 1384 |
+
|
| 1385 |
+
# Check if the format specifies a period to be used;
|
| 1386 |
+
# if it does, look for 'pm' to figure out an offset.
|
| 1387 |
+
hour_offset = 0
|
| 1388 |
+
if 'a' in format_str and 'pm' in string.lower():
|
| 1389 |
+
hour_offset = 12
|
| 1390 |
+
|
| 1391 |
+
# Parse up to three numbers from the string.
|
| 1392 |
+
minute = second = 0
|
| 1393 |
+
hour = int(numbers[indexes['H']]) + hour_offset
|
| 1394 |
+
if len(numbers) > 1:
|
| 1395 |
+
minute = int(numbers[indexes['M']])
|
| 1396 |
+
if len(numbers) > 2:
|
| 1397 |
+
second = int(numbers[indexes['S']])
|
| 1398 |
+
return datetime.time(hour, minute, second)
|
| 1399 |
+
|
| 1400 |
+
|
| 1401 |
+
class DateTimePattern:
|
| 1402 |
+
def __init__(self, pattern: str, format: DateTimeFormat):
|
| 1403 |
+
self.pattern = pattern
|
| 1404 |
+
self.format = format
|
| 1405 |
+
|
| 1406 |
+
def __repr__(self) -> str:
|
| 1407 |
+
return f"<{type(self).__name__} {self.pattern!r}>"
|
| 1408 |
+
|
| 1409 |
+
def __str__(self) -> str:
|
| 1410 |
+
pat = self.pattern
|
| 1411 |
+
return pat
|
| 1412 |
+
|
| 1413 |
+
def __mod__(self, other: DateTimeFormat) -> str:
|
| 1414 |
+
if not isinstance(other, DateTimeFormat):
|
| 1415 |
+
return NotImplemented
|
| 1416 |
+
return self.format % other
|
| 1417 |
+
|
| 1418 |
+
def apply(
|
| 1419 |
+
self,
|
| 1420 |
+
datetime: datetime.date | datetime.time,
|
| 1421 |
+
locale: Locale | str | None,
|
| 1422 |
+
reference_date: datetime.date | None = None,
|
| 1423 |
+
) -> str:
|
| 1424 |
+
return self % DateTimeFormat(datetime, locale, reference_date)
|
| 1425 |
+
|
| 1426 |
+
|
| 1427 |
+
class DateTimeFormat:
|
| 1428 |
+
def __init__(
|
| 1429 |
+
self,
|
| 1430 |
+
value: datetime.date | datetime.time,
|
| 1431 |
+
locale: Locale | str,
|
| 1432 |
+
reference_date: datetime.date | None = None,
|
| 1433 |
+
) -> None:
|
| 1434 |
+
assert isinstance(value, (datetime.date, datetime.datetime, datetime.time))
|
| 1435 |
+
if isinstance(value, (datetime.datetime, datetime.time)) and value.tzinfo is None:
|
| 1436 |
+
value = value.replace(tzinfo=UTC)
|
| 1437 |
+
self.value = value
|
| 1438 |
+
self.locale = Locale.parse(locale)
|
| 1439 |
+
self.reference_date = reference_date
|
| 1440 |
+
|
| 1441 |
+
def __getitem__(self, name: str) -> str:
|
| 1442 |
+
char = name[0]
|
| 1443 |
+
num = len(name)
|
| 1444 |
+
if char == 'G':
|
| 1445 |
+
return self.format_era(char, num)
|
| 1446 |
+
elif char in ('y', 'Y', 'u'):
|
| 1447 |
+
return self.format_year(char, num)
|
| 1448 |
+
elif char in ('Q', 'q'):
|
| 1449 |
+
return self.format_quarter(char, num)
|
| 1450 |
+
elif char in ('M', 'L'):
|
| 1451 |
+
return self.format_month(char, num)
|
| 1452 |
+
elif char in ('w', 'W'):
|
| 1453 |
+
return self.format_week(char, num)
|
| 1454 |
+
elif char == 'd':
|
| 1455 |
+
return self.format(self.value.day, num)
|
| 1456 |
+
elif char == 'D':
|
| 1457 |
+
return self.format_day_of_year(num)
|
| 1458 |
+
elif char == 'F':
|
| 1459 |
+
return self.format_day_of_week_in_month()
|
| 1460 |
+
elif char in ('E', 'e', 'c'):
|
| 1461 |
+
return self.format_weekday(char, num)
|
| 1462 |
+
elif char in ('a', 'b', 'B'):
|
| 1463 |
+
return self.format_period(char, num)
|
| 1464 |
+
elif char == 'h':
|
| 1465 |
+
if self.value.hour % 12 == 0:
|
| 1466 |
+
return self.format(12, num)
|
| 1467 |
+
else:
|
| 1468 |
+
return self.format(self.value.hour % 12, num)
|
| 1469 |
+
elif char == 'H':
|
| 1470 |
+
return self.format(self.value.hour, num)
|
| 1471 |
+
elif char == 'K':
|
| 1472 |
+
return self.format(self.value.hour % 12, num)
|
| 1473 |
+
elif char == 'k':
|
| 1474 |
+
if self.value.hour == 0:
|
| 1475 |
+
return self.format(24, num)
|
| 1476 |
+
else:
|
| 1477 |
+
return self.format(self.value.hour, num)
|
| 1478 |
+
elif char == 'm':
|
| 1479 |
+
return self.format(self.value.minute, num)
|
| 1480 |
+
elif char == 's':
|
| 1481 |
+
return self.format(self.value.second, num)
|
| 1482 |
+
elif char == 'S':
|
| 1483 |
+
return self.format_frac_seconds(num)
|
| 1484 |
+
elif char == 'A':
|
| 1485 |
+
return self.format_milliseconds_in_day(num)
|
| 1486 |
+
elif char in ('z', 'Z', 'v', 'V', 'x', 'X', 'O'):
|
| 1487 |
+
return self.format_timezone(char, num)
|
| 1488 |
+
else:
|
| 1489 |
+
raise KeyError(f"Unsupported date/time field {char!r}")
|
| 1490 |
+
|
| 1491 |
+
def extract(self, char: str) -> int:
|
| 1492 |
+
char = str(char)[0]
|
| 1493 |
+
if char == 'y':
|
| 1494 |
+
return self.value.year
|
| 1495 |
+
elif char == 'M':
|
| 1496 |
+
return self.value.month
|
| 1497 |
+
elif char == 'd':
|
| 1498 |
+
return self.value.day
|
| 1499 |
+
elif char == 'H':
|
| 1500 |
+
return self.value.hour
|
| 1501 |
+
elif char == 'h':
|
| 1502 |
+
return self.value.hour % 12 or 12
|
| 1503 |
+
elif char == 'm':
|
| 1504 |
+
return self.value.minute
|
| 1505 |
+
elif char == 'a':
|
| 1506 |
+
return int(self.value.hour >= 12) # 0 for am, 1 for pm
|
| 1507 |
+
else:
|
| 1508 |
+
raise NotImplementedError(
|
| 1509 |
+
f"Not implemented: extracting {char!r} from {self.value!r}",
|
| 1510 |
+
)
|
| 1511 |
+
|
| 1512 |
+
def format_era(self, char: str, num: int) -> str:
|
| 1513 |
+
width = {3: 'abbreviated', 4: 'wide', 5: 'narrow'}[max(3, num)]
|
| 1514 |
+
era = int(self.value.year >= 0)
|
| 1515 |
+
return get_era_names(width, self.locale)[era]
|
| 1516 |
+
|
| 1517 |
+
def format_year(self, char: str, num: int) -> str:
|
| 1518 |
+
value = self.value.year
|
| 1519 |
+
if char.isupper():
|
| 1520 |
+
month = self.value.month
|
| 1521 |
+
if month == 1 and self.value.day < 7 and self.get_week_of_year() >= 52:
|
| 1522 |
+
value -= 1
|
| 1523 |
+
elif month == 12 and self.value.day > 25 and self.get_week_of_year() <= 2:
|
| 1524 |
+
value += 1
|
| 1525 |
+
year = self.format(value, num)
|
| 1526 |
+
if num == 2:
|
| 1527 |
+
year = year[-2:]
|
| 1528 |
+
return year
|
| 1529 |
+
|
| 1530 |
+
def format_quarter(self, char: str, num: int) -> str:
|
| 1531 |
+
quarter = (self.value.month - 1) // 3 + 1
|
| 1532 |
+
if num <= 2:
|
| 1533 |
+
return '%0*d' % (num, quarter)
|
| 1534 |
+
width = {3: 'abbreviated', 4: 'wide', 5: 'narrow'}[num]
|
| 1535 |
+
context = {'Q': 'format', 'q': 'stand-alone'}[char]
|
| 1536 |
+
return get_quarter_names(width, context, self.locale)[quarter]
|
| 1537 |
+
|
| 1538 |
+
def format_month(self, char: str, num: int) -> str:
|
| 1539 |
+
if num <= 2:
|
| 1540 |
+
return '%0*d' % (num, self.value.month)
|
| 1541 |
+
width = {3: 'abbreviated', 4: 'wide', 5: 'narrow'}[num]
|
| 1542 |
+
context = {'M': 'format', 'L': 'stand-alone'}[char]
|
| 1543 |
+
return get_month_names(width, context, self.locale)[self.value.month]
|
| 1544 |
+
|
| 1545 |
+
def format_week(self, char: str, num: int) -> str:
|
| 1546 |
+
if char.islower(): # week of year
|
| 1547 |
+
week = self.get_week_of_year()
|
| 1548 |
+
return self.format(week, num)
|
| 1549 |
+
else: # week of month
|
| 1550 |
+
week = self.get_week_of_month()
|
| 1551 |
+
return str(week)
|
| 1552 |
+
|
| 1553 |
+
def format_weekday(self, char: str = 'E', num: int = 4) -> str:
|
| 1554 |
+
"""
|
| 1555 |
+
Return weekday from parsed datetime according to format pattern.
|
| 1556 |
+
|
| 1557 |
+
>>> from datetime import date
|
| 1558 |
+
>>> format = DateTimeFormat(date(2016, 2, 28), Locale.parse('en_US'))
|
| 1559 |
+
>>> format.format_weekday()
|
| 1560 |
+
'Sunday'
|
| 1561 |
+
|
| 1562 |
+
'E': Day of week - Use one through three letters for the abbreviated day name, four for the full (wide) name,
|
| 1563 |
+
five for the narrow name, or six for the short name.
|
| 1564 |
+
>>> format.format_weekday('E',2)
|
| 1565 |
+
'Sun'
|
| 1566 |
+
|
| 1567 |
+
'e': Local day of week. Same as E except adds a numeric value that will depend on the local starting day of the
|
| 1568 |
+
week, using one or two letters. For this example, Monday is the first day of the week.
|
| 1569 |
+
>>> format.format_weekday('e',2)
|
| 1570 |
+
'01'
|
| 1571 |
+
|
| 1572 |
+
'c': Stand-Alone local day of week - Use one letter for the local numeric value (same as 'e'), three for the
|
| 1573 |
+
abbreviated day name, four for the full (wide) name, five for the narrow name, or six for the short name.
|
| 1574 |
+
>>> format.format_weekday('c',1)
|
| 1575 |
+
'1'
|
| 1576 |
+
|
| 1577 |
+
:param char: pattern format character ('e','E','c')
|
| 1578 |
+
:param num: count of format character
|
| 1579 |
+
|
| 1580 |
+
"""
|
| 1581 |
+
if num < 3:
|
| 1582 |
+
if char.islower():
|
| 1583 |
+
value = 7 - self.locale.first_week_day + self.value.weekday()
|
| 1584 |
+
return self.format(value % 7 + 1, num)
|
| 1585 |
+
num = 3
|
| 1586 |
+
weekday = self.value.weekday()
|
| 1587 |
+
width = {3: 'abbreviated', 4: 'wide', 5: 'narrow', 6: 'short'}[num]
|
| 1588 |
+
context = "stand-alone" if char == "c" else "format"
|
| 1589 |
+
return get_day_names(width, context, self.locale)[weekday]
|
| 1590 |
+
|
| 1591 |
+
def format_day_of_year(self, num: int) -> str:
|
| 1592 |
+
return self.format(self.get_day_of_year(), num)
|
| 1593 |
+
|
| 1594 |
+
def format_day_of_week_in_month(self) -> str:
|
| 1595 |
+
return str((self.value.day - 1) // 7 + 1)
|
| 1596 |
+
|
| 1597 |
+
def format_period(self, char: str, num: int) -> str:
|
| 1598 |
+
"""
|
| 1599 |
+
Return period from parsed datetime according to format pattern.
|
| 1600 |
+
|
| 1601 |
+
>>> from datetime import datetime, time
|
| 1602 |
+
>>> format = DateTimeFormat(time(13, 42), 'fi_FI')
|
| 1603 |
+
>>> format.format_period('a', 1)
|
| 1604 |
+
'ip.'
|
| 1605 |
+
>>> format.format_period('b', 1)
|
| 1606 |
+
'iltap.'
|
| 1607 |
+
>>> format.format_period('b', 4)
|
| 1608 |
+
'iltapäivä'
|
| 1609 |
+
>>> format.format_period('B', 4)
|
| 1610 |
+
'iltapäivällä'
|
| 1611 |
+
>>> format.format_period('B', 5)
|
| 1612 |
+
'ip.'
|
| 1613 |
+
|
| 1614 |
+
>>> format = DateTimeFormat(datetime(2022, 4, 28, 6, 27), 'zh_Hant')
|
| 1615 |
+
>>> format.format_period('a', 1)
|
| 1616 |
+
'上午'
|
| 1617 |
+
>>> format.format_period('B', 1)
|
| 1618 |
+
'清晨'
|
| 1619 |
+
|
| 1620 |
+
:param char: pattern format character ('a', 'b', 'B')
|
| 1621 |
+
:param num: count of format character
|
| 1622 |
+
|
| 1623 |
+
"""
|
| 1624 |
+
widths = [
|
| 1625 |
+
{3: 'abbreviated', 4: 'wide', 5: 'narrow'}[max(3, num)],
|
| 1626 |
+
'wide',
|
| 1627 |
+
'narrow',
|
| 1628 |
+
'abbreviated',
|
| 1629 |
+
]
|
| 1630 |
+
if char == 'a':
|
| 1631 |
+
period = 'pm' if self.value.hour >= 12 else 'am'
|
| 1632 |
+
context = 'format'
|
| 1633 |
+
else:
|
| 1634 |
+
period = get_period_id(self.value, locale=self.locale)
|
| 1635 |
+
context = 'format' if char == 'B' else 'stand-alone'
|
| 1636 |
+
for width in widths:
|
| 1637 |
+
period_names = get_period_names(context=context, width=width, locale=self.locale)
|
| 1638 |
+
if period in period_names:
|
| 1639 |
+
return period_names[period]
|
| 1640 |
+
raise ValueError(f"Could not format period {period} in {self.locale}")
|
| 1641 |
+
|
| 1642 |
+
def format_frac_seconds(self, num: int) -> str:
|
| 1643 |
+
""" Return fractional seconds.
|
| 1644 |
+
|
| 1645 |
+
Rounds the time's microseconds to the precision given by the number \
|
| 1646 |
+
of digits passed in.
|
| 1647 |
+
"""
|
| 1648 |
+
value = self.value.microsecond / 1000000
|
| 1649 |
+
return self.format(round(value, num) * 10**num, num)
|
| 1650 |
+
|
| 1651 |
+
def format_milliseconds_in_day(self, num):
|
| 1652 |
+
msecs = (
|
| 1653 |
+
self.value.microsecond // 1000
|
| 1654 |
+
+ self.value.second * 1000
|
| 1655 |
+
+ self.value.minute * 60000
|
| 1656 |
+
+ self.value.hour * 3600000
|
| 1657 |
+
)
|
| 1658 |
+
return self.format(msecs, num)
|
| 1659 |
+
|
| 1660 |
+
def format_timezone(self, char: str, num: int) -> str:
|
| 1661 |
+
width = {3: 'short', 4: 'long', 5: 'iso8601'}[max(3, num)]
|
| 1662 |
+
|
| 1663 |
+
# It could be that we only receive a time to format, but also have a
|
| 1664 |
+
# reference date which is important to distinguish between timezone
|
| 1665 |
+
# variants (summer/standard time)
|
| 1666 |
+
value = self.value
|
| 1667 |
+
if self.reference_date:
|
| 1668 |
+
value = datetime.datetime.combine(self.reference_date, self.value)
|
| 1669 |
+
|
| 1670 |
+
if char == 'z':
|
| 1671 |
+
return get_timezone_name(value, width, locale=self.locale)
|
| 1672 |
+
elif char == 'Z':
|
| 1673 |
+
if num == 5:
|
| 1674 |
+
return get_timezone_gmt(value, width, locale=self.locale, return_z=True)
|
| 1675 |
+
return get_timezone_gmt(value, width, locale=self.locale)
|
| 1676 |
+
elif char == 'O':
|
| 1677 |
+
if num == 4:
|
| 1678 |
+
return get_timezone_gmt(value, width, locale=self.locale)
|
| 1679 |
+
# TODO: To add support for O:1
|
| 1680 |
+
elif char == 'v':
|
| 1681 |
+
return get_timezone_name(value.tzinfo, width, locale=self.locale)
|
| 1682 |
+
elif char == 'V':
|
| 1683 |
+
if num == 1:
|
| 1684 |
+
return get_timezone_name(value.tzinfo, width, locale=self.locale)
|
| 1685 |
+
elif num == 2:
|
| 1686 |
+
return get_timezone_name(value.tzinfo, locale=self.locale, return_zone=True)
|
| 1687 |
+
elif num == 3:
|
| 1688 |
+
return get_timezone_location(value.tzinfo, locale=self.locale, return_city=True) # fmt: skip
|
| 1689 |
+
return get_timezone_location(value.tzinfo, locale=self.locale)
|
| 1690 |
+
elif char in 'Xx':
|
| 1691 |
+
return_z = char == 'X'
|
| 1692 |
+
if num == 1:
|
| 1693 |
+
width = 'iso8601_short'
|
| 1694 |
+
elif num in (2, 4):
|
| 1695 |
+
width = 'short'
|
| 1696 |
+
elif num in (3, 5):
|
| 1697 |
+
width = 'iso8601'
|
| 1698 |
+
return get_timezone_gmt(value, width=width, locale=self.locale, return_z=return_z) # fmt: skip
|
| 1699 |
+
|
| 1700 |
+
def format(self, value: SupportsInt, length: int) -> str:
|
| 1701 |
+
return '%0*d' % (length, value)
|
| 1702 |
+
|
| 1703 |
+
def get_day_of_year(self, date: datetime.date | None = None) -> int:
|
| 1704 |
+
if date is None:
|
| 1705 |
+
date = self.value
|
| 1706 |
+
return (date - date.replace(month=1, day=1)).days + 1
|
| 1707 |
+
|
| 1708 |
+
def get_week_of_year(self) -> int:
|
| 1709 |
+
"""Return the week of the year."""
|
| 1710 |
+
day_of_year = self.get_day_of_year(self.value)
|
| 1711 |
+
week = self.get_week_number(day_of_year)
|
| 1712 |
+
if week == 0:
|
| 1713 |
+
date = datetime.date(self.value.year - 1, 12, 31)
|
| 1714 |
+
week = self.get_week_number(self.get_day_of_year(date), date.weekday())
|
| 1715 |
+
elif week > 52:
|
| 1716 |
+
weekday = datetime.date(self.value.year + 1, 1, 1).weekday()
|
| 1717 |
+
if (
|
| 1718 |
+
self.get_week_number(1, weekday) == 1
|
| 1719 |
+
and 32 - (weekday - self.locale.first_week_day) % 7 <= self.value.day
|
| 1720 |
+
):
|
| 1721 |
+
week = 1
|
| 1722 |
+
return week
|
| 1723 |
+
|
| 1724 |
+
def get_week_of_month(self) -> int:
|
| 1725 |
+
"""Return the week of the month."""
|
| 1726 |
+
return self.get_week_number(self.value.day)
|
| 1727 |
+
|
| 1728 |
+
def get_week_number(self, day_of_period: int, day_of_week: int | None = None) -> int:
|
| 1729 |
+
"""Return the number of the week of a day within a period. This may be
|
| 1730 |
+
the week number in a year or the week number in a month.
|
| 1731 |
+
|
| 1732 |
+
Usually this will return a value equal to or greater than 1, but if the
|
| 1733 |
+
first week of the period is so short that it actually counts as the last
|
| 1734 |
+
week of the previous period, this function will return 0.
|
| 1735 |
+
|
| 1736 |
+
>>> date = datetime.date(2006, 1, 8)
|
| 1737 |
+
>>> DateTimeFormat(date, 'de_DE').get_week_number(6)
|
| 1738 |
+
1
|
| 1739 |
+
>>> DateTimeFormat(date, 'en_US').get_week_number(6)
|
| 1740 |
+
2
|
| 1741 |
+
|
| 1742 |
+
:param day_of_period: the number of the day in the period (usually
|
| 1743 |
+
either the day of month or the day of year)
|
| 1744 |
+
:param day_of_week: the week day; if omitted, the week day of the
|
| 1745 |
+
current date is assumed
|
| 1746 |
+
"""
|
| 1747 |
+
if day_of_week is None:
|
| 1748 |
+
day_of_week = self.value.weekday()
|
| 1749 |
+
first_day = (day_of_week - self.locale.first_week_day - day_of_period + 1) % 7
|
| 1750 |
+
if first_day < 0:
|
| 1751 |
+
first_day += 7
|
| 1752 |
+
week_number = (day_of_period + first_day - 1) // 7
|
| 1753 |
+
if 7 - first_day >= self.locale.min_week_days:
|
| 1754 |
+
week_number += 1
|
| 1755 |
+
return week_number
|
| 1756 |
+
|
| 1757 |
+
|
| 1758 |
+
PATTERN_CHARS: dict[str, list[int] | None] = {
|
| 1759 |
+
'G': [1, 2, 3, 4, 5], # era
|
| 1760 |
+
'y': None, 'Y': None, 'u': None, # year
|
| 1761 |
+
'Q': [1, 2, 3, 4, 5], 'q': [1, 2, 3, 4, 5], # quarter
|
| 1762 |
+
'M': [1, 2, 3, 4, 5], 'L': [1, 2, 3, 4, 5], # month
|
| 1763 |
+
'w': [1, 2], 'W': [1], # week
|
| 1764 |
+
'd': [1, 2], 'D': [1, 2, 3], 'F': [1], 'g': None, # day
|
| 1765 |
+
'E': [1, 2, 3, 4, 5, 6], 'e': [1, 2, 3, 4, 5, 6], 'c': [1, 3, 4, 5, 6], # week day
|
| 1766 |
+
'a': [1, 2, 3, 4, 5], 'b': [1, 2, 3, 4, 5], 'B': [1, 2, 3, 4, 5], # period
|
| 1767 |
+
'h': [1, 2], 'H': [1, 2], 'K': [1, 2], 'k': [1, 2], # hour
|
| 1768 |
+
'm': [1, 2], # minute
|
| 1769 |
+
's': [1, 2], 'S': None, 'A': None, # second
|
| 1770 |
+
'z': [1, 2, 3, 4], 'Z': [1, 2, 3, 4, 5], 'O': [1, 4], 'v': [1, 4], # zone
|
| 1771 |
+
'V': [1, 2, 3, 4], 'x': [1, 2, 3, 4, 5], 'X': [1, 2, 3, 4, 5], # zone
|
| 1772 |
+
} # fmt: skip
|
| 1773 |
+
|
| 1774 |
+
#: The pattern characters declared in the Date Field Symbol Table
|
| 1775 |
+
#: (https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table)
|
| 1776 |
+
#: in order of decreasing magnitude.
|
| 1777 |
+
PATTERN_CHAR_ORDER = "GyYuUQqMLlwWdDFgEecabBChHKkjJmsSAzZOvVXx"
|
| 1778 |
+
|
| 1779 |
+
|
| 1780 |
+
def parse_pattern(pattern: str | DateTimePattern) -> DateTimePattern:
|
| 1781 |
+
"""Parse date, time, and datetime format patterns.
|
| 1782 |
+
|
| 1783 |
+
>>> parse_pattern("MMMMd").format
|
| 1784 |
+
'%(MMMM)s%(d)s'
|
| 1785 |
+
>>> parse_pattern("MMM d, yyyy").format
|
| 1786 |
+
'%(MMM)s %(d)s, %(yyyy)s'
|
| 1787 |
+
|
| 1788 |
+
Pattern can contain literal strings in single quotes:
|
| 1789 |
+
|
| 1790 |
+
>>> parse_pattern("H:mm' Uhr 'z").format
|
| 1791 |
+
'%(H)s:%(mm)s Uhr %(z)s'
|
| 1792 |
+
|
| 1793 |
+
An actual single quote can be used by using two adjacent single quote
|
| 1794 |
+
characters:
|
| 1795 |
+
|
| 1796 |
+
>>> parse_pattern("hh' o''clock'").format
|
| 1797 |
+
"%(hh)s o'clock"
|
| 1798 |
+
|
| 1799 |
+
:param pattern: the formatting pattern to parse
|
| 1800 |
+
"""
|
| 1801 |
+
if isinstance(pattern, DateTimePattern):
|
| 1802 |
+
return pattern
|
| 1803 |
+
return _cached_parse_pattern(pattern)
|
| 1804 |
+
|
| 1805 |
+
|
| 1806 |
+
@lru_cache(maxsize=1024)
|
| 1807 |
+
def _cached_parse_pattern(pattern: str) -> DateTimePattern:
|
| 1808 |
+
result = []
|
| 1809 |
+
|
| 1810 |
+
for tok_type, tok_value in tokenize_pattern(pattern):
|
| 1811 |
+
if tok_type == "chars":
|
| 1812 |
+
result.append(tok_value.replace('%', '%%'))
|
| 1813 |
+
elif tok_type == "field":
|
| 1814 |
+
fieldchar, fieldnum = tok_value
|
| 1815 |
+
limit = PATTERN_CHARS[fieldchar]
|
| 1816 |
+
if limit and fieldnum not in limit:
|
| 1817 |
+
raise ValueError(f"Invalid length for field: {fieldchar * fieldnum!r}")
|
| 1818 |
+
result.append('%%(%s)s' % (fieldchar * fieldnum))
|
| 1819 |
+
else:
|
| 1820 |
+
raise NotImplementedError(f"Unknown token type: {tok_type}")
|
| 1821 |
+
return DateTimePattern(pattern, ''.join(result))
|
| 1822 |
+
|
| 1823 |
+
|
| 1824 |
+
def tokenize_pattern(pattern: str) -> list[tuple[str, str | tuple[str, int]]]:
|
| 1825 |
+
"""
|
| 1826 |
+
Tokenize date format patterns.
|
| 1827 |
+
|
| 1828 |
+
Returns a list of (token_type, token_value) tuples.
|
| 1829 |
+
|
| 1830 |
+
``token_type`` may be either "chars" or "field".
|
| 1831 |
+
|
| 1832 |
+
For "chars" tokens, the value is the literal value.
|
| 1833 |
+
|
| 1834 |
+
For "field" tokens, the value is a tuple of (field character, repetition count).
|
| 1835 |
+
|
| 1836 |
+
:param pattern: Pattern string
|
| 1837 |
+
:type pattern: str
|
| 1838 |
+
:rtype: list[tuple]
|
| 1839 |
+
"""
|
| 1840 |
+
result = []
|
| 1841 |
+
quotebuf = None
|
| 1842 |
+
charbuf = []
|
| 1843 |
+
fieldchar = ['']
|
| 1844 |
+
fieldnum = [0]
|
| 1845 |
+
|
| 1846 |
+
def append_chars():
|
| 1847 |
+
result.append(('chars', ''.join(charbuf).replace('\0', "'")))
|
| 1848 |
+
del charbuf[:]
|
| 1849 |
+
|
| 1850 |
+
def append_field():
|
| 1851 |
+
result.append(('field', (fieldchar[0], fieldnum[0])))
|
| 1852 |
+
fieldchar[0] = ''
|
| 1853 |
+
fieldnum[0] = 0
|
| 1854 |
+
|
| 1855 |
+
for char in pattern.replace("''", '\0'):
|
| 1856 |
+
if quotebuf is None:
|
| 1857 |
+
if char == "'": # quote started
|
| 1858 |
+
if fieldchar[0]:
|
| 1859 |
+
append_field()
|
| 1860 |
+
elif charbuf:
|
| 1861 |
+
append_chars()
|
| 1862 |
+
quotebuf = []
|
| 1863 |
+
elif char in PATTERN_CHARS:
|
| 1864 |
+
if charbuf:
|
| 1865 |
+
append_chars()
|
| 1866 |
+
if char == fieldchar[0]:
|
| 1867 |
+
fieldnum[0] += 1
|
| 1868 |
+
else:
|
| 1869 |
+
if fieldchar[0]:
|
| 1870 |
+
append_field()
|
| 1871 |
+
fieldchar[0] = char
|
| 1872 |
+
fieldnum[0] = 1
|
| 1873 |
+
else:
|
| 1874 |
+
if fieldchar[0]:
|
| 1875 |
+
append_field()
|
| 1876 |
+
charbuf.append(char)
|
| 1877 |
+
|
| 1878 |
+
elif quotebuf is not None:
|
| 1879 |
+
if char == "'": # end of quote
|
| 1880 |
+
charbuf.extend(quotebuf)
|
| 1881 |
+
quotebuf = None
|
| 1882 |
+
else: # inside quote
|
| 1883 |
+
quotebuf.append(char)
|
| 1884 |
+
|
| 1885 |
+
if fieldchar[0]:
|
| 1886 |
+
append_field()
|
| 1887 |
+
elif charbuf:
|
| 1888 |
+
append_chars()
|
| 1889 |
+
|
| 1890 |
+
return result
|
| 1891 |
+
|
| 1892 |
+
|
| 1893 |
+
def untokenize_pattern(tokens: Iterable[tuple[str, str | tuple[str, int]]]) -> str:
|
| 1894 |
+
"""
|
| 1895 |
+
Turn a date format pattern token stream back into a string.
|
| 1896 |
+
|
| 1897 |
+
This is the reverse operation of ``tokenize_pattern``.
|
| 1898 |
+
|
| 1899 |
+
:type tokens: Iterable[tuple]
|
| 1900 |
+
:rtype: str
|
| 1901 |
+
"""
|
| 1902 |
+
output = []
|
| 1903 |
+
for tok_type, tok_value in tokens:
|
| 1904 |
+
if tok_type == "field":
|
| 1905 |
+
output.append(tok_value[0] * tok_value[1])
|
| 1906 |
+
elif tok_type == "chars":
|
| 1907 |
+
if not any(ch in PATTERN_CHARS for ch in tok_value): # No need to quote
|
| 1908 |
+
output.append(tok_value)
|
| 1909 |
+
else:
|
| 1910 |
+
output.append("'%s'" % tok_value.replace("'", "''"))
|
| 1911 |
+
return "".join(output)
|
| 1912 |
+
|
| 1913 |
+
|
| 1914 |
+
def split_interval_pattern(pattern: str) -> list[str]:
|
| 1915 |
+
"""
|
| 1916 |
+
Split an interval-describing datetime pattern into multiple pieces.
|
| 1917 |
+
|
| 1918 |
+
> The pattern is then designed to be broken up into two pieces by determining the first repeating field.
|
| 1919 |
+
- https://www.unicode.org/reports/tr35/tr35-dates.html#intervalFormats
|
| 1920 |
+
|
| 1921 |
+
>>> split_interval_pattern('E d.M. – E d.M.')
|
| 1922 |
+
['E d.M. – ', 'E d.M.']
|
| 1923 |
+
>>> split_interval_pattern("Y 'text' Y 'more text'")
|
| 1924 |
+
["Y 'text '", "Y 'more text'"]
|
| 1925 |
+
>>> split_interval_pattern('E, MMM d – E')
|
| 1926 |
+
['E, MMM d – ', 'E']
|
| 1927 |
+
>>> split_interval_pattern("MMM d")
|
| 1928 |
+
['MMM d']
|
| 1929 |
+
>>> split_interval_pattern("y G")
|
| 1930 |
+
['y G']
|
| 1931 |
+
>>> split_interval_pattern('MMM d – d')
|
| 1932 |
+
['MMM d – ', 'd']
|
| 1933 |
+
|
| 1934 |
+
:param pattern: Interval pattern string
|
| 1935 |
+
:return: list of "subpatterns"
|
| 1936 |
+
"""
|
| 1937 |
+
|
| 1938 |
+
seen_fields = set()
|
| 1939 |
+
parts = [[]]
|
| 1940 |
+
|
| 1941 |
+
for tok_type, tok_value in tokenize_pattern(pattern):
|
| 1942 |
+
if tok_type == "field":
|
| 1943 |
+
if tok_value[0] in seen_fields: # Repeated field
|
| 1944 |
+
parts.append([])
|
| 1945 |
+
seen_fields.clear()
|
| 1946 |
+
seen_fields.add(tok_value[0])
|
| 1947 |
+
parts[-1].append((tok_type, tok_value))
|
| 1948 |
+
|
| 1949 |
+
return [untokenize_pattern(tokens) for tokens in parts]
|
| 1950 |
+
|
| 1951 |
+
|
| 1952 |
+
def match_skeleton(
|
| 1953 |
+
skeleton: str,
|
| 1954 |
+
options: Iterable[str],
|
| 1955 |
+
allow_different_fields: bool = False,
|
| 1956 |
+
) -> str | None:
|
| 1957 |
+
"""
|
| 1958 |
+
Find the closest match for the given datetime skeleton among the options given.
|
| 1959 |
+
|
| 1960 |
+
This uses the rules outlined in the TR35 document.
|
| 1961 |
+
|
| 1962 |
+
>>> match_skeleton('yMMd', ('yMd', 'yMMMd'))
|
| 1963 |
+
'yMd'
|
| 1964 |
+
|
| 1965 |
+
>>> match_skeleton('yMMd', ('jyMMd',), allow_different_fields=True)
|
| 1966 |
+
'jyMMd'
|
| 1967 |
+
|
| 1968 |
+
>>> match_skeleton('yMMd', ('qyMMd',), allow_different_fields=False)
|
| 1969 |
+
|
| 1970 |
+
>>> match_skeleton('hmz', ('hmv',))
|
| 1971 |
+
'hmv'
|
| 1972 |
+
|
| 1973 |
+
:param skeleton: The skeleton to match
|
| 1974 |
+
:type skeleton: str
|
| 1975 |
+
:param options: An iterable of other skeletons to match against
|
| 1976 |
+
:type options: Iterable[str]
|
| 1977 |
+
:param allow_different_fields: Whether to allow a match that uses different fields
|
| 1978 |
+
than the skeleton requested.
|
| 1979 |
+
:type allow_different_fields: bool
|
| 1980 |
+
|
| 1981 |
+
:return: The closest skeleton match, or if no match was found, None.
|
| 1982 |
+
:rtype: str|None
|
| 1983 |
+
"""
|
| 1984 |
+
|
| 1985 |
+
# TODO: maybe implement pattern expansion?
|
| 1986 |
+
|
| 1987 |
+
# Based on the implementation in
|
| 1988 |
+
# https://github.com/unicode-org/icu/blob/main/icu4j/main/core/src/main/java/com/ibm/icu/text/DateIntervalInfo.java
|
| 1989 |
+
|
| 1990 |
+
# Filter out falsy values and sort for stability; when `interval_formats` is passed in, there may be a None key.
|
| 1991 |
+
options = sorted(option for option in options if option)
|
| 1992 |
+
|
| 1993 |
+
if 'z' in skeleton and not any('z' in option for option in options):
|
| 1994 |
+
skeleton = skeleton.replace('z', 'v')
|
| 1995 |
+
if 'k' in skeleton and not any('k' in option for option in options):
|
| 1996 |
+
skeleton = skeleton.replace('k', 'H')
|
| 1997 |
+
if 'K' in skeleton and not any('K' in option for option in options):
|
| 1998 |
+
skeleton = skeleton.replace('K', 'h')
|
| 1999 |
+
if 'a' in skeleton and not any('a' in option for option in options):
|
| 2000 |
+
skeleton = skeleton.replace('a', '')
|
| 2001 |
+
if 'b' in skeleton and not any('b' in option for option in options):
|
| 2002 |
+
skeleton = skeleton.replace('b', '')
|
| 2003 |
+
|
| 2004 |
+
get_input_field_width = dict(t[1] for t in tokenize_pattern(skeleton) if t[0] == "field").get # fmt: skip
|
| 2005 |
+
best_skeleton = None
|
| 2006 |
+
best_distance = None
|
| 2007 |
+
for option in options:
|
| 2008 |
+
get_opt_field_width = dict(t[1] for t in tokenize_pattern(option) if t[0] == "field").get # fmt: skip
|
| 2009 |
+
distance = 0
|
| 2010 |
+
for field in PATTERN_CHARS:
|
| 2011 |
+
input_width = get_input_field_width(field, 0)
|
| 2012 |
+
opt_width = get_opt_field_width(field, 0)
|
| 2013 |
+
if input_width == opt_width:
|
| 2014 |
+
continue
|
| 2015 |
+
if opt_width == 0 or input_width == 0:
|
| 2016 |
+
if not allow_different_fields: # This one is not okay
|
| 2017 |
+
option = None
|
| 2018 |
+
break
|
| 2019 |
+
# Magic weight constant for "entirely different fields"
|
| 2020 |
+
distance += 0x1000
|
| 2021 |
+
elif field == 'M' and (
|
| 2022 |
+
(input_width > 2 and opt_width <= 2) or (input_width <= 2 and opt_width > 2)
|
| 2023 |
+
):
|
| 2024 |
+
# Magic weight constant for "text turns into a number"
|
| 2025 |
+
distance += 0x100
|
| 2026 |
+
else:
|
| 2027 |
+
distance += abs(input_width - opt_width)
|
| 2028 |
+
|
| 2029 |
+
if not option:
|
| 2030 |
+
# We lost the option along the way (probably due to "allow_different_fields")
|
| 2031 |
+
continue
|
| 2032 |
+
|
| 2033 |
+
if not best_skeleton or distance < best_distance:
|
| 2034 |
+
best_skeleton = option
|
| 2035 |
+
best_distance = distance
|
| 2036 |
+
|
| 2037 |
+
if distance == 0: # Found a perfect match!
|
| 2038 |
+
break
|
| 2039 |
+
|
| 2040 |
+
return best_skeleton
|
micromamba_root/Lib/site-packages/babel/languages.py
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
from babel.core import get_global
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def get_official_languages(
|
| 7 |
+
territory: str,
|
| 8 |
+
regional: bool = False,
|
| 9 |
+
de_facto: bool = False,
|
| 10 |
+
) -> tuple[str, ...]:
|
| 11 |
+
"""
|
| 12 |
+
Get the official language(s) for the given territory.
|
| 13 |
+
|
| 14 |
+
The language codes, if any are known, are returned in order of descending popularity.
|
| 15 |
+
|
| 16 |
+
If the `regional` flag is set, then languages which are regionally official are also returned.
|
| 17 |
+
|
| 18 |
+
If the `de_facto` flag is set, then languages which are "de facto" official are also returned.
|
| 19 |
+
|
| 20 |
+
.. warning:: Note that the data is as up to date as the current version of the CLDR used
|
| 21 |
+
by Babel. If you need scientifically accurate information, use another source!
|
| 22 |
+
|
| 23 |
+
:param territory: Territory code
|
| 24 |
+
:type territory: str
|
| 25 |
+
:param regional: Whether to return regionally official languages too
|
| 26 |
+
:type regional: bool
|
| 27 |
+
:param de_facto: Whether to return de-facto official languages too
|
| 28 |
+
:type de_facto: bool
|
| 29 |
+
:return: Tuple of language codes
|
| 30 |
+
:rtype: tuple[str]
|
| 31 |
+
"""
|
| 32 |
+
|
| 33 |
+
territory = str(territory).upper()
|
| 34 |
+
allowed_stati = {"official"}
|
| 35 |
+
if regional:
|
| 36 |
+
allowed_stati.add("official_regional")
|
| 37 |
+
if de_facto:
|
| 38 |
+
allowed_stati.add("de_facto_official")
|
| 39 |
+
|
| 40 |
+
languages = get_global("territory_languages").get(territory, {})
|
| 41 |
+
pairs = [
|
| 42 |
+
(info['population_percent'], language)
|
| 43 |
+
for language, info in languages.items()
|
| 44 |
+
if info.get('official_status') in allowed_stati
|
| 45 |
+
]
|
| 46 |
+
pairs.sort(reverse=True)
|
| 47 |
+
return tuple(lang for _, lang in pairs)
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
def get_territory_language_info(
|
| 51 |
+
territory: str,
|
| 52 |
+
) -> dict[str, dict[str, float | str | None]]:
|
| 53 |
+
"""
|
| 54 |
+
Get a dictionary of language information for a territory.
|
| 55 |
+
|
| 56 |
+
The dictionary is keyed by language code; the values are dicts with more information.
|
| 57 |
+
|
| 58 |
+
The following keys are currently known for the values:
|
| 59 |
+
|
| 60 |
+
* `population_percent`: The percentage of the territory's population speaking the
|
| 61 |
+
language.
|
| 62 |
+
* `official_status`: An optional string describing the officiality status of the language.
|
| 63 |
+
Known values are "official", "official_regional" and "de_facto_official".
|
| 64 |
+
|
| 65 |
+
.. warning:: Note that the data is as up to date as the current version of the CLDR used
|
| 66 |
+
by Babel. If you need scientifically accurate information, use another source!
|
| 67 |
+
|
| 68 |
+
.. note:: Note that the format of the dict returned may change between Babel versions.
|
| 69 |
+
|
| 70 |
+
See https://www.unicode.org/cldr/charts/latest/supplemental/territory_language_information.html
|
| 71 |
+
|
| 72 |
+
:param territory: Territory code
|
| 73 |
+
:type territory: str
|
| 74 |
+
:return: Language information dictionary
|
| 75 |
+
:rtype: dict[str, dict]
|
| 76 |
+
"""
|
| 77 |
+
territory = str(territory).upper()
|
| 78 |
+
return get_global("territory_languages").get(territory, {}).copy()
|
micromamba_root/Lib/site-packages/babel/lists.py
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
babel.lists
|
| 3 |
+
~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Locale dependent formatting of lists.
|
| 6 |
+
|
| 7 |
+
The default locale for the functions in this module is determined by the
|
| 8 |
+
following environment variables, in that order:
|
| 9 |
+
|
| 10 |
+
* ``LC_ALL``, and
|
| 11 |
+
* ``LANG``
|
| 12 |
+
|
| 13 |
+
:copyright: (c) 2015-2026 by the Babel Team.
|
| 14 |
+
:license: BSD, see LICENSE for more details.
|
| 15 |
+
"""
|
| 16 |
+
|
| 17 |
+
from __future__ import annotations
|
| 18 |
+
|
| 19 |
+
import warnings
|
| 20 |
+
from collections.abc import Sequence
|
| 21 |
+
from typing import Literal
|
| 22 |
+
|
| 23 |
+
from babel.core import Locale, default_locale
|
| 24 |
+
|
| 25 |
+
_DEFAULT_LOCALE = default_locale() # TODO(3.0): Remove this.
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
def __getattr__(name):
|
| 29 |
+
if name == "DEFAULT_LOCALE":
|
| 30 |
+
warnings.warn(
|
| 31 |
+
"The babel.lists.DEFAULT_LOCALE constant is deprecated and will be removed.",
|
| 32 |
+
DeprecationWarning,
|
| 33 |
+
stacklevel=2,
|
| 34 |
+
)
|
| 35 |
+
return _DEFAULT_LOCALE
|
| 36 |
+
raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
|
| 37 |
+
|
| 38 |
+
|
| 39 |
+
def format_list(
|
| 40 |
+
lst: Sequence[str],
|
| 41 |
+
style: Literal[
|
| 42 |
+
'standard',
|
| 43 |
+
'standard-short',
|
| 44 |
+
'or',
|
| 45 |
+
'or-short',
|
| 46 |
+
'unit',
|
| 47 |
+
'unit-short',
|
| 48 |
+
'unit-narrow',
|
| 49 |
+
] = 'standard',
|
| 50 |
+
locale: Locale | str | None = None,
|
| 51 |
+
) -> str:
|
| 52 |
+
"""
|
| 53 |
+
Format the items in `lst` as a list.
|
| 54 |
+
|
| 55 |
+
>>> format_list(['apples', 'oranges', 'pears'], locale='en')
|
| 56 |
+
'apples, oranges, and pears'
|
| 57 |
+
>>> format_list(['apples', 'oranges', 'pears'], locale='zh')
|
| 58 |
+
'apples、oranges和pears'
|
| 59 |
+
>>> format_list(['omena', 'peruna', 'aplari'], style='or', locale='fi')
|
| 60 |
+
'omena, peruna tai aplari'
|
| 61 |
+
|
| 62 |
+
Not all styles are necessarily available in all locales.
|
| 63 |
+
The function will attempt to fall back to replacement styles according to the rules
|
| 64 |
+
set forth in the CLDR root XML file, and raise a ValueError if no suitable replacement
|
| 65 |
+
can be found.
|
| 66 |
+
|
| 67 |
+
The following text is verbatim from the Unicode TR35-49 spec [1].
|
| 68 |
+
|
| 69 |
+
* standard:
|
| 70 |
+
A typical 'and' list for arbitrary placeholders.
|
| 71 |
+
eg. "January, February, and March"
|
| 72 |
+
* standard-short:
|
| 73 |
+
A short version of an 'and' list, suitable for use with short or abbreviated placeholder values.
|
| 74 |
+
eg. "Jan., Feb., and Mar."
|
| 75 |
+
* or:
|
| 76 |
+
A typical 'or' list for arbitrary placeholders.
|
| 77 |
+
eg. "January, February, or March"
|
| 78 |
+
* or-short:
|
| 79 |
+
A short version of an 'or' list.
|
| 80 |
+
eg. "Jan., Feb., or Mar."
|
| 81 |
+
* unit:
|
| 82 |
+
A list suitable for wide units.
|
| 83 |
+
eg. "3 feet, 7 inches"
|
| 84 |
+
* unit-short:
|
| 85 |
+
A list suitable for short units
|
| 86 |
+
eg. "3 ft, 7 in"
|
| 87 |
+
* unit-narrow:
|
| 88 |
+
A list suitable for narrow units, where space on the screen is very limited.
|
| 89 |
+
eg. "3′ 7″"
|
| 90 |
+
|
| 91 |
+
[1]: https://www.unicode.org/reports/tr35/tr35-49/tr35-general.html#ListPatterns
|
| 92 |
+
|
| 93 |
+
:param lst: a sequence of items to format in to a list
|
| 94 |
+
:param style: the style to format the list with. See above for description.
|
| 95 |
+
:param locale: the locale. Defaults to the system locale.
|
| 96 |
+
"""
|
| 97 |
+
locale = Locale.parse(locale or _DEFAULT_LOCALE)
|
| 98 |
+
if not lst:
|
| 99 |
+
return ''
|
| 100 |
+
if len(lst) == 1:
|
| 101 |
+
return lst[0]
|
| 102 |
+
|
| 103 |
+
patterns = _resolve_list_style(locale, style)
|
| 104 |
+
|
| 105 |
+
if len(lst) == 2 and '2' in patterns:
|
| 106 |
+
return patterns['2'].format(*lst)
|
| 107 |
+
|
| 108 |
+
result = patterns['start'].format(lst[0], lst[1])
|
| 109 |
+
for elem in lst[2:-1]:
|
| 110 |
+
result = patterns['middle'].format(result, elem)
|
| 111 |
+
result = patterns['end'].format(result, lst[-1])
|
| 112 |
+
|
| 113 |
+
return result
|
| 114 |
+
|
| 115 |
+
|
| 116 |
+
# Based on CLDR 45's root.xml file's `<alias>`es.
|
| 117 |
+
# The root file defines both `standard` and `or`,
|
| 118 |
+
# so they're always available.
|
| 119 |
+
# TODO: It would likely be better to use the
|
| 120 |
+
# babel.localedata.Alias mechanism for this,
|
| 121 |
+
# but I'm not quite sure how it's supposed to
|
| 122 |
+
# work with inheritance and data in the root.
|
| 123 |
+
_style_fallbacks = {
|
| 124 |
+
"or-narrow": ["or-short", "or"],
|
| 125 |
+
"or-short": ["or"],
|
| 126 |
+
"standard-narrow": ["standard-short", "standard"],
|
| 127 |
+
"standard-short": ["standard"],
|
| 128 |
+
"unit": ["unit-short", "standard"],
|
| 129 |
+
"unit-narrow": ["unit-short", "unit", "standard"],
|
| 130 |
+
"unit-short": ["standard"],
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
|
| 134 |
+
def _resolve_list_style(locale: Locale, style: str):
|
| 135 |
+
for style in (style, *(_style_fallbacks.get(style, []))): # noqa: B020
|
| 136 |
+
if style in locale.list_patterns:
|
| 137 |
+
return locale.list_patterns[style]
|
| 138 |
+
raise ValueError(
|
| 139 |
+
f"Locale {locale} does not support list formatting style {style!r} "
|
| 140 |
+
f"(supported are {sorted(locale.list_patterns)})",
|
| 141 |
+
)
|
micromamba_root/Lib/site-packages/babel/localedata.py
ADDED
|
@@ -0,0 +1,284 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
babel.localedata
|
| 3 |
+
~~~~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Low-level locale data access.
|
| 6 |
+
|
| 7 |
+
:note: The `Locale` class, which uses this module under the hood, provides a
|
| 8 |
+
more convenient interface for accessing the locale data.
|
| 9 |
+
|
| 10 |
+
:copyright: (c) 2013-2026 by the Babel Team.
|
| 11 |
+
:license: BSD, see LICENSE for more details.
|
| 12 |
+
"""
|
| 13 |
+
|
| 14 |
+
from __future__ import annotations
|
| 15 |
+
|
| 16 |
+
import os
|
| 17 |
+
import pickle
|
| 18 |
+
import re
|
| 19 |
+
import sys
|
| 20 |
+
import threading
|
| 21 |
+
from collections import abc
|
| 22 |
+
from collections.abc import Iterator, Mapping, MutableMapping
|
| 23 |
+
from functools import lru_cache
|
| 24 |
+
from itertools import chain
|
| 25 |
+
from typing import Any
|
| 26 |
+
|
| 27 |
+
_cache: dict[str, Any] = {}
|
| 28 |
+
_cache_lock = threading.RLock()
|
| 29 |
+
_dirname = os.path.join(os.path.dirname(__file__), 'locale-data')
|
| 30 |
+
_windows_reserved_name_re = re.compile("^(con|prn|aux|nul|com[0-9]|lpt[0-9])$", re.I)
|
| 31 |
+
|
| 32 |
+
|
| 33 |
+
def normalize_locale(name: str) -> str | None:
|
| 34 |
+
"""Normalize a locale ID by stripping spaces and apply proper casing.
|
| 35 |
+
|
| 36 |
+
Returns the normalized locale ID string or `None` if the ID is not
|
| 37 |
+
recognized.
|
| 38 |
+
"""
|
| 39 |
+
if not name or not isinstance(name, str):
|
| 40 |
+
return None
|
| 41 |
+
name = name.strip().lower()
|
| 42 |
+
for locale_id in chain.from_iterable([_cache, locale_identifiers()]):
|
| 43 |
+
if name == locale_id.lower():
|
| 44 |
+
return locale_id
|
| 45 |
+
|
| 46 |
+
|
| 47 |
+
def resolve_locale_filename(name: os.PathLike[str] | str) -> str:
|
| 48 |
+
"""
|
| 49 |
+
Resolve a locale identifier to a `.dat` path on disk.
|
| 50 |
+
"""
|
| 51 |
+
|
| 52 |
+
# Clean up any possible relative paths.
|
| 53 |
+
name = os.path.basename(name)
|
| 54 |
+
|
| 55 |
+
# Ensure we're not left with one of the Windows reserved names.
|
| 56 |
+
if sys.platform == "win32" and _windows_reserved_name_re.match(os.path.splitext(name)[0]):
|
| 57 |
+
raise ValueError(f"Name {name} is invalid on Windows")
|
| 58 |
+
|
| 59 |
+
# Build the path.
|
| 60 |
+
return os.path.join(_dirname, f"{name}.dat")
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
def exists(name: str) -> bool:
|
| 64 |
+
"""Check whether locale data is available for the given locale.
|
| 65 |
+
|
| 66 |
+
Returns `True` if it exists, `False` otherwise.
|
| 67 |
+
|
| 68 |
+
:param name: the locale identifier string
|
| 69 |
+
"""
|
| 70 |
+
if not name or not isinstance(name, str):
|
| 71 |
+
return False
|
| 72 |
+
if name in _cache:
|
| 73 |
+
return True
|
| 74 |
+
file_found = os.path.exists(resolve_locale_filename(name))
|
| 75 |
+
return True if file_found else bool(normalize_locale(name))
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
@lru_cache(maxsize=None)
|
| 79 |
+
def locale_identifiers() -> list[str]:
|
| 80 |
+
"""Return a list of all locale identifiers for which locale data is
|
| 81 |
+
available.
|
| 82 |
+
|
| 83 |
+
This data is cached after the first invocation.
|
| 84 |
+
You can clear the cache by calling `locale_identifiers.cache_clear()`.
|
| 85 |
+
|
| 86 |
+
.. versionadded:: 0.8.1
|
| 87 |
+
|
| 88 |
+
:return: a list of locale identifiers (strings)
|
| 89 |
+
"""
|
| 90 |
+
return [
|
| 91 |
+
stem
|
| 92 |
+
for stem, extension in (
|
| 93 |
+
os.path.splitext(filename) for filename in os.listdir(_dirname)
|
| 94 |
+
)
|
| 95 |
+
if extension == '.dat' and stem != 'root'
|
| 96 |
+
]
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
def _is_non_likely_script(name: str) -> bool:
|
| 100 |
+
"""Return whether the locale is of the form ``lang_Script``,
|
| 101 |
+
and the script is not the likely script for the language.
|
| 102 |
+
|
| 103 |
+
This implements the behavior of the ``nonlikelyScript`` value of the
|
| 104 |
+
``localRules`` attribute for parent locales added in CLDR 45.
|
| 105 |
+
"""
|
| 106 |
+
from babel.core import get_global, parse_locale
|
| 107 |
+
|
| 108 |
+
try:
|
| 109 |
+
lang, territory, script, variant, *rest = parse_locale(name)
|
| 110 |
+
except ValueError:
|
| 111 |
+
return False
|
| 112 |
+
|
| 113 |
+
if lang and script and not territory and not variant and not rest:
|
| 114 |
+
likely_subtag = get_global('likely_subtags').get(lang)
|
| 115 |
+
_, _, likely_script, *_ = parse_locale(likely_subtag)
|
| 116 |
+
return script != likely_script
|
| 117 |
+
return False
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
def load(name: os.PathLike[str] | str, merge_inherited: bool = True) -> dict[str, Any]:
|
| 121 |
+
"""Load the locale data for the given locale.
|
| 122 |
+
|
| 123 |
+
The locale data is a dictionary that contains much of the data defined by
|
| 124 |
+
the Common Locale Data Repository (CLDR). This data is stored as a
|
| 125 |
+
collection of pickle files inside the ``babel`` package.
|
| 126 |
+
|
| 127 |
+
>>> d = load('en_US')
|
| 128 |
+
>>> d['languages']['sv']
|
| 129 |
+
'Swedish'
|
| 130 |
+
|
| 131 |
+
Note that the results are cached, and subsequent requests for the same
|
| 132 |
+
locale return the same dictionary:
|
| 133 |
+
|
| 134 |
+
>>> d1 = load('en_US')
|
| 135 |
+
>>> d2 = load('en_US')
|
| 136 |
+
>>> d1 is d2
|
| 137 |
+
True
|
| 138 |
+
|
| 139 |
+
:param name: the locale identifier string (or "root")
|
| 140 |
+
:param merge_inherited: whether the inherited data should be merged into
|
| 141 |
+
the data of the requested locale
|
| 142 |
+
:raise `IOError`: if no locale data file is found for the given locale
|
| 143 |
+
identifier, or one of the locales it inherits from
|
| 144 |
+
"""
|
| 145 |
+
name = os.path.basename(name)
|
| 146 |
+
_cache_lock.acquire()
|
| 147 |
+
try:
|
| 148 |
+
data = _cache.get(name)
|
| 149 |
+
if not data:
|
| 150 |
+
# Load inherited data
|
| 151 |
+
if name == 'root' or not merge_inherited:
|
| 152 |
+
data = {}
|
| 153 |
+
else:
|
| 154 |
+
from babel.core import get_global
|
| 155 |
+
|
| 156 |
+
parent = get_global('parent_exceptions').get(name)
|
| 157 |
+
if not parent:
|
| 158 |
+
if _is_non_likely_script(name):
|
| 159 |
+
parent = 'root'
|
| 160 |
+
else:
|
| 161 |
+
parts = name.split('_')
|
| 162 |
+
parent = "root" if len(parts) == 1 else "_".join(parts[:-1])
|
| 163 |
+
data = load(parent).copy()
|
| 164 |
+
filename = resolve_locale_filename(name)
|
| 165 |
+
with open(filename, 'rb') as fileobj:
|
| 166 |
+
if name != 'root' and merge_inherited:
|
| 167 |
+
merge(data, pickle.load(fileobj))
|
| 168 |
+
else:
|
| 169 |
+
data = pickle.load(fileobj)
|
| 170 |
+
_cache[name] = data
|
| 171 |
+
return data
|
| 172 |
+
finally:
|
| 173 |
+
_cache_lock.release()
|
| 174 |
+
|
| 175 |
+
|
| 176 |
+
def merge(dict1: MutableMapping[Any, Any], dict2: Mapping[Any, Any]) -> None:
|
| 177 |
+
"""Merge the data from `dict2` into the `dict1` dictionary, making copies
|
| 178 |
+
of nested dictionaries.
|
| 179 |
+
|
| 180 |
+
>>> d = {1: 'foo', 3: 'baz'}
|
| 181 |
+
>>> merge(d, {1: 'Foo', 2: 'Bar'})
|
| 182 |
+
>>> sorted(d.items())
|
| 183 |
+
[(1, 'Foo'), (2, 'Bar'), (3, 'baz')]
|
| 184 |
+
|
| 185 |
+
:param dict1: the dictionary to merge into
|
| 186 |
+
:param dict2: the dictionary containing the data that should be merged
|
| 187 |
+
"""
|
| 188 |
+
for key, val2 in dict2.items():
|
| 189 |
+
if val2 is not None:
|
| 190 |
+
val1 = dict1.get(key)
|
| 191 |
+
if isinstance(val2, dict):
|
| 192 |
+
if val1 is None:
|
| 193 |
+
val1 = {}
|
| 194 |
+
if isinstance(val1, Alias):
|
| 195 |
+
val1 = (val1, val2)
|
| 196 |
+
elif isinstance(val1, tuple):
|
| 197 |
+
alias, others = val1
|
| 198 |
+
others = others.copy()
|
| 199 |
+
merge(others, val2)
|
| 200 |
+
val1 = (alias, others)
|
| 201 |
+
else:
|
| 202 |
+
val1 = val1.copy()
|
| 203 |
+
merge(val1, val2)
|
| 204 |
+
else:
|
| 205 |
+
val1 = val2
|
| 206 |
+
dict1[key] = val1
|
| 207 |
+
|
| 208 |
+
|
| 209 |
+
class Alias:
|
| 210 |
+
"""Representation of an alias in the locale data.
|
| 211 |
+
|
| 212 |
+
An alias is a value that refers to some other part of the locale data,
|
| 213 |
+
as specified by the `keys`.
|
| 214 |
+
"""
|
| 215 |
+
|
| 216 |
+
def __init__(self, keys: tuple[str, ...]) -> None:
|
| 217 |
+
self.keys = tuple(keys)
|
| 218 |
+
|
| 219 |
+
def __repr__(self) -> str:
|
| 220 |
+
return f"<{type(self).__name__} {self.keys!r}>"
|
| 221 |
+
|
| 222 |
+
def resolve(self, data: Mapping[str | int | None, Any]) -> Mapping[str | int | None, Any]:
|
| 223 |
+
"""Resolve the alias based on the given data.
|
| 224 |
+
|
| 225 |
+
This is done recursively, so if one alias resolves to a second alias,
|
| 226 |
+
that second alias will also be resolved.
|
| 227 |
+
|
| 228 |
+
:param data: the locale data
|
| 229 |
+
:type data: `dict`
|
| 230 |
+
"""
|
| 231 |
+
base = data
|
| 232 |
+
for key in self.keys:
|
| 233 |
+
data = data[key]
|
| 234 |
+
if isinstance(data, Alias):
|
| 235 |
+
data = data.resolve(base)
|
| 236 |
+
elif isinstance(data, tuple):
|
| 237 |
+
alias, others = data
|
| 238 |
+
data = alias.resolve(base)
|
| 239 |
+
return data
|
| 240 |
+
|
| 241 |
+
|
| 242 |
+
class LocaleDataDict(abc.MutableMapping):
|
| 243 |
+
"""Dictionary wrapper that automatically resolves aliases to the actual
|
| 244 |
+
values.
|
| 245 |
+
"""
|
| 246 |
+
|
| 247 |
+
def __init__(
|
| 248 |
+
self,
|
| 249 |
+
data: MutableMapping[str | int | None, Any],
|
| 250 |
+
base: Mapping[str | int | None, Any] | None = None,
|
| 251 |
+
):
|
| 252 |
+
self._data = data
|
| 253 |
+
if base is None:
|
| 254 |
+
base = data
|
| 255 |
+
self.base = base
|
| 256 |
+
|
| 257 |
+
def __len__(self) -> int:
|
| 258 |
+
return len(self._data)
|
| 259 |
+
|
| 260 |
+
def __iter__(self) -> Iterator[str | int | None]:
|
| 261 |
+
return iter(self._data)
|
| 262 |
+
|
| 263 |
+
def __getitem__(self, key: str | int | None) -> Any:
|
| 264 |
+
orig = val = self._data[key]
|
| 265 |
+
if isinstance(val, Alias): # resolve an alias
|
| 266 |
+
val = val.resolve(self.base)
|
| 267 |
+
if isinstance(val, tuple): # Merge a partial dict with an alias
|
| 268 |
+
alias, others = val
|
| 269 |
+
val = alias.resolve(self.base).copy()
|
| 270 |
+
merge(val, others)
|
| 271 |
+
if isinstance(val, dict): # Return a nested alias-resolving dict
|
| 272 |
+
val = LocaleDataDict(val, base=self.base)
|
| 273 |
+
if val is not orig:
|
| 274 |
+
self._data[key] = val
|
| 275 |
+
return val
|
| 276 |
+
|
| 277 |
+
def __setitem__(self, key: str | int | None, value: Any) -> None:
|
| 278 |
+
self._data[key] = value
|
| 279 |
+
|
| 280 |
+
def __delitem__(self, key: str | int | None) -> None:
|
| 281 |
+
del self._data[key]
|
| 282 |
+
|
| 283 |
+
def copy(self) -> LocaleDataDict:
|
| 284 |
+
return LocaleDataDict(self._data.copy(), base=self.base)
|
micromamba_root/Lib/site-packages/babel/numbers.py
ADDED
|
@@ -0,0 +1,1681 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
babel.numbers
|
| 3 |
+
~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Locale dependent formatting and parsing of numeric data.
|
| 6 |
+
|
| 7 |
+
The default locale for the functions in this module is determined by the
|
| 8 |
+
following environment variables, in that order:
|
| 9 |
+
|
| 10 |
+
* ``LC_MONETARY`` for currency related functions,
|
| 11 |
+
* ``LC_NUMERIC``, and
|
| 12 |
+
* ``LC_ALL``, and
|
| 13 |
+
* ``LANG``
|
| 14 |
+
|
| 15 |
+
:copyright: (c) 2013-2026 by the Babel Team.
|
| 16 |
+
:license: BSD, see LICENSE for more details.
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
# TODO:
|
| 20 |
+
# Padding and rounding increments in pattern:
|
| 21 |
+
# - https://www.unicode.org/reports/tr35/ (Appendix G.6)
|
| 22 |
+
from __future__ import annotations
|
| 23 |
+
|
| 24 |
+
import datetime
|
| 25 |
+
import decimal
|
| 26 |
+
import re
|
| 27 |
+
import warnings
|
| 28 |
+
from typing import Any, Literal, cast, overload
|
| 29 |
+
|
| 30 |
+
from babel.core import Locale, default_locale, get_global
|
| 31 |
+
from babel.localedata import LocaleDataDict
|
| 32 |
+
|
| 33 |
+
LC_MONETARY = default_locale(('LC_MONETARY', 'LC_NUMERIC'))
|
| 34 |
+
LC_NUMERIC = default_locale('LC_NUMERIC')
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
class UnknownCurrencyError(Exception):
|
| 38 |
+
"""Exception thrown when a currency is requested for which no data is available."""
|
| 39 |
+
|
| 40 |
+
def __init__(self, identifier: str) -> None:
|
| 41 |
+
"""Create the exception.
|
| 42 |
+
:param identifier: the identifier string of the unsupported currency
|
| 43 |
+
"""
|
| 44 |
+
Exception.__init__(self, f"Unknown currency {identifier!r}.")
|
| 45 |
+
|
| 46 |
+
#: The identifier of the locale that could not be found.
|
| 47 |
+
self.identifier = identifier
|
| 48 |
+
|
| 49 |
+
|
| 50 |
+
def list_currencies(locale: Locale | str | None = None) -> set[str]:
|
| 51 |
+
"""Return a `set` of normalized currency codes.
|
| 52 |
+
|
| 53 |
+
.. versionadded:: 2.5.0
|
| 54 |
+
|
| 55 |
+
:param locale: filters returned currency codes by the provided locale.
|
| 56 |
+
Expected to be a locale instance or code. If no locale is
|
| 57 |
+
provided, returns the list of all currencies from all
|
| 58 |
+
locales.
|
| 59 |
+
"""
|
| 60 |
+
# Get locale-scoped currencies.
|
| 61 |
+
if locale:
|
| 62 |
+
return set(Locale.parse(locale).currencies)
|
| 63 |
+
return set(get_global('all_currencies'))
|
| 64 |
+
|
| 65 |
+
|
| 66 |
+
def validate_currency(currency: str, locale: Locale | str | None = None) -> None:
|
| 67 |
+
"""Check the currency code is recognized by Babel.
|
| 68 |
+
|
| 69 |
+
Accepts a ``locale`` parameter for fined-grained validation, working as
|
| 70 |
+
the one defined above in ``list_currencies()`` method.
|
| 71 |
+
|
| 72 |
+
Raises a `UnknownCurrencyError` exception if the currency is unknown to Babel.
|
| 73 |
+
"""
|
| 74 |
+
if currency not in list_currencies(locale):
|
| 75 |
+
raise UnknownCurrencyError(currency)
|
| 76 |
+
|
| 77 |
+
|
| 78 |
+
def is_currency(currency: str, locale: Locale | str | None = None) -> bool:
|
| 79 |
+
"""Returns `True` only if a currency is recognized by Babel.
|
| 80 |
+
|
| 81 |
+
This method always return a Boolean and never raise.
|
| 82 |
+
"""
|
| 83 |
+
if not currency or not isinstance(currency, str):
|
| 84 |
+
return False
|
| 85 |
+
try:
|
| 86 |
+
validate_currency(currency, locale)
|
| 87 |
+
except UnknownCurrencyError:
|
| 88 |
+
return False
|
| 89 |
+
return True
|
| 90 |
+
|
| 91 |
+
|
| 92 |
+
def normalize_currency(currency: str, locale: Locale | str | None = None) -> str | None:
|
| 93 |
+
"""Returns the normalized identifier of any currency code.
|
| 94 |
+
|
| 95 |
+
Accepts a ``locale`` parameter for fined-grained validation, working as
|
| 96 |
+
the one defined above in ``list_currencies()`` method.
|
| 97 |
+
|
| 98 |
+
Returns None if the currency is unknown to Babel.
|
| 99 |
+
"""
|
| 100 |
+
if isinstance(currency, str):
|
| 101 |
+
currency = currency.upper()
|
| 102 |
+
if not is_currency(currency, locale):
|
| 103 |
+
return None
|
| 104 |
+
return currency
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
def get_currency_name(
|
| 108 |
+
currency: str,
|
| 109 |
+
count: float | decimal.Decimal | None = None,
|
| 110 |
+
locale: Locale | str | None = None,
|
| 111 |
+
) -> str:
|
| 112 |
+
"""Return the name used by the locale for the specified currency.
|
| 113 |
+
|
| 114 |
+
>>> get_currency_name('USD', locale='en_US')
|
| 115 |
+
'US Dollar'
|
| 116 |
+
|
| 117 |
+
.. versionadded:: 0.9.4
|
| 118 |
+
|
| 119 |
+
:param currency: the currency code.
|
| 120 |
+
:param count: the optional count. If provided the currency name
|
| 121 |
+
will be pluralized to that number if possible.
|
| 122 |
+
:param locale: the `Locale` object or locale identifier.
|
| 123 |
+
Defaults to the system currency locale or numeric locale.
|
| 124 |
+
"""
|
| 125 |
+
loc = Locale.parse(locale or LC_MONETARY)
|
| 126 |
+
if count is not None:
|
| 127 |
+
try:
|
| 128 |
+
plural_form = loc.plural_form(count)
|
| 129 |
+
except (OverflowError, ValueError):
|
| 130 |
+
plural_form = 'other'
|
| 131 |
+
plural_names = loc._data['currency_names_plural']
|
| 132 |
+
if currency in plural_names:
|
| 133 |
+
currency_plural_names = plural_names[currency]
|
| 134 |
+
if plural_form in currency_plural_names:
|
| 135 |
+
return currency_plural_names[plural_form]
|
| 136 |
+
if 'other' in currency_plural_names:
|
| 137 |
+
return currency_plural_names['other']
|
| 138 |
+
return loc.currencies.get(currency, currency)
|
| 139 |
+
|
| 140 |
+
|
| 141 |
+
def get_currency_symbol(currency: str, locale: Locale | str | None = None) -> str:
|
| 142 |
+
"""Return the symbol used by the locale for the specified currency.
|
| 143 |
+
|
| 144 |
+
>>> get_currency_symbol('USD', locale='en_US')
|
| 145 |
+
'$'
|
| 146 |
+
|
| 147 |
+
:param currency: the currency code.
|
| 148 |
+
:param locale: the `Locale` object or locale identifier.
|
| 149 |
+
Defaults to the system currency locale or numeric locale.
|
| 150 |
+
"""
|
| 151 |
+
return Locale.parse(locale or LC_MONETARY).currency_symbols.get(currency, currency)
|
| 152 |
+
|
| 153 |
+
|
| 154 |
+
def get_currency_precision(currency: str) -> int:
|
| 155 |
+
"""Return currency's precision.
|
| 156 |
+
|
| 157 |
+
Precision is the number of decimals found after the decimal point in the
|
| 158 |
+
currency's format pattern.
|
| 159 |
+
|
| 160 |
+
.. versionadded:: 2.5.0
|
| 161 |
+
|
| 162 |
+
:param currency: the currency code.
|
| 163 |
+
"""
|
| 164 |
+
precisions = get_global('currency_fractions')
|
| 165 |
+
return precisions.get(currency, precisions['DEFAULT'])[0]
|
| 166 |
+
|
| 167 |
+
|
| 168 |
+
def get_currency_unit_pattern(
|
| 169 |
+
currency: str, # TODO: unused?!
|
| 170 |
+
count: float | decimal.Decimal | None = None,
|
| 171 |
+
locale: Locale | str | None = None,
|
| 172 |
+
) -> str:
|
| 173 |
+
"""
|
| 174 |
+
Return the unit pattern used for long display of a currency value
|
| 175 |
+
for a given locale.
|
| 176 |
+
This is a string containing ``{0}`` where the numeric part
|
| 177 |
+
should be substituted and ``{1}`` where the currency long display
|
| 178 |
+
name should be substituted.
|
| 179 |
+
|
| 180 |
+
>>> get_currency_unit_pattern('USD', locale='en_US', count=10)
|
| 181 |
+
'{0} {1}'
|
| 182 |
+
|
| 183 |
+
.. versionadded:: 2.7.0
|
| 184 |
+
|
| 185 |
+
:param currency: the currency code.
|
| 186 |
+
:param count: the optional count. If provided the unit
|
| 187 |
+
pattern for that number will be returned.
|
| 188 |
+
:param locale: the `Locale` object or locale identifier.
|
| 189 |
+
Defaults to the system currency locale or numeric locale.
|
| 190 |
+
"""
|
| 191 |
+
loc = Locale.parse(locale or LC_MONETARY)
|
| 192 |
+
if count is not None:
|
| 193 |
+
plural_form = loc.plural_form(count)
|
| 194 |
+
try:
|
| 195 |
+
return loc._data['currency_unit_patterns'][plural_form]
|
| 196 |
+
except LookupError:
|
| 197 |
+
# Fall back to 'other'
|
| 198 |
+
pass
|
| 199 |
+
|
| 200 |
+
return loc._data['currency_unit_patterns']['other']
|
| 201 |
+
|
| 202 |
+
|
| 203 |
+
@overload
|
| 204 |
+
def get_territory_currencies(
|
| 205 |
+
territory: str,
|
| 206 |
+
start_date: datetime.date | None = ...,
|
| 207 |
+
end_date: datetime.date | None = ...,
|
| 208 |
+
tender: bool = ...,
|
| 209 |
+
non_tender: bool = ...,
|
| 210 |
+
include_details: Literal[False] = ...,
|
| 211 |
+
) -> list[str]: ... # pragma: no cover
|
| 212 |
+
|
| 213 |
+
|
| 214 |
+
@overload
|
| 215 |
+
def get_territory_currencies(
|
| 216 |
+
territory: str,
|
| 217 |
+
start_date: datetime.date | None = ...,
|
| 218 |
+
end_date: datetime.date | None = ...,
|
| 219 |
+
tender: bool = ...,
|
| 220 |
+
non_tender: bool = ...,
|
| 221 |
+
include_details: Literal[True] = ...,
|
| 222 |
+
) -> list[dict[str, Any]]: ... # pragma: no cover
|
| 223 |
+
|
| 224 |
+
|
| 225 |
+
def get_territory_currencies(
|
| 226 |
+
territory: str,
|
| 227 |
+
start_date: datetime.date | None = None,
|
| 228 |
+
end_date: datetime.date | None = None,
|
| 229 |
+
tender: bool = True,
|
| 230 |
+
non_tender: bool = False,
|
| 231 |
+
include_details: bool = False,
|
| 232 |
+
) -> list[str] | list[dict[str, Any]]:
|
| 233 |
+
"""Returns the list of currencies for the given territory that are valid for
|
| 234 |
+
the given date range. In addition to that the currency database
|
| 235 |
+
distinguishes between tender and non-tender currencies. By default only
|
| 236 |
+
tender currencies are returned.
|
| 237 |
+
|
| 238 |
+
The return value is a list of all currencies roughly ordered by the time
|
| 239 |
+
of when the currency became active. The longer the currency is being in
|
| 240 |
+
use the more to the left of the list it will be.
|
| 241 |
+
|
| 242 |
+
The start date defaults to today. If no end date is given it will be the
|
| 243 |
+
same as the start date. Otherwise a range can be defined. For instance
|
| 244 |
+
this can be used to find the currencies in use in Austria between 1995 and
|
| 245 |
+
2011:
|
| 246 |
+
|
| 247 |
+
>>> from datetime import date
|
| 248 |
+
>>> get_territory_currencies('AT', date(1995, 1, 1), date(2011, 1, 1))
|
| 249 |
+
['ATS', 'EUR']
|
| 250 |
+
|
| 251 |
+
Likewise it's also possible to find all the currencies in use on a
|
| 252 |
+
single date:
|
| 253 |
+
|
| 254 |
+
>>> get_territory_currencies('AT', date(1995, 1, 1))
|
| 255 |
+
['ATS']
|
| 256 |
+
>>> get_territory_currencies('AT', date(2011, 1, 1))
|
| 257 |
+
['EUR']
|
| 258 |
+
|
| 259 |
+
By default the return value only includes tender currencies. This
|
| 260 |
+
however can be changed:
|
| 261 |
+
|
| 262 |
+
>>> get_territory_currencies('US')
|
| 263 |
+
['USD']
|
| 264 |
+
>>> get_territory_currencies('US', tender=False, non_tender=True,
|
| 265 |
+
... start_date=date(2014, 1, 1))
|
| 266 |
+
['USN', 'USS']
|
| 267 |
+
|
| 268 |
+
.. versionadded:: 2.0
|
| 269 |
+
|
| 270 |
+
:param territory: the name of the territory to find the currency for.
|
| 271 |
+
:param start_date: the start date. If not given today is assumed.
|
| 272 |
+
:param end_date: the end date. If not given the start date is assumed.
|
| 273 |
+
:param tender: controls whether tender currencies should be included.
|
| 274 |
+
:param non_tender: controls whether non-tender currencies should be
|
| 275 |
+
included.
|
| 276 |
+
:param include_details: if set to `True`, instead of returning currency
|
| 277 |
+
codes the return value will be dictionaries
|
| 278 |
+
with detail information. In that case each
|
| 279 |
+
dictionary will have the keys ``'currency'``,
|
| 280 |
+
``'from'``, ``'to'``, and ``'tender'``.
|
| 281 |
+
"""
|
| 282 |
+
currencies = get_global('territory_currencies')
|
| 283 |
+
if start_date is None:
|
| 284 |
+
start_date = datetime.date.today()
|
| 285 |
+
elif isinstance(start_date, datetime.datetime):
|
| 286 |
+
start_date = start_date.date()
|
| 287 |
+
if end_date is None:
|
| 288 |
+
end_date = start_date
|
| 289 |
+
elif isinstance(end_date, datetime.datetime):
|
| 290 |
+
end_date = end_date.date()
|
| 291 |
+
|
| 292 |
+
curs = currencies.get(territory.upper(), ())
|
| 293 |
+
# TODO: validate that the territory exists
|
| 294 |
+
|
| 295 |
+
def _is_active(start, end):
|
| 296 |
+
return (start is None or start <= end_date) and (end is None or end >= start_date)
|
| 297 |
+
|
| 298 |
+
result = []
|
| 299 |
+
for currency_code, start, end, is_tender in curs:
|
| 300 |
+
if start:
|
| 301 |
+
start = datetime.date(*start)
|
| 302 |
+
if end:
|
| 303 |
+
end = datetime.date(*end)
|
| 304 |
+
if ((is_tender and tender) or (not is_tender and non_tender)) and _is_active(
|
| 305 |
+
start,
|
| 306 |
+
end,
|
| 307 |
+
):
|
| 308 |
+
if include_details:
|
| 309 |
+
result.append(
|
| 310 |
+
{
|
| 311 |
+
'currency': currency_code,
|
| 312 |
+
'from': start,
|
| 313 |
+
'to': end,
|
| 314 |
+
'tender': is_tender,
|
| 315 |
+
},
|
| 316 |
+
)
|
| 317 |
+
else:
|
| 318 |
+
result.append(currency_code)
|
| 319 |
+
|
| 320 |
+
return result
|
| 321 |
+
|
| 322 |
+
|
| 323 |
+
def _get_numbering_system(
|
| 324 |
+
locale: Locale,
|
| 325 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 326 |
+
) -> str:
|
| 327 |
+
if numbering_system == "default":
|
| 328 |
+
return locale.default_numbering_system
|
| 329 |
+
else:
|
| 330 |
+
return numbering_system
|
| 331 |
+
|
| 332 |
+
|
| 333 |
+
def _get_number_symbols(
|
| 334 |
+
locale: Locale,
|
| 335 |
+
*,
|
| 336 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 337 |
+
) -> LocaleDataDict:
|
| 338 |
+
numbering_system = _get_numbering_system(locale, numbering_system)
|
| 339 |
+
try:
|
| 340 |
+
return locale.number_symbols[numbering_system]
|
| 341 |
+
except KeyError as error:
|
| 342 |
+
raise UnsupportedNumberingSystemError(
|
| 343 |
+
f"Unknown numbering system {numbering_system} for Locale {locale}.",
|
| 344 |
+
) from error
|
| 345 |
+
|
| 346 |
+
|
| 347 |
+
class UnsupportedNumberingSystemError(Exception):
|
| 348 |
+
"""Exception thrown when an unsupported numbering system is requested for the given Locale."""
|
| 349 |
+
|
| 350 |
+
pass
|
| 351 |
+
|
| 352 |
+
|
| 353 |
+
def get_decimal_symbol(
|
| 354 |
+
locale: Locale | str | None = None,
|
| 355 |
+
*,
|
| 356 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 357 |
+
) -> str:
|
| 358 |
+
"""Return the symbol used by the locale to separate decimal fractions.
|
| 359 |
+
|
| 360 |
+
>>> get_decimal_symbol('en_US')
|
| 361 |
+
'.'
|
| 362 |
+
>>> get_decimal_symbol('ar_EG', numbering_system='default')
|
| 363 |
+
'٫'
|
| 364 |
+
>>> get_decimal_symbol('ar_EG', numbering_system='latn')
|
| 365 |
+
'.'
|
| 366 |
+
|
| 367 |
+
:param locale: the `Locale` object or locale identifier. Defaults to the system numeric locale.
|
| 368 |
+
:param numbering_system: The numbering system used for fetching the symbol. Defaults to "latn".
|
| 369 |
+
The special value "default" will use the default numbering system of the locale.
|
| 370 |
+
:raise `UnsupportedNumberingSystemError`: If the numbering system is not supported by the locale.
|
| 371 |
+
"""
|
| 372 |
+
locale = Locale.parse(locale or LC_NUMERIC)
|
| 373 |
+
return _get_number_symbols(locale, numbering_system=numbering_system).get('decimal', '.')
|
| 374 |
+
|
| 375 |
+
|
| 376 |
+
def get_plus_sign_symbol(
|
| 377 |
+
locale: Locale | str | None = None,
|
| 378 |
+
*,
|
| 379 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 380 |
+
) -> str:
|
| 381 |
+
"""Return the plus sign symbol used by the current locale.
|
| 382 |
+
|
| 383 |
+
>>> get_plus_sign_symbol('en_US')
|
| 384 |
+
'+'
|
| 385 |
+
>>> get_plus_sign_symbol('ar_EG', numbering_system='default')
|
| 386 |
+
'\\u061c+'
|
| 387 |
+
>>> get_plus_sign_symbol('ar_EG', numbering_system='latn')
|
| 388 |
+
'\\u200e+'
|
| 389 |
+
|
| 390 |
+
:param locale: the `Locale` object or locale identifier. Defaults to the system numeric locale.
|
| 391 |
+
:param numbering_system: The numbering system used for fetching the symbol. Defaults to "latn".
|
| 392 |
+
The special value "default" will use the default numbering system of the locale.
|
| 393 |
+
:raise `UnsupportedNumberingSystemError`: if the numbering system is not supported by the locale.
|
| 394 |
+
"""
|
| 395 |
+
locale = Locale.parse(locale or LC_NUMERIC)
|
| 396 |
+
return _get_number_symbols(locale, numbering_system=numbering_system).get('plusSign', '+')
|
| 397 |
+
|
| 398 |
+
|
| 399 |
+
def get_minus_sign_symbol(
|
| 400 |
+
locale: Locale | str | None = None,
|
| 401 |
+
*,
|
| 402 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 403 |
+
) -> str:
|
| 404 |
+
"""Return the plus sign symbol used by the current locale.
|
| 405 |
+
|
| 406 |
+
>>> get_minus_sign_symbol('en_US')
|
| 407 |
+
'-'
|
| 408 |
+
>>> get_minus_sign_symbol('ar_EG', numbering_system='default')
|
| 409 |
+
'\\u061c-'
|
| 410 |
+
>>> get_minus_sign_symbol('ar_EG', numbering_system='latn')
|
| 411 |
+
'\\u200e-'
|
| 412 |
+
|
| 413 |
+
:param locale: the `Locale` object or locale identifier. Defaults to the system numeric locale.
|
| 414 |
+
:param numbering_system: The numbering system used for fetching the symbol. Defaults to "latn".
|
| 415 |
+
The special value "default" will use the default numbering system of the locale.
|
| 416 |
+
:raise `UnsupportedNumberingSystemError`: if the numbering system is not supported by the locale.
|
| 417 |
+
"""
|
| 418 |
+
locale = Locale.parse(locale or LC_NUMERIC)
|
| 419 |
+
return _get_number_symbols(locale, numbering_system=numbering_system).get('minusSign', '-')
|
| 420 |
+
|
| 421 |
+
|
| 422 |
+
def get_exponential_symbol(
|
| 423 |
+
locale: Locale | str | None = None,
|
| 424 |
+
*,
|
| 425 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 426 |
+
) -> str:
|
| 427 |
+
"""Return the symbol used by the locale to separate mantissa and exponent.
|
| 428 |
+
|
| 429 |
+
>>> get_exponential_symbol('en_US')
|
| 430 |
+
'E'
|
| 431 |
+
>>> get_exponential_symbol('ar_EG', numbering_system='default')
|
| 432 |
+
'أس'
|
| 433 |
+
>>> get_exponential_symbol('ar_EG', numbering_system='latn')
|
| 434 |
+
'E'
|
| 435 |
+
|
| 436 |
+
:param locale: the `Locale` object or locale identifier. Defaults to the system numeric locale.
|
| 437 |
+
:param numbering_system: The numbering system used for fetching the symbol. Defaults to "latn".
|
| 438 |
+
The special value "default" will use the default numbering system of the locale.
|
| 439 |
+
:raise `UnsupportedNumberingSystemError`: if the numbering system is not supported by the locale.
|
| 440 |
+
"""
|
| 441 |
+
locale = Locale.parse(locale or LC_NUMERIC)
|
| 442 |
+
return _get_number_symbols(locale, numbering_system=numbering_system).get('exponential', 'E') # fmt: skip
|
| 443 |
+
|
| 444 |
+
|
| 445 |
+
def get_group_symbol(
|
| 446 |
+
locale: Locale | str | None = None,
|
| 447 |
+
*,
|
| 448 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 449 |
+
) -> str:
|
| 450 |
+
"""Return the symbol used by the locale to separate groups of thousands.
|
| 451 |
+
|
| 452 |
+
>>> get_group_symbol('en_US')
|
| 453 |
+
','
|
| 454 |
+
>>> get_group_symbol('ar_EG', numbering_system='default')
|
| 455 |
+
'٬'
|
| 456 |
+
>>> get_group_symbol('ar_EG', numbering_system='latn')
|
| 457 |
+
','
|
| 458 |
+
|
| 459 |
+
:param locale: the `Locale` object or locale identifier. Defaults to the system numeric locale.
|
| 460 |
+
:param numbering_system: The numbering system used for fetching the symbol. Defaults to "latn".
|
| 461 |
+
The special value "default" will use the default numbering system of the locale.
|
| 462 |
+
:raise `UnsupportedNumberingSystemError`: if the numbering system is not supported by the locale.
|
| 463 |
+
"""
|
| 464 |
+
locale = Locale.parse(locale or LC_NUMERIC)
|
| 465 |
+
return _get_number_symbols(locale, numbering_system=numbering_system).get('group', ',')
|
| 466 |
+
|
| 467 |
+
|
| 468 |
+
def get_infinity_symbol(
|
| 469 |
+
locale: Locale | str | None = None,
|
| 470 |
+
*,
|
| 471 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 472 |
+
) -> str:
|
| 473 |
+
"""Return the symbol used by the locale to represent infinity.
|
| 474 |
+
|
| 475 |
+
>>> get_infinity_symbol('en_US')
|
| 476 |
+
'∞'
|
| 477 |
+
>>> get_infinity_symbol('ar_EG', numbering_system='default')
|
| 478 |
+
'∞'
|
| 479 |
+
>>> get_infinity_symbol('ar_EG', numbering_system='latn')
|
| 480 |
+
'∞'
|
| 481 |
+
|
| 482 |
+
:param locale: the `Locale` object or locale identifier. Defaults to the system numeric locale.
|
| 483 |
+
:param numbering_system: The numbering system used for fetching the symbol. Defaults to "latn".
|
| 484 |
+
The special value "default" will use the default numbering system of the locale.
|
| 485 |
+
:raise `UnsupportedNumberingSystemError`: if the numbering system is not supported by the locale.
|
| 486 |
+
"""
|
| 487 |
+
locale = Locale.parse(locale or LC_NUMERIC)
|
| 488 |
+
return _get_number_symbols(locale, numbering_system=numbering_system).get('infinity', '∞')
|
| 489 |
+
|
| 490 |
+
|
| 491 |
+
def format_number(
|
| 492 |
+
number: float | decimal.Decimal | str,
|
| 493 |
+
locale: Locale | str | None = None,
|
| 494 |
+
) -> str:
|
| 495 |
+
"""Return the given number formatted for a specific locale.
|
| 496 |
+
|
| 497 |
+
>>> format_number(1099, locale='en_US') # doctest: +SKIP
|
| 498 |
+
'1,099'
|
| 499 |
+
>>> format_number(1099, locale='de_DE') # doctest: +SKIP
|
| 500 |
+
'1.099'
|
| 501 |
+
|
| 502 |
+
.. deprecated:: 2.6.0
|
| 503 |
+
|
| 504 |
+
Use babel.numbers.format_decimal() instead.
|
| 505 |
+
|
| 506 |
+
:param number: the number to format
|
| 507 |
+
:param locale: the `Locale` object or locale identifier. Defaults to the system numeric locale.
|
| 508 |
+
|
| 509 |
+
|
| 510 |
+
"""
|
| 511 |
+
warnings.warn(
|
| 512 |
+
'Use babel.numbers.format_decimal() instead.',
|
| 513 |
+
DeprecationWarning,
|
| 514 |
+
stacklevel=2,
|
| 515 |
+
)
|
| 516 |
+
return format_decimal(number, locale=locale)
|
| 517 |
+
|
| 518 |
+
|
| 519 |
+
def get_decimal_precision(number: decimal.Decimal) -> int:
|
| 520 |
+
"""Return maximum precision of a decimal instance's fractional part.
|
| 521 |
+
|
| 522 |
+
Precision is extracted from the fractional part only.
|
| 523 |
+
"""
|
| 524 |
+
# Copied from: https://github.com/mahmoud/boltons/pull/59
|
| 525 |
+
assert isinstance(number, decimal.Decimal)
|
| 526 |
+
decimal_tuple = number.normalize().as_tuple()
|
| 527 |
+
# Note: DecimalTuple.exponent can be 'n' (qNaN), 'N' (sNaN), or 'F' (Infinity)
|
| 528 |
+
if not isinstance(decimal_tuple.exponent, int) or decimal_tuple.exponent >= 0:
|
| 529 |
+
return 0
|
| 530 |
+
return abs(decimal_tuple.exponent)
|
| 531 |
+
|
| 532 |
+
|
| 533 |
+
def get_decimal_quantum(precision: int | decimal.Decimal) -> decimal.Decimal:
|
| 534 |
+
"""Return minimal quantum of a number, as defined by precision."""
|
| 535 |
+
assert isinstance(precision, (int, decimal.Decimal))
|
| 536 |
+
return decimal.Decimal(10) ** (-precision)
|
| 537 |
+
|
| 538 |
+
|
| 539 |
+
def format_decimal(
|
| 540 |
+
number: float | decimal.Decimal | str,
|
| 541 |
+
format: str | NumberPattern | None = None,
|
| 542 |
+
locale: Locale | str | None = None,
|
| 543 |
+
decimal_quantization: bool = True,
|
| 544 |
+
group_separator: bool = True,
|
| 545 |
+
*,
|
| 546 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 547 |
+
) -> str:
|
| 548 |
+
"""Return the given decimal number formatted for a specific locale.
|
| 549 |
+
|
| 550 |
+
>>> format_decimal(1.2345, locale='en_US')
|
| 551 |
+
'1.234'
|
| 552 |
+
>>> format_decimal(1.2346, locale='en_US')
|
| 553 |
+
'1.235'
|
| 554 |
+
>>> format_decimal(-1.2346, locale='en_US')
|
| 555 |
+
'-1.235'
|
| 556 |
+
>>> format_decimal(1.2345, locale='sv_SE')
|
| 557 |
+
'1,234'
|
| 558 |
+
>>> format_decimal(1.2345, locale='de')
|
| 559 |
+
'1,234'
|
| 560 |
+
>>> format_decimal(1.2345, locale='ar_EG', numbering_system='default')
|
| 561 |
+
'1٫234'
|
| 562 |
+
>>> format_decimal(1.2345, locale='ar_EG', numbering_system='latn')
|
| 563 |
+
'1.234'
|
| 564 |
+
|
| 565 |
+
The appropriate thousands grouping and the decimal separator are used for
|
| 566 |
+
each locale:
|
| 567 |
+
|
| 568 |
+
>>> format_decimal(12345.5, locale='en_US')
|
| 569 |
+
'12,345.5'
|
| 570 |
+
|
| 571 |
+
By default the locale is allowed to truncate and round a high-precision
|
| 572 |
+
number by forcing its format pattern onto the decimal part. You can bypass
|
| 573 |
+
this behavior with the `decimal_quantization` parameter:
|
| 574 |
+
|
| 575 |
+
>>> format_decimal(1.2346, locale='en_US')
|
| 576 |
+
'1.235'
|
| 577 |
+
>>> format_decimal(1.2346, locale='en_US', decimal_quantization=False)
|
| 578 |
+
'1.2346'
|
| 579 |
+
>>> format_decimal(12345.67, locale='fr_CA', group_separator=False)
|
| 580 |
+
'12345,67'
|
| 581 |
+
>>> format_decimal(12345.67, locale='en_US', group_separator=True)
|
| 582 |
+
'12,345.67'
|
| 583 |
+
|
| 584 |
+
:param number: the number to format
|
| 585 |
+
:param format:
|
| 586 |
+
:param locale: the `Locale` object or locale identifier. Defaults to the system numeric locale.
|
| 587 |
+
:param decimal_quantization: Truncate and round high-precision numbers to
|
| 588 |
+
the format pattern. Defaults to `True`.
|
| 589 |
+
:param group_separator: Boolean to switch group separator on/off in a locale's
|
| 590 |
+
number format.
|
| 591 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 592 |
+
The special value "default" will use the default numbering system of the locale.
|
| 593 |
+
:raise `UnsupportedNumberingSystemError`: If the numbering system is not supported by the locale.
|
| 594 |
+
"""
|
| 595 |
+
locale = Locale.parse(locale or LC_NUMERIC)
|
| 596 |
+
if format is None:
|
| 597 |
+
format = locale.decimal_formats[format]
|
| 598 |
+
pattern = parse_pattern(format)
|
| 599 |
+
return pattern.apply(
|
| 600 |
+
number,
|
| 601 |
+
locale,
|
| 602 |
+
decimal_quantization=decimal_quantization,
|
| 603 |
+
group_separator=group_separator,
|
| 604 |
+
numbering_system=numbering_system,
|
| 605 |
+
)
|
| 606 |
+
|
| 607 |
+
|
| 608 |
+
def format_compact_decimal(
|
| 609 |
+
number: float | decimal.Decimal | str,
|
| 610 |
+
*,
|
| 611 |
+
format_type: Literal["short", "long"] = "short",
|
| 612 |
+
locale: Locale | str | None = None,
|
| 613 |
+
fraction_digits: int = 0,
|
| 614 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 615 |
+
) -> str:
|
| 616 |
+
"""Return the given decimal number formatted for a specific locale in compact form.
|
| 617 |
+
|
| 618 |
+
>>> format_compact_decimal(12345, format_type="short", locale='en_US')
|
| 619 |
+
'12K'
|
| 620 |
+
>>> format_compact_decimal(12345, format_type="long", locale='en_US')
|
| 621 |
+
'12 thousand'
|
| 622 |
+
>>> format_compact_decimal(12345, format_type="short", locale='en_US', fraction_digits=2)
|
| 623 |
+
'12.34K'
|
| 624 |
+
>>> format_compact_decimal(1234567, format_type="short", locale="ja_JP")
|
| 625 |
+
'123万'
|
| 626 |
+
>>> format_compact_decimal(2345678, format_type="long", locale="mk")
|
| 627 |
+
'2 милиони'
|
| 628 |
+
>>> format_compact_decimal(21000000, format_type="long", locale="mk")
|
| 629 |
+
'21 милион'
|
| 630 |
+
>>> format_compact_decimal(12345, format_type="short", locale='ar_EG', fraction_digits=2, numbering_system='default')
|
| 631 |
+
'12٫34\\xa0ألف'
|
| 632 |
+
|
| 633 |
+
:param number: the number to format
|
| 634 |
+
:param format_type: Compact format to use ("short" or "long")
|
| 635 |
+
:param locale: the `Locale` object or locale identifier. Defaults to the system numeric locale.
|
| 636 |
+
:param fraction_digits: Number of digits after the decimal point to use. Defaults to `0`.
|
| 637 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 638 |
+
The special value "default" will use the default numbering system of the locale.
|
| 639 |
+
:raise `UnsupportedNumberingSystemError`: If the numbering system is not supported by the locale.
|
| 640 |
+
"""
|
| 641 |
+
locale = Locale.parse(locale or LC_NUMERIC)
|
| 642 |
+
compact_format = locale.compact_decimal_formats[format_type]
|
| 643 |
+
number, format = _get_compact_format(number, compact_format, locale, fraction_digits)
|
| 644 |
+
# Did not find a format, fall back.
|
| 645 |
+
if format is None:
|
| 646 |
+
format = locale.decimal_formats[None]
|
| 647 |
+
pattern = parse_pattern(format)
|
| 648 |
+
return pattern.apply(
|
| 649 |
+
number,
|
| 650 |
+
locale,
|
| 651 |
+
decimal_quantization=False,
|
| 652 |
+
numbering_system=numbering_system,
|
| 653 |
+
)
|
| 654 |
+
|
| 655 |
+
|
| 656 |
+
def _get_compact_format(
|
| 657 |
+
number: float | decimal.Decimal | str,
|
| 658 |
+
compact_format: LocaleDataDict,
|
| 659 |
+
locale: Locale,
|
| 660 |
+
fraction_digits: int,
|
| 661 |
+
) -> tuple[decimal.Decimal, NumberPattern | None]:
|
| 662 |
+
"""Returns the number after dividing by the unit and the format pattern to use.
|
| 663 |
+
The algorithm is described here:
|
| 664 |
+
https://www.unicode.org/reports/tr35/tr35-45/tr35-numbers.html#Compact_Number_Formats.
|
| 665 |
+
"""
|
| 666 |
+
if not isinstance(number, decimal.Decimal):
|
| 667 |
+
number = decimal.Decimal(str(number))
|
| 668 |
+
if number.is_nan() or number.is_infinite():
|
| 669 |
+
return number, None
|
| 670 |
+
format = None
|
| 671 |
+
for magnitude in sorted([int(m) for m in compact_format["other"]], reverse=True):
|
| 672 |
+
if abs(number) >= magnitude:
|
| 673 |
+
# check the pattern using "other" as the amount
|
| 674 |
+
format = compact_format["other"][str(magnitude)]
|
| 675 |
+
pattern = parse_pattern(format).pattern
|
| 676 |
+
# if the pattern is "0", we do not divide the number
|
| 677 |
+
if pattern == "0":
|
| 678 |
+
break
|
| 679 |
+
# otherwise, we need to divide the number by the magnitude but remove zeros
|
| 680 |
+
# equal to the number of 0's in the pattern minus 1
|
| 681 |
+
number = cast(
|
| 682 |
+
decimal.Decimal,
|
| 683 |
+
number / (magnitude // (10 ** (pattern.count("0") - 1))),
|
| 684 |
+
)
|
| 685 |
+
# round to the number of fraction digits requested
|
| 686 |
+
rounded = round(number, fraction_digits)
|
| 687 |
+
# if the remaining number is singular, use the singular format
|
| 688 |
+
plural_form = locale.plural_form(abs(number))
|
| 689 |
+
if plural_form not in compact_format:
|
| 690 |
+
plural_form = "other"
|
| 691 |
+
if number == 1 and "1" in compact_format:
|
| 692 |
+
plural_form = "1"
|
| 693 |
+
if str(magnitude) not in compact_format[plural_form]:
|
| 694 |
+
plural_form = "other" # fall back to other as the implicit default
|
| 695 |
+
format = compact_format[plural_form][str(magnitude)]
|
| 696 |
+
number = rounded
|
| 697 |
+
break
|
| 698 |
+
return number, format
|
| 699 |
+
|
| 700 |
+
|
| 701 |
+
class UnknownCurrencyFormatError(KeyError):
|
| 702 |
+
"""Exception raised when an unknown currency format is requested."""
|
| 703 |
+
|
| 704 |
+
|
| 705 |
+
def format_currency(
|
| 706 |
+
number: float | decimal.Decimal | str,
|
| 707 |
+
currency: str,
|
| 708 |
+
format: str | NumberPattern | None = None,
|
| 709 |
+
locale: Locale | str | None = None,
|
| 710 |
+
currency_digits: bool = True,
|
| 711 |
+
format_type: Literal["name", "standard", "accounting"] = "standard",
|
| 712 |
+
decimal_quantization: bool = True,
|
| 713 |
+
group_separator: bool = True,
|
| 714 |
+
*,
|
| 715 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 716 |
+
) -> str:
|
| 717 |
+
"""Return formatted currency value.
|
| 718 |
+
|
| 719 |
+
>>> format_currency(1099.98, 'USD', locale='en_US')
|
| 720 |
+
'$1,099.98'
|
| 721 |
+
>>> format_currency(1099.98, 'USD', locale='es_CO')
|
| 722 |
+
'US$1.099,98'
|
| 723 |
+
>>> format_currency(1099.98, 'EUR', locale='de_DE')
|
| 724 |
+
'1.099,98\\xa0\\u20ac'
|
| 725 |
+
>>> format_currency(1099.98, 'EGP', locale='ar_EG', numbering_system='default')
|
| 726 |
+
'\\u200f1٬099٫98\\xa0ج.م.\\u200f'
|
| 727 |
+
|
| 728 |
+
The format can also be specified explicitly. The currency is
|
| 729 |
+
placed with the '¤' sign. As the sign gets repeated the format
|
| 730 |
+
expands (¤ being the symbol, ¤¤ is the currency abbreviation and
|
| 731 |
+
¤¤¤ is the full name of the currency):
|
| 732 |
+
|
| 733 |
+
>>> format_currency(1099.98, 'EUR', '\\xa4\\xa4 #,##0.00', locale='en_US')
|
| 734 |
+
'EUR 1,099.98'
|
| 735 |
+
>>> format_currency(1099.98, 'EUR', '#,##0.00 \\xa4\\xa4\\xa4', locale='en_US')
|
| 736 |
+
'1,099.98 euros'
|
| 737 |
+
|
| 738 |
+
Currencies usually have a specific number of decimal digits. This function
|
| 739 |
+
favours that information over the given format:
|
| 740 |
+
|
| 741 |
+
>>> format_currency(1099.98, 'JPY', locale='en_US')
|
| 742 |
+
'\\xa51,100'
|
| 743 |
+
>>> format_currency(1099.98, 'COP', '#,##0.00', locale='es_ES')
|
| 744 |
+
'1.099,98'
|
| 745 |
+
|
| 746 |
+
However, the number of decimal digits can be overridden from the currency
|
| 747 |
+
information, by setting the last parameter to ``False``:
|
| 748 |
+
|
| 749 |
+
>>> format_currency(1099.98, 'JPY', locale='en_US', currency_digits=False)
|
| 750 |
+
'\\xa51,099.98'
|
| 751 |
+
>>> format_currency(1099.98, 'COP', '#,##0.00', locale='es_ES', currency_digits=False)
|
| 752 |
+
'1.099,98'
|
| 753 |
+
|
| 754 |
+
If a format is not specified the type of currency format to use
|
| 755 |
+
from the locale can be specified:
|
| 756 |
+
|
| 757 |
+
>>> format_currency(1099.98, 'EUR', locale='en_US', format_type='standard')
|
| 758 |
+
'\\u20ac1,099.98'
|
| 759 |
+
|
| 760 |
+
When the given currency format type is not available, an exception is
|
| 761 |
+
raised:
|
| 762 |
+
|
| 763 |
+
>>> format_currency('1099.98', 'EUR', locale='root', format_type='unknown')
|
| 764 |
+
Traceback (most recent call last):
|
| 765 |
+
...
|
| 766 |
+
UnknownCurrencyFormatError: "'unknown' is not a known currency format type"
|
| 767 |
+
|
| 768 |
+
>>> format_currency(101299.98, 'USD', locale='en_US', group_separator=False)
|
| 769 |
+
'$101299.98'
|
| 770 |
+
|
| 771 |
+
>>> format_currency(101299.98, 'USD', locale='en_US', group_separator=True)
|
| 772 |
+
'$101,299.98'
|
| 773 |
+
|
| 774 |
+
You can also pass format_type='name' to use long display names. The order of
|
| 775 |
+
the number and currency name, along with the correct localized plural form
|
| 776 |
+
of the currency name, is chosen according to locale:
|
| 777 |
+
|
| 778 |
+
>>> format_currency(1, 'USD', locale='en_US', format_type='name')
|
| 779 |
+
'1.00 US dollar'
|
| 780 |
+
>>> format_currency(1099.98, 'USD', locale='en_US', format_type='name')
|
| 781 |
+
'1,099.98 US dollars'
|
| 782 |
+
>>> format_currency(1099.98, 'USD', locale='ee', format_type='name')
|
| 783 |
+
'us ga dollar 1,099.98'
|
| 784 |
+
|
| 785 |
+
By default the locale is allowed to truncate and round a high-precision
|
| 786 |
+
number by forcing its format pattern onto the decimal part. You can bypass
|
| 787 |
+
this behavior with the `decimal_quantization` parameter:
|
| 788 |
+
|
| 789 |
+
>>> format_currency(1099.9876, 'USD', locale='en_US')
|
| 790 |
+
'$1,099.99'
|
| 791 |
+
>>> format_currency(1099.9876, 'USD', locale='en_US', decimal_quantization=False)
|
| 792 |
+
'$1,099.9876'
|
| 793 |
+
|
| 794 |
+
:param number: the number to format
|
| 795 |
+
:param currency: the currency code
|
| 796 |
+
:param format: the format string to use
|
| 797 |
+
:param locale: the `Locale` object or locale identifier.
|
| 798 |
+
Defaults to the system currency locale or numeric locale.
|
| 799 |
+
:param currency_digits: use the currency's natural number of decimal digits
|
| 800 |
+
:param format_type: the currency format type to use
|
| 801 |
+
:param decimal_quantization: Truncate and round high-precision numbers to
|
| 802 |
+
the format pattern. Defaults to `True`.
|
| 803 |
+
:param group_separator: Boolean to switch group separator on/off in a locale's
|
| 804 |
+
number format.
|
| 805 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 806 |
+
The special value "default" will use the default numbering system of the locale.
|
| 807 |
+
:raise `UnsupportedNumberingSystemError`: If the numbering system is not supported by the locale.
|
| 808 |
+
"""
|
| 809 |
+
locale = Locale.parse(locale or LC_MONETARY)
|
| 810 |
+
|
| 811 |
+
if format_type == 'name':
|
| 812 |
+
return _format_currency_long_name(
|
| 813 |
+
number,
|
| 814 |
+
currency,
|
| 815 |
+
locale=locale,
|
| 816 |
+
format=format,
|
| 817 |
+
currency_digits=currency_digits,
|
| 818 |
+
decimal_quantization=decimal_quantization,
|
| 819 |
+
group_separator=group_separator,
|
| 820 |
+
numbering_system=numbering_system,
|
| 821 |
+
)
|
| 822 |
+
|
| 823 |
+
if format:
|
| 824 |
+
pattern = parse_pattern(format)
|
| 825 |
+
else:
|
| 826 |
+
try:
|
| 827 |
+
pattern = locale.currency_formats[format_type]
|
| 828 |
+
except KeyError:
|
| 829 |
+
raise UnknownCurrencyFormatError(
|
| 830 |
+
f"{format_type!r} is not a known currency format type",
|
| 831 |
+
) from None
|
| 832 |
+
|
| 833 |
+
return pattern.apply(
|
| 834 |
+
number,
|
| 835 |
+
locale,
|
| 836 |
+
currency=currency,
|
| 837 |
+
currency_digits=currency_digits,
|
| 838 |
+
decimal_quantization=decimal_quantization,
|
| 839 |
+
group_separator=group_separator,
|
| 840 |
+
numbering_system=numbering_system,
|
| 841 |
+
)
|
| 842 |
+
|
| 843 |
+
|
| 844 |
+
def _format_currency_long_name(
|
| 845 |
+
number: float | decimal.Decimal | str,
|
| 846 |
+
currency: str,
|
| 847 |
+
*,
|
| 848 |
+
locale: Locale,
|
| 849 |
+
format: str | NumberPattern | None,
|
| 850 |
+
currency_digits: bool,
|
| 851 |
+
decimal_quantization: bool,
|
| 852 |
+
group_separator: bool,
|
| 853 |
+
numbering_system: Literal["default"] | str,
|
| 854 |
+
) -> str:
|
| 855 |
+
# Algorithm described here:
|
| 856 |
+
# https://www.unicode.org/reports/tr35/tr35-numbers.html#Currencies
|
| 857 |
+
|
| 858 |
+
# Step 1.
|
| 859 |
+
# There are no examples of items with explicit count (0 or 1) in current
|
| 860 |
+
# locale data. So there is no point implementing that.
|
| 861 |
+
# Step 2.
|
| 862 |
+
|
| 863 |
+
# Correct number to numeric type, important for looking up plural rules:
|
| 864 |
+
number_n = float(number) if isinstance(number, str) else number
|
| 865 |
+
|
| 866 |
+
# Step 3.
|
| 867 |
+
unit_pattern = get_currency_unit_pattern(currency, count=number_n, locale=locale)
|
| 868 |
+
|
| 869 |
+
# Step 4.
|
| 870 |
+
display_name = get_currency_name(currency, count=number_n, locale=locale)
|
| 871 |
+
|
| 872 |
+
# Step 5.
|
| 873 |
+
if not format:
|
| 874 |
+
format = locale.decimal_formats[None]
|
| 875 |
+
|
| 876 |
+
pattern = parse_pattern(format)
|
| 877 |
+
|
| 878 |
+
number_part = pattern.apply(
|
| 879 |
+
number,
|
| 880 |
+
locale,
|
| 881 |
+
currency=currency,
|
| 882 |
+
currency_digits=currency_digits,
|
| 883 |
+
decimal_quantization=decimal_quantization,
|
| 884 |
+
group_separator=group_separator,
|
| 885 |
+
numbering_system=numbering_system,
|
| 886 |
+
)
|
| 887 |
+
|
| 888 |
+
return unit_pattern.format(number_part, display_name)
|
| 889 |
+
|
| 890 |
+
|
| 891 |
+
def format_compact_currency(
|
| 892 |
+
number: float | decimal.Decimal | str,
|
| 893 |
+
currency: str,
|
| 894 |
+
*,
|
| 895 |
+
format_type: Literal["short"] = "short",
|
| 896 |
+
locale: Locale | str | None = None,
|
| 897 |
+
fraction_digits: int = 0,
|
| 898 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 899 |
+
) -> str:
|
| 900 |
+
"""Format a number as a currency value in compact form.
|
| 901 |
+
|
| 902 |
+
>>> format_compact_currency(12345, 'USD', locale='en_US')
|
| 903 |
+
'$12K'
|
| 904 |
+
>>> format_compact_currency(123456789, 'USD', locale='en_US', fraction_digits=2)
|
| 905 |
+
'$123.46M'
|
| 906 |
+
>>> format_compact_currency(123456789, 'EUR', locale='de_DE', fraction_digits=1)
|
| 907 |
+
'123,5\\xa0Mio.\\xa0€'
|
| 908 |
+
|
| 909 |
+
:param number: the number to format
|
| 910 |
+
:param currency: the currency code
|
| 911 |
+
:param format_type: the compact format type to use. Defaults to "short".
|
| 912 |
+
:param locale: the `Locale` object or locale identifier.
|
| 913 |
+
Defaults to the system currency locale or numeric locale.
|
| 914 |
+
:param fraction_digits: Number of digits after the decimal point to use. Defaults to `0`.
|
| 915 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 916 |
+
The special value "default" will use the default numbering system of the locale.
|
| 917 |
+
:raise `UnsupportedNumberingSystemError`: If the numbering system is not supported by the locale.
|
| 918 |
+
"""
|
| 919 |
+
locale = Locale.parse(locale or LC_MONETARY)
|
| 920 |
+
try:
|
| 921 |
+
compact_format = locale.compact_currency_formats[format_type]
|
| 922 |
+
except KeyError as error:
|
| 923 |
+
raise UnknownCurrencyFormatError(
|
| 924 |
+
f"{format_type!r} is not a known compact currency format type",
|
| 925 |
+
) from error
|
| 926 |
+
number, format = _get_compact_format(number, compact_format, locale, fraction_digits)
|
| 927 |
+
# Did not find a format, fall back.
|
| 928 |
+
if format is None or "¤" not in str(format):
|
| 929 |
+
# find first format that has a currency symbol
|
| 930 |
+
for magnitude in compact_format['other']:
|
| 931 |
+
format = compact_format['other'][magnitude].pattern
|
| 932 |
+
if '¤' not in format:
|
| 933 |
+
continue
|
| 934 |
+
# remove characters that are not the currency symbol, 0's or spaces
|
| 935 |
+
format = re.sub(r'[^0\s\¤]', '', format)
|
| 936 |
+
# compress adjacent spaces into one
|
| 937 |
+
format = re.sub(r'(\s)\s+', r'\1', format).strip()
|
| 938 |
+
break
|
| 939 |
+
if format is None:
|
| 940 |
+
raise ValueError('No compact currency format found for the given number and locale.')
|
| 941 |
+
pattern = parse_pattern(format)
|
| 942 |
+
return pattern.apply(
|
| 943 |
+
number,
|
| 944 |
+
locale,
|
| 945 |
+
currency=currency,
|
| 946 |
+
currency_digits=False,
|
| 947 |
+
decimal_quantization=False,
|
| 948 |
+
numbering_system=numbering_system,
|
| 949 |
+
)
|
| 950 |
+
|
| 951 |
+
|
| 952 |
+
def format_percent(
|
| 953 |
+
number: float | decimal.Decimal | str,
|
| 954 |
+
format: str | NumberPattern | None = None,
|
| 955 |
+
locale: Locale | str | None = None,
|
| 956 |
+
decimal_quantization: bool = True,
|
| 957 |
+
group_separator: bool = True,
|
| 958 |
+
*,
|
| 959 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 960 |
+
) -> str:
|
| 961 |
+
"""Return formatted percent value for a specific locale.
|
| 962 |
+
|
| 963 |
+
>>> format_percent(0.34, locale='en_US')
|
| 964 |
+
'34%'
|
| 965 |
+
>>> format_percent(25.1234, locale='en_US')
|
| 966 |
+
'2,512%'
|
| 967 |
+
>>> format_percent(25.1234, locale='sv_SE')
|
| 968 |
+
'2\\xa0512\\xa0%'
|
| 969 |
+
>>> format_percent(25.1234, locale='ar_EG', numbering_system='default')
|
| 970 |
+
'2٬512%'
|
| 971 |
+
|
| 972 |
+
The format pattern can also be specified explicitly:
|
| 973 |
+
|
| 974 |
+
>>> format_percent(25.1234, '#,##0\\u2030', locale='en_US')
|
| 975 |
+
'25,123‰'
|
| 976 |
+
|
| 977 |
+
By default the locale is allowed to truncate and round a high-precision
|
| 978 |
+
number by forcing its format pattern onto the decimal part. You can bypass
|
| 979 |
+
this behavior with the `decimal_quantization` parameter:
|
| 980 |
+
|
| 981 |
+
>>> format_percent(23.9876, locale='en_US')
|
| 982 |
+
'2,399%'
|
| 983 |
+
>>> format_percent(23.9876, locale='en_US', decimal_quantization=False)
|
| 984 |
+
'2,398.76%'
|
| 985 |
+
|
| 986 |
+
>>> format_percent(229291.1234, locale='pt_BR', group_separator=False)
|
| 987 |
+
'22929112%'
|
| 988 |
+
|
| 989 |
+
>>> format_percent(229291.1234, locale='pt_BR', group_separator=True)
|
| 990 |
+
'22.929.112%'
|
| 991 |
+
|
| 992 |
+
:param number: the percent number to format
|
| 993 |
+
:param format:
|
| 994 |
+
:param locale: the `Locale` object or locale identifier. Defaults to the system numeric locale.
|
| 995 |
+
:param decimal_quantization: Truncate and round high-precision numbers to
|
| 996 |
+
the format pattern. Defaults to `True`.
|
| 997 |
+
:param group_separator: Boolean to switch group separator on/off in a locale's
|
| 998 |
+
number format.
|
| 999 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 1000 |
+
The special value "default" will use the default numbering system of the locale.
|
| 1001 |
+
:raise `UnsupportedNumberingSystemError`: If the numbering system is not supported by the locale.
|
| 1002 |
+
"""
|
| 1003 |
+
locale = Locale.parse(locale or LC_NUMERIC)
|
| 1004 |
+
if not format:
|
| 1005 |
+
format = locale.percent_formats[None]
|
| 1006 |
+
pattern = parse_pattern(format)
|
| 1007 |
+
return pattern.apply(
|
| 1008 |
+
number,
|
| 1009 |
+
locale,
|
| 1010 |
+
decimal_quantization=decimal_quantization,
|
| 1011 |
+
group_separator=group_separator,
|
| 1012 |
+
numbering_system=numbering_system,
|
| 1013 |
+
)
|
| 1014 |
+
|
| 1015 |
+
|
| 1016 |
+
def format_scientific(
|
| 1017 |
+
number: float | decimal.Decimal | str,
|
| 1018 |
+
format: str | NumberPattern | None = None,
|
| 1019 |
+
locale: Locale | str | None = None,
|
| 1020 |
+
decimal_quantization: bool = True,
|
| 1021 |
+
*,
|
| 1022 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 1023 |
+
) -> str:
|
| 1024 |
+
"""Return value formatted in scientific notation for a specific locale.
|
| 1025 |
+
|
| 1026 |
+
>>> format_scientific(10000, locale='en_US')
|
| 1027 |
+
'1E4'
|
| 1028 |
+
>>> format_scientific(10000, locale='ar_EG', numbering_system='default')
|
| 1029 |
+
'1أس4'
|
| 1030 |
+
|
| 1031 |
+
The format pattern can also be specified explicitly:
|
| 1032 |
+
|
| 1033 |
+
>>> format_scientific(1234567, '##0.##E00', locale='en_US')
|
| 1034 |
+
'1.23E06'
|
| 1035 |
+
|
| 1036 |
+
By default the locale is allowed to truncate and round a high-precision
|
| 1037 |
+
number by forcing its format pattern onto the decimal part. You can bypass
|
| 1038 |
+
this behavior with the `decimal_quantization` parameter:
|
| 1039 |
+
|
| 1040 |
+
>>> format_scientific(1234.9876, '#.##E0', locale='en_US')
|
| 1041 |
+
'1.23E3'
|
| 1042 |
+
>>> format_scientific(1234.9876, '#.##E0', locale='en_US', decimal_quantization=False)
|
| 1043 |
+
'1.2349876E3'
|
| 1044 |
+
|
| 1045 |
+
:param number: the number to format
|
| 1046 |
+
:param format:
|
| 1047 |
+
:param locale: the `Locale` object or locale identifier. Defaults to the system numeric locale.
|
| 1048 |
+
:param decimal_quantization: Truncate and round high-precision numbers to
|
| 1049 |
+
the format pattern. Defaults to `True`.
|
| 1050 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 1051 |
+
The special value "default" will use the default numbering system of the locale.
|
| 1052 |
+
:raise `UnsupportedNumberingSystemError`: If the numbering system is not supported by the locale.
|
| 1053 |
+
"""
|
| 1054 |
+
locale = Locale.parse(locale or LC_NUMERIC)
|
| 1055 |
+
if not format:
|
| 1056 |
+
format = locale.scientific_formats[None]
|
| 1057 |
+
pattern = parse_pattern(format)
|
| 1058 |
+
return pattern.apply(
|
| 1059 |
+
number,
|
| 1060 |
+
locale,
|
| 1061 |
+
decimal_quantization=decimal_quantization,
|
| 1062 |
+
numbering_system=numbering_system,
|
| 1063 |
+
)
|
| 1064 |
+
|
| 1065 |
+
|
| 1066 |
+
class NumberFormatError(ValueError):
|
| 1067 |
+
"""Exception raised when a string cannot be parsed into a number."""
|
| 1068 |
+
|
| 1069 |
+
def __init__(self, message: str, suggestions: list[str] | None = None) -> None:
|
| 1070 |
+
super().__init__(message)
|
| 1071 |
+
#: a list of properly formatted numbers derived from the invalid input
|
| 1072 |
+
self.suggestions = suggestions
|
| 1073 |
+
|
| 1074 |
+
|
| 1075 |
+
SPACE_CHARS = {
|
| 1076 |
+
' ', # space
|
| 1077 |
+
'\xa0', # no-break space
|
| 1078 |
+
'\u202f', # narrow no-break space
|
| 1079 |
+
}
|
| 1080 |
+
|
| 1081 |
+
SPACE_CHARS_RE = re.compile('|'.join(SPACE_CHARS))
|
| 1082 |
+
|
| 1083 |
+
|
| 1084 |
+
def parse_number(
|
| 1085 |
+
string: str,
|
| 1086 |
+
locale: Locale | str | None = None,
|
| 1087 |
+
*,
|
| 1088 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 1089 |
+
) -> int:
|
| 1090 |
+
"""Parse localized number string into an integer.
|
| 1091 |
+
|
| 1092 |
+
>>> parse_number('1,099', locale='en_US')
|
| 1093 |
+
1099
|
| 1094 |
+
>>> parse_number('1.099', locale='de_DE')
|
| 1095 |
+
1099
|
| 1096 |
+
|
| 1097 |
+
When the given string cannot be parsed, an exception is raised:
|
| 1098 |
+
|
| 1099 |
+
>>> parse_number('1.099,98', locale='de')
|
| 1100 |
+
Traceback (most recent call last):
|
| 1101 |
+
...
|
| 1102 |
+
NumberFormatError: '1.099,98' is not a valid number
|
| 1103 |
+
|
| 1104 |
+
:param string: the string to parse
|
| 1105 |
+
:param locale: the `Locale` object or locale identifier. Defaults to the system numeric locale.
|
| 1106 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 1107 |
+
The special value "default" will use the default numbering system of the locale.
|
| 1108 |
+
:return: the parsed number
|
| 1109 |
+
:raise `NumberFormatError`: if the string can not be converted to a number
|
| 1110 |
+
:raise `UnsupportedNumberingSystemError`: if the numbering system is not supported by the locale.
|
| 1111 |
+
"""
|
| 1112 |
+
group_symbol = get_group_symbol(locale, numbering_system=numbering_system)
|
| 1113 |
+
|
| 1114 |
+
if (
|
| 1115 |
+
# if the grouping symbol is a kind of space,
|
| 1116 |
+
group_symbol in SPACE_CHARS
|
| 1117 |
+
# and the string to be parsed does not contain it,
|
| 1118 |
+
and group_symbol not in string
|
| 1119 |
+
# but it does contain any other kind of space instead,
|
| 1120 |
+
and SPACE_CHARS_RE.search(string)
|
| 1121 |
+
):
|
| 1122 |
+
# ... it's reasonable to assume it is taking the place of the grouping symbol.
|
| 1123 |
+
string = SPACE_CHARS_RE.sub(group_symbol, string)
|
| 1124 |
+
|
| 1125 |
+
try:
|
| 1126 |
+
return int(string.replace(group_symbol, ''))
|
| 1127 |
+
except ValueError as ve:
|
| 1128 |
+
raise NumberFormatError(f"{string!r} is not a valid number") from ve
|
| 1129 |
+
|
| 1130 |
+
|
| 1131 |
+
def parse_decimal(
|
| 1132 |
+
string: str,
|
| 1133 |
+
locale: Locale | str | None = None,
|
| 1134 |
+
strict: bool = False,
|
| 1135 |
+
*,
|
| 1136 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 1137 |
+
) -> decimal.Decimal:
|
| 1138 |
+
"""Parse localized decimal string into a decimal.
|
| 1139 |
+
|
| 1140 |
+
>>> parse_decimal('1,099.98', locale='en_US')
|
| 1141 |
+
Decimal('1099.98')
|
| 1142 |
+
>>> parse_decimal('1.099,98', locale='de')
|
| 1143 |
+
Decimal('1099.98')
|
| 1144 |
+
>>> parse_decimal('12 345,123', locale='ru')
|
| 1145 |
+
Decimal('12345.123')
|
| 1146 |
+
>>> parse_decimal('1٬099٫98', locale='ar_EG', numbering_system='default')
|
| 1147 |
+
Decimal('1099.98')
|
| 1148 |
+
|
| 1149 |
+
When the given string cannot be parsed, an exception is raised:
|
| 1150 |
+
|
| 1151 |
+
>>> parse_decimal('2,109,998', locale='de')
|
| 1152 |
+
Traceback (most recent call last):
|
| 1153 |
+
...
|
| 1154 |
+
NumberFormatError: '2,109,998' is not a valid decimal number
|
| 1155 |
+
|
| 1156 |
+
If `strict` is set to `True` and the given string contains a number
|
| 1157 |
+
formatted in an irregular way, an exception is raised:
|
| 1158 |
+
|
| 1159 |
+
>>> parse_decimal('30.00', locale='de', strict=True)
|
| 1160 |
+
Traceback (most recent call last):
|
| 1161 |
+
...
|
| 1162 |
+
NumberFormatError: '30.00' is not a properly formatted decimal number. Did you mean '3.000'? Or maybe '30,00'?
|
| 1163 |
+
|
| 1164 |
+
>>> parse_decimal('0.00', locale='de', strict=True)
|
| 1165 |
+
Traceback (most recent call last):
|
| 1166 |
+
...
|
| 1167 |
+
NumberFormatError: '0.00' is not a properly formatted decimal number. Did you mean '0'?
|
| 1168 |
+
|
| 1169 |
+
:param string: the string to parse
|
| 1170 |
+
:param locale: the `Locale` object or locale identifier. Defaults to the system numeric locale.
|
| 1171 |
+
:param strict: controls whether numbers formatted in a weird way are
|
| 1172 |
+
accepted or rejected
|
| 1173 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 1174 |
+
The special value "default" will use the default numbering system of the locale.
|
| 1175 |
+
:raise NumberFormatError: if the string can not be converted to a
|
| 1176 |
+
decimal number
|
| 1177 |
+
:raise UnsupportedNumberingSystemError: if the numbering system is not supported by the locale.
|
| 1178 |
+
"""
|
| 1179 |
+
locale = Locale.parse(locale or LC_NUMERIC)
|
| 1180 |
+
group_symbol = get_group_symbol(locale, numbering_system=numbering_system)
|
| 1181 |
+
decimal_symbol = get_decimal_symbol(locale, numbering_system=numbering_system)
|
| 1182 |
+
|
| 1183 |
+
if not strict and (
|
| 1184 |
+
group_symbol in SPACE_CHARS # if the grouping symbol is a kind of space,
|
| 1185 |
+
and group_symbol not in string # and the string to be parsed does not contain it,
|
| 1186 |
+
# but it does contain any other kind of space instead,
|
| 1187 |
+
and SPACE_CHARS_RE.search(string)
|
| 1188 |
+
):
|
| 1189 |
+
# ... it's reasonable to assume it is taking the place of the grouping symbol.
|
| 1190 |
+
string = SPACE_CHARS_RE.sub(group_symbol, string)
|
| 1191 |
+
|
| 1192 |
+
try:
|
| 1193 |
+
parsed = decimal.Decimal(string.replace(group_symbol, '').replace(decimal_symbol, '.'))
|
| 1194 |
+
except decimal.InvalidOperation as exc:
|
| 1195 |
+
raise NumberFormatError(f"{string!r} is not a valid decimal number") from exc
|
| 1196 |
+
if strict and group_symbol in string:
|
| 1197 |
+
proper = format_decimal(
|
| 1198 |
+
parsed,
|
| 1199 |
+
locale=locale,
|
| 1200 |
+
decimal_quantization=False,
|
| 1201 |
+
numbering_system=numbering_system,
|
| 1202 |
+
)
|
| 1203 |
+
if string != proper and proper != _remove_trailing_zeros_after_decimal(string, decimal_symbol): # fmt: skip
|
| 1204 |
+
try:
|
| 1205 |
+
parsed_alt = decimal.Decimal(
|
| 1206 |
+
string.replace(decimal_symbol, '').replace(group_symbol, '.'),
|
| 1207 |
+
)
|
| 1208 |
+
except decimal.InvalidOperation as exc:
|
| 1209 |
+
raise NumberFormatError(
|
| 1210 |
+
f"{string!r} is not a properly formatted decimal number. "
|
| 1211 |
+
f"Did you mean {proper!r}?",
|
| 1212 |
+
suggestions=[proper],
|
| 1213 |
+
) from exc
|
| 1214 |
+
else:
|
| 1215 |
+
proper_alt = format_decimal(
|
| 1216 |
+
parsed_alt,
|
| 1217 |
+
locale=locale,
|
| 1218 |
+
decimal_quantization=False,
|
| 1219 |
+
numbering_system=numbering_system,
|
| 1220 |
+
)
|
| 1221 |
+
if proper_alt == proper:
|
| 1222 |
+
raise NumberFormatError(
|
| 1223 |
+
f"{string!r} is not a properly formatted decimal number. "
|
| 1224 |
+
f"Did you mean {proper!r}?",
|
| 1225 |
+
suggestions=[proper],
|
| 1226 |
+
)
|
| 1227 |
+
else:
|
| 1228 |
+
raise NumberFormatError(
|
| 1229 |
+
f"{string!r} is not a properly formatted decimal number. "
|
| 1230 |
+
f"Did you mean {proper!r}? Or maybe {proper_alt!r}?",
|
| 1231 |
+
suggestions=[proper, proper_alt],
|
| 1232 |
+
)
|
| 1233 |
+
return parsed
|
| 1234 |
+
|
| 1235 |
+
|
| 1236 |
+
def _remove_trailing_zeros_after_decimal(string: str, decimal_symbol: str) -> str:
|
| 1237 |
+
"""
|
| 1238 |
+
Remove trailing zeros from the decimal part of a numeric string.
|
| 1239 |
+
|
| 1240 |
+
This function takes a string representing a numeric value and a decimal symbol.
|
| 1241 |
+
It removes any trailing zeros that appear after the decimal symbol in the number.
|
| 1242 |
+
If the decimal part becomes empty after removing trailing zeros, the decimal symbol
|
| 1243 |
+
is also removed. If the string does not contain the decimal symbol, it is returned unchanged.
|
| 1244 |
+
|
| 1245 |
+
:param string: The numeric string from which to remove trailing zeros.
|
| 1246 |
+
:type string: str
|
| 1247 |
+
:param decimal_symbol: The symbol used to denote the decimal point.
|
| 1248 |
+
:type decimal_symbol: str
|
| 1249 |
+
:return: The numeric string with trailing zeros removed from its decimal part.
|
| 1250 |
+
:rtype: str
|
| 1251 |
+
|
| 1252 |
+
Example:
|
| 1253 |
+
>>> _remove_trailing_zeros_after_decimal("123.4500", ".")
|
| 1254 |
+
'123.45'
|
| 1255 |
+
>>> _remove_trailing_zeros_after_decimal("100.000", ".")
|
| 1256 |
+
'100'
|
| 1257 |
+
>>> _remove_trailing_zeros_after_decimal("100", ".")
|
| 1258 |
+
'100'
|
| 1259 |
+
"""
|
| 1260 |
+
integer_part, _, decimal_part = string.partition(decimal_symbol)
|
| 1261 |
+
|
| 1262 |
+
if decimal_part:
|
| 1263 |
+
decimal_part = decimal_part.rstrip("0")
|
| 1264 |
+
if decimal_part:
|
| 1265 |
+
return integer_part + decimal_symbol + decimal_part
|
| 1266 |
+
return integer_part
|
| 1267 |
+
|
| 1268 |
+
return string
|
| 1269 |
+
|
| 1270 |
+
|
| 1271 |
+
_number_pattern_re = re.compile(
|
| 1272 |
+
r"(?P<prefix>(?:[^'0-9@#.,]|'[^']*')*)"
|
| 1273 |
+
r"(?P<number>[0-9@#.,E+]*)"
|
| 1274 |
+
r"(?P<suffix>.*)",
|
| 1275 |
+
)
|
| 1276 |
+
|
| 1277 |
+
|
| 1278 |
+
def parse_grouping(p: str) -> tuple[int, int]:
|
| 1279 |
+
"""Parse primary and secondary digit grouping
|
| 1280 |
+
|
| 1281 |
+
>>> parse_grouping('##')
|
| 1282 |
+
(1000, 1000)
|
| 1283 |
+
>>> parse_grouping('#,###')
|
| 1284 |
+
(3, 3)
|
| 1285 |
+
>>> parse_grouping('#,####,###')
|
| 1286 |
+
(3, 4)
|
| 1287 |
+
"""
|
| 1288 |
+
width = len(p)
|
| 1289 |
+
g1 = p.rfind(',')
|
| 1290 |
+
if g1 == -1:
|
| 1291 |
+
return 1000, 1000
|
| 1292 |
+
g1 = width - g1 - 1
|
| 1293 |
+
g2 = p[: -g1 - 1].rfind(',')
|
| 1294 |
+
if g2 == -1:
|
| 1295 |
+
return g1, g1
|
| 1296 |
+
g2 = width - g1 - g2 - 2
|
| 1297 |
+
return g1, g2
|
| 1298 |
+
|
| 1299 |
+
|
| 1300 |
+
def parse_pattern(pattern: NumberPattern | str) -> NumberPattern:
|
| 1301 |
+
"""Parse number format patterns"""
|
| 1302 |
+
if isinstance(pattern, NumberPattern):
|
| 1303 |
+
return pattern
|
| 1304 |
+
|
| 1305 |
+
def _match_number(pattern):
|
| 1306 |
+
rv = _number_pattern_re.search(pattern)
|
| 1307 |
+
if rv is None:
|
| 1308 |
+
raise ValueError(f"Invalid number pattern {pattern!r}")
|
| 1309 |
+
return rv.groups()
|
| 1310 |
+
|
| 1311 |
+
pos_pattern = pattern
|
| 1312 |
+
|
| 1313 |
+
# Do we have a negative subpattern?
|
| 1314 |
+
if ';' in pattern:
|
| 1315 |
+
pos_pattern, neg_pattern = pattern.split(';', 1)
|
| 1316 |
+
pos_prefix, number, pos_suffix = _match_number(pos_pattern)
|
| 1317 |
+
neg_prefix, _, neg_suffix = _match_number(neg_pattern)
|
| 1318 |
+
else:
|
| 1319 |
+
pos_prefix, number, pos_suffix = _match_number(pos_pattern)
|
| 1320 |
+
neg_prefix = f"-{pos_prefix}"
|
| 1321 |
+
neg_suffix = pos_suffix
|
| 1322 |
+
if 'E' in number:
|
| 1323 |
+
number, exp = number.split('E', 1)
|
| 1324 |
+
else:
|
| 1325 |
+
exp = None
|
| 1326 |
+
if '@' in number and '.' in number and '0' in number:
|
| 1327 |
+
raise ValueError('Significant digit patterns can not contain "@" or "0"')
|
| 1328 |
+
if '.' in number:
|
| 1329 |
+
integer, fraction = number.rsplit('.', 1)
|
| 1330 |
+
else:
|
| 1331 |
+
integer = number
|
| 1332 |
+
fraction = ''
|
| 1333 |
+
|
| 1334 |
+
def parse_precision(p):
|
| 1335 |
+
"""Calculate the min and max allowed digits"""
|
| 1336 |
+
min = max = 0
|
| 1337 |
+
for c in p:
|
| 1338 |
+
if c in '@0':
|
| 1339 |
+
min += 1
|
| 1340 |
+
max += 1
|
| 1341 |
+
elif c == '#':
|
| 1342 |
+
max += 1
|
| 1343 |
+
elif c == ',':
|
| 1344 |
+
continue
|
| 1345 |
+
else:
|
| 1346 |
+
break
|
| 1347 |
+
return min, max
|
| 1348 |
+
|
| 1349 |
+
int_prec = parse_precision(integer)
|
| 1350 |
+
frac_prec = parse_precision(fraction)
|
| 1351 |
+
if exp:
|
| 1352 |
+
exp_plus = exp.startswith('+')
|
| 1353 |
+
exp = exp.lstrip('+')
|
| 1354 |
+
exp_prec = parse_precision(exp)
|
| 1355 |
+
else:
|
| 1356 |
+
exp_plus = None
|
| 1357 |
+
exp_prec = None
|
| 1358 |
+
grouping = parse_grouping(integer)
|
| 1359 |
+
return NumberPattern(
|
| 1360 |
+
pattern,
|
| 1361 |
+
(pos_prefix, neg_prefix),
|
| 1362 |
+
(pos_suffix, neg_suffix),
|
| 1363 |
+
grouping,
|
| 1364 |
+
int_prec,
|
| 1365 |
+
frac_prec,
|
| 1366 |
+
exp_prec,
|
| 1367 |
+
exp_plus,
|
| 1368 |
+
number,
|
| 1369 |
+
)
|
| 1370 |
+
|
| 1371 |
+
|
| 1372 |
+
class NumberPattern:
|
| 1373 |
+
def __init__(
|
| 1374 |
+
self,
|
| 1375 |
+
pattern: str,
|
| 1376 |
+
prefix: tuple[str, str],
|
| 1377 |
+
suffix: tuple[str, str],
|
| 1378 |
+
grouping: tuple[int, int],
|
| 1379 |
+
int_prec: tuple[int, int],
|
| 1380 |
+
frac_prec: tuple[int, int],
|
| 1381 |
+
exp_prec: tuple[int, int] | None,
|
| 1382 |
+
exp_plus: bool | None,
|
| 1383 |
+
number_pattern: str | None = None,
|
| 1384 |
+
) -> None:
|
| 1385 |
+
# Metadata of the decomposed parsed pattern.
|
| 1386 |
+
self.pattern = pattern
|
| 1387 |
+
self.prefix = prefix
|
| 1388 |
+
self.suffix = suffix
|
| 1389 |
+
self.number_pattern = number_pattern
|
| 1390 |
+
self.grouping = grouping
|
| 1391 |
+
self.int_prec = int_prec
|
| 1392 |
+
self.frac_prec = frac_prec
|
| 1393 |
+
self.exp_prec = exp_prec
|
| 1394 |
+
self.exp_plus = exp_plus
|
| 1395 |
+
self.scale = self.compute_scale()
|
| 1396 |
+
|
| 1397 |
+
def __repr__(self) -> str:
|
| 1398 |
+
return f"<{type(self).__name__} {self.pattern!r}>"
|
| 1399 |
+
|
| 1400 |
+
def compute_scale(self) -> Literal[0, 2, 3]:
|
| 1401 |
+
"""Return the scaling factor to apply to the number before rendering.
|
| 1402 |
+
|
| 1403 |
+
Auto-set to a factor of 2 or 3 if presence of a ``%`` or ``‰`` sign is
|
| 1404 |
+
detected in the prefix or suffix of the pattern. Default is to not mess
|
| 1405 |
+
with the scale at all and keep it to 0.
|
| 1406 |
+
"""
|
| 1407 |
+
scale = 0
|
| 1408 |
+
if '%' in ''.join(self.prefix + self.suffix):
|
| 1409 |
+
scale = 2
|
| 1410 |
+
elif '‰' in ''.join(self.prefix + self.suffix):
|
| 1411 |
+
scale = 3
|
| 1412 |
+
return scale
|
| 1413 |
+
|
| 1414 |
+
def scientific_notation_elements(
|
| 1415 |
+
self,
|
| 1416 |
+
value: decimal.Decimal,
|
| 1417 |
+
locale: Locale | str | None,
|
| 1418 |
+
*,
|
| 1419 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 1420 |
+
) -> tuple[decimal.Decimal, int, str]:
|
| 1421 |
+
"""Returns normalized scientific notation components of a value."""
|
| 1422 |
+
# Normalize value to only have one lead digit.
|
| 1423 |
+
exp = value.adjusted()
|
| 1424 |
+
value = value * get_decimal_quantum(exp)
|
| 1425 |
+
assert value.adjusted() == 0
|
| 1426 |
+
|
| 1427 |
+
# Shift exponent and value by the minimum number of leading digits
|
| 1428 |
+
# imposed by the rendering pattern. And always make that number
|
| 1429 |
+
# greater or equal to 1.
|
| 1430 |
+
lead_shift = max([1, min(self.int_prec)]) - 1
|
| 1431 |
+
exp = exp - lead_shift
|
| 1432 |
+
value = value * get_decimal_quantum(-lead_shift)
|
| 1433 |
+
|
| 1434 |
+
# Get exponent sign symbol.
|
| 1435 |
+
exp_sign = ''
|
| 1436 |
+
if exp < 0:
|
| 1437 |
+
exp_sign = get_minus_sign_symbol(locale, numbering_system=numbering_system)
|
| 1438 |
+
elif self.exp_plus:
|
| 1439 |
+
exp_sign = get_plus_sign_symbol(locale, numbering_system=numbering_system)
|
| 1440 |
+
|
| 1441 |
+
# Normalize exponent value now that we have the sign.
|
| 1442 |
+
exp = abs(exp)
|
| 1443 |
+
|
| 1444 |
+
return value, exp, exp_sign
|
| 1445 |
+
|
| 1446 |
+
def apply(
|
| 1447 |
+
self,
|
| 1448 |
+
value: float | decimal.Decimal | str,
|
| 1449 |
+
locale: Locale | str | None,
|
| 1450 |
+
currency: str | None = None,
|
| 1451 |
+
currency_digits: bool = True,
|
| 1452 |
+
decimal_quantization: bool = True,
|
| 1453 |
+
force_frac: tuple[int, int] | None = None,
|
| 1454 |
+
group_separator: bool = True,
|
| 1455 |
+
*,
|
| 1456 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 1457 |
+
):
|
| 1458 |
+
"""Renders into a string a number following the defined pattern.
|
| 1459 |
+
|
| 1460 |
+
Forced decimal quantization is active by default so we'll produce a
|
| 1461 |
+
number string that is strictly following CLDR pattern definitions.
|
| 1462 |
+
|
| 1463 |
+
:param value: The value to format. If this is not a Decimal object,
|
| 1464 |
+
it will be cast to one.
|
| 1465 |
+
:type value: decimal.Decimal|float|int
|
| 1466 |
+
:param locale: The locale to use for formatting.
|
| 1467 |
+
:type locale: str|babel.core.Locale
|
| 1468 |
+
:param currency: Which currency, if any, to format as.
|
| 1469 |
+
:type currency: str|None
|
| 1470 |
+
:param currency_digits: Whether or not to use the currency's precision.
|
| 1471 |
+
If false, the pattern's precision is used.
|
| 1472 |
+
:type currency_digits: bool
|
| 1473 |
+
:param decimal_quantization: Whether decimal numbers should be forcibly
|
| 1474 |
+
quantized to produce a formatted output
|
| 1475 |
+
strictly matching the CLDR definition for
|
| 1476 |
+
the locale.
|
| 1477 |
+
:type decimal_quantization: bool
|
| 1478 |
+
:param force_frac: DEPRECATED - a forced override for `self.frac_prec`
|
| 1479 |
+
for a single formatting invocation.
|
| 1480 |
+
:param group_separator: Whether to use the locale's number group separator.
|
| 1481 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 1482 |
+
The special value "default" will use the default numbering system of the locale.
|
| 1483 |
+
:return: Formatted decimal string.
|
| 1484 |
+
:rtype: str
|
| 1485 |
+
:raise UnsupportedNumberingSystemError: If the numbering system is not supported by the locale.
|
| 1486 |
+
"""
|
| 1487 |
+
if not isinstance(value, decimal.Decimal):
|
| 1488 |
+
value = decimal.Decimal(str(value))
|
| 1489 |
+
|
| 1490 |
+
value = value.scaleb(self.scale)
|
| 1491 |
+
|
| 1492 |
+
# Separate the absolute value from its sign.
|
| 1493 |
+
is_negative = int(value.is_signed())
|
| 1494 |
+
value = abs(value).normalize()
|
| 1495 |
+
|
| 1496 |
+
# Prepare scientific notation metadata.
|
| 1497 |
+
if self.exp_prec:
|
| 1498 |
+
value, exp, exp_sign = self.scientific_notation_elements(
|
| 1499 |
+
value,
|
| 1500 |
+
locale,
|
| 1501 |
+
numbering_system=numbering_system,
|
| 1502 |
+
)
|
| 1503 |
+
|
| 1504 |
+
# Adjust the precision of the fractional part and force it to the
|
| 1505 |
+
# currency's if necessary.
|
| 1506 |
+
if force_frac:
|
| 1507 |
+
# TODO (3.x?): Remove this parameter
|
| 1508 |
+
warnings.warn(
|
| 1509 |
+
'The force_frac parameter to NumberPattern.apply() is deprecated.',
|
| 1510 |
+
DeprecationWarning,
|
| 1511 |
+
stacklevel=2,
|
| 1512 |
+
)
|
| 1513 |
+
frac_prec = force_frac
|
| 1514 |
+
elif currency and currency_digits:
|
| 1515 |
+
frac_prec = (get_currency_precision(currency),) * 2
|
| 1516 |
+
else:
|
| 1517 |
+
frac_prec = self.frac_prec
|
| 1518 |
+
|
| 1519 |
+
# Bump decimal precision to the natural precision of the number if it
|
| 1520 |
+
# exceeds the one we're about to use. This adaptative precision is only
|
| 1521 |
+
# triggered if the decimal quantization is disabled or if a scientific
|
| 1522 |
+
# notation pattern has a missing mandatory fractional part (as in the
|
| 1523 |
+
# default '#E0' pattern). This special case has been extensively
|
| 1524 |
+
# discussed at https://github.com/python-babel/babel/pull/494#issuecomment-307649969 .
|
| 1525 |
+
if not decimal_quantization or (self.exp_prec and frac_prec == (0, 0)):
|
| 1526 |
+
frac_prec = (frac_prec[0], max([frac_prec[1], get_decimal_precision(value)]))
|
| 1527 |
+
|
| 1528 |
+
# Render scientific notation.
|
| 1529 |
+
if self.exp_prec:
|
| 1530 |
+
number = ''.join([
|
| 1531 |
+
self._quantize_value(value, locale, frac_prec, group_separator, numbering_system=numbering_system),
|
| 1532 |
+
get_exponential_symbol(locale, numbering_system=numbering_system),
|
| 1533 |
+
exp_sign, # type: ignore # exp_sign is always defined here
|
| 1534 |
+
self._format_int(str(exp), self.exp_prec[0], self.exp_prec[1], locale, numbering_system=numbering_system), # type: ignore # exp is always defined here
|
| 1535 |
+
]) # fmt: skip
|
| 1536 |
+
|
| 1537 |
+
# Is it a significant digits pattern?
|
| 1538 |
+
elif '@' in self.pattern:
|
| 1539 |
+
text = self._format_significant(value, self.int_prec[0], self.int_prec[1])
|
| 1540 |
+
a, sep, b = text.partition(".")
|
| 1541 |
+
number = self._format_int(a, 0, 1000, locale, numbering_system=numbering_system)
|
| 1542 |
+
if sep:
|
| 1543 |
+
number += get_decimal_symbol(locale, numbering_system=numbering_system) + b
|
| 1544 |
+
|
| 1545 |
+
# A normal number pattern.
|
| 1546 |
+
else:
|
| 1547 |
+
number = self._quantize_value(
|
| 1548 |
+
value,
|
| 1549 |
+
locale,
|
| 1550 |
+
frac_prec,
|
| 1551 |
+
group_separator,
|
| 1552 |
+
numbering_system=numbering_system,
|
| 1553 |
+
)
|
| 1554 |
+
|
| 1555 |
+
retval = ''.join(
|
| 1556 |
+
(
|
| 1557 |
+
self.prefix[is_negative],
|
| 1558 |
+
number if self.number_pattern != '' else '',
|
| 1559 |
+
self.suffix[is_negative],
|
| 1560 |
+
),
|
| 1561 |
+
)
|
| 1562 |
+
|
| 1563 |
+
if '¤' in retval and currency is not None:
|
| 1564 |
+
retval = retval.replace('¤¤¤', get_currency_name(currency, value, locale))
|
| 1565 |
+
retval = retval.replace('¤¤', currency.upper())
|
| 1566 |
+
retval = retval.replace('¤', get_currency_symbol(currency, locale))
|
| 1567 |
+
|
| 1568 |
+
# remove single quotes around text, except for doubled single quotes
|
| 1569 |
+
# which are replaced with a single quote
|
| 1570 |
+
retval = re.sub(r"'([^']*)'", lambda m: m.group(1) or "'", retval)
|
| 1571 |
+
|
| 1572 |
+
return retval
|
| 1573 |
+
|
| 1574 |
+
#
|
| 1575 |
+
# This is one tricky piece of code. The idea is to rely as much as possible
|
| 1576 |
+
# on the decimal module to minimize the amount of code.
|
| 1577 |
+
#
|
| 1578 |
+
# Conceptually, the implementation of this method can be summarized in the
|
| 1579 |
+
# following steps:
|
| 1580 |
+
#
|
| 1581 |
+
# - Move or shift the decimal point (i.e. the exponent) so the maximum
|
| 1582 |
+
# amount of significant digits fall into the integer part (i.e. to the
|
| 1583 |
+
# left of the decimal point)
|
| 1584 |
+
#
|
| 1585 |
+
# - Round the number to the nearest integer, discarding all the fractional
|
| 1586 |
+
# part which contained extra digits to be eliminated
|
| 1587 |
+
#
|
| 1588 |
+
# - Convert the rounded integer to a string, that will contain the final
|
| 1589 |
+
# sequence of significant digits already trimmed to the maximum
|
| 1590 |
+
#
|
| 1591 |
+
# - Restore the original position of the decimal point, potentially
|
| 1592 |
+
# padding with zeroes on either side
|
| 1593 |
+
#
|
| 1594 |
+
def _format_significant(self, value: decimal.Decimal, minimum: int, maximum: int) -> str:
|
| 1595 |
+
exp = value.adjusted()
|
| 1596 |
+
scale = maximum - 1 - exp
|
| 1597 |
+
digits = str(value.scaleb(scale).quantize(decimal.Decimal(1)))
|
| 1598 |
+
if scale <= 0:
|
| 1599 |
+
result = digits + '0' * -scale
|
| 1600 |
+
else:
|
| 1601 |
+
intpart = digits[:-scale]
|
| 1602 |
+
i = len(intpart)
|
| 1603 |
+
j = i + max(minimum - i, 0)
|
| 1604 |
+
result = "{intpart}.{pad:0<{fill}}{fracpart}{fracextra}".format(
|
| 1605 |
+
intpart=intpart or '0',
|
| 1606 |
+
pad='',
|
| 1607 |
+
fill=-min(exp + 1, 0),
|
| 1608 |
+
fracpart=digits[i:j],
|
| 1609 |
+
fracextra=digits[j:].rstrip('0'),
|
| 1610 |
+
).rstrip('.')
|
| 1611 |
+
return result
|
| 1612 |
+
|
| 1613 |
+
def _format_int(
|
| 1614 |
+
self,
|
| 1615 |
+
value: str,
|
| 1616 |
+
min: int,
|
| 1617 |
+
max: int,
|
| 1618 |
+
locale: Locale | str | None,
|
| 1619 |
+
*,
|
| 1620 |
+
numbering_system: Literal["default"] | str,
|
| 1621 |
+
) -> str:
|
| 1622 |
+
width = len(value)
|
| 1623 |
+
if width < min:
|
| 1624 |
+
value = '0' * (min - width) + value
|
| 1625 |
+
gsize = self.grouping[0]
|
| 1626 |
+
ret = ''
|
| 1627 |
+
symbol = get_group_symbol(locale, numbering_system=numbering_system)
|
| 1628 |
+
while len(value) > gsize:
|
| 1629 |
+
ret = symbol + value[-gsize:] + ret
|
| 1630 |
+
value = value[:-gsize]
|
| 1631 |
+
gsize = self.grouping[1]
|
| 1632 |
+
return value + ret
|
| 1633 |
+
|
| 1634 |
+
def _quantize_value(
|
| 1635 |
+
self,
|
| 1636 |
+
value: decimal.Decimal,
|
| 1637 |
+
locale: Locale | str | None,
|
| 1638 |
+
frac_prec: tuple[int, int],
|
| 1639 |
+
group_separator: bool,
|
| 1640 |
+
*,
|
| 1641 |
+
numbering_system: Literal["default"] | str,
|
| 1642 |
+
) -> str:
|
| 1643 |
+
# If the number is +/-Infinity, we can't quantize it
|
| 1644 |
+
if value.is_infinite():
|
| 1645 |
+
return get_infinity_symbol(locale, numbering_system=numbering_system)
|
| 1646 |
+
quantum = get_decimal_quantum(frac_prec[1])
|
| 1647 |
+
rounded = value.quantize(quantum)
|
| 1648 |
+
a, sep, b = f"{rounded:f}".partition(".")
|
| 1649 |
+
integer_part = a
|
| 1650 |
+
if group_separator:
|
| 1651 |
+
integer_part = self._format_int(
|
| 1652 |
+
a,
|
| 1653 |
+
self.int_prec[0],
|
| 1654 |
+
self.int_prec[1],
|
| 1655 |
+
locale,
|
| 1656 |
+
numbering_system=numbering_system,
|
| 1657 |
+
)
|
| 1658 |
+
number = integer_part + self._format_frac(
|
| 1659 |
+
b or '0',
|
| 1660 |
+
locale=locale,
|
| 1661 |
+
force_frac=frac_prec,
|
| 1662 |
+
numbering_system=numbering_system,
|
| 1663 |
+
)
|
| 1664 |
+
return number
|
| 1665 |
+
|
| 1666 |
+
def _format_frac(
|
| 1667 |
+
self,
|
| 1668 |
+
value: str,
|
| 1669 |
+
locale: Locale | str | None,
|
| 1670 |
+
force_frac: tuple[int, int] | None = None,
|
| 1671 |
+
*,
|
| 1672 |
+
numbering_system: Literal["default"] | str,
|
| 1673 |
+
) -> str:
|
| 1674 |
+
min, max = force_frac or self.frac_prec
|
| 1675 |
+
if len(value) < min:
|
| 1676 |
+
value += '0' * (min - len(value))
|
| 1677 |
+
if max == 0 or (min == 0 and int(value) == 0):
|
| 1678 |
+
return ''
|
| 1679 |
+
while len(value) > min and value[-1] == '0':
|
| 1680 |
+
value = value[:-1]
|
| 1681 |
+
return get_decimal_symbol(locale, numbering_system=numbering_system) + value
|
micromamba_root/Lib/site-packages/babel/plural.py
ADDED
|
@@ -0,0 +1,652 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
babel.numbers
|
| 3 |
+
~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
CLDR Plural support. See UTS #35.
|
| 6 |
+
|
| 7 |
+
:copyright: (c) 2013-2026 by the Babel Team.
|
| 8 |
+
:license: BSD, see LICENSE for more details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from __future__ import annotations
|
| 12 |
+
|
| 13 |
+
import decimal
|
| 14 |
+
import re
|
| 15 |
+
from collections.abc import Iterable, Mapping
|
| 16 |
+
from typing import Any, Callable, Literal
|
| 17 |
+
|
| 18 |
+
_plural_tags = ('zero', 'one', 'two', 'few', 'many', 'other')
|
| 19 |
+
_fallback_tag = 'other'
|
| 20 |
+
|
| 21 |
+
|
| 22 |
+
def extract_operands(
|
| 23 |
+
source: float | decimal.Decimal,
|
| 24 |
+
) -> tuple[decimal.Decimal | int, int, int, int, int, int, Literal[0], Literal[0]]:
|
| 25 |
+
"""Extract operands from a decimal, a float or an int, according to `CLDR rules`_.
|
| 26 |
+
|
| 27 |
+
The result is an 8-tuple (n, i, v, w, f, t, c, e), where those symbols are as follows:
|
| 28 |
+
|
| 29 |
+
====== ===============================================================
|
| 30 |
+
Symbol Value
|
| 31 |
+
------ ---------------------------------------------------------------
|
| 32 |
+
n absolute value of the source number (integer and decimals).
|
| 33 |
+
i integer digits of n.
|
| 34 |
+
v number of visible fraction digits in n, with trailing zeros.
|
| 35 |
+
w number of visible fraction digits in n, without trailing zeros.
|
| 36 |
+
f visible fractional digits in n, with trailing zeros.
|
| 37 |
+
t visible fractional digits in n, without trailing zeros.
|
| 38 |
+
c compact decimal exponent value: exponent of the power of 10 used in compact decimal formatting.
|
| 39 |
+
e currently, synonym for ‘c’. however, may be redefined in the future.
|
| 40 |
+
====== ===============================================================
|
| 41 |
+
|
| 42 |
+
.. _`CLDR rules`: https://www.unicode.org/reports/tr35/tr35-61/tr35-numbers.html#Operands
|
| 43 |
+
|
| 44 |
+
:param source: A real number
|
| 45 |
+
:type source: int|float|decimal.Decimal
|
| 46 |
+
:return: A n-i-v-w-f-t-c-e tuple
|
| 47 |
+
:rtype: tuple[decimal.Decimal, int, int, int, int, int, int, int]
|
| 48 |
+
"""
|
| 49 |
+
n = abs(source)
|
| 50 |
+
i = int(n)
|
| 51 |
+
if isinstance(n, float):
|
| 52 |
+
if i == n:
|
| 53 |
+
n = i
|
| 54 |
+
else:
|
| 55 |
+
# Cast the `float` to a number via the string representation.
|
| 56 |
+
# This is required for Python 2.6 anyway (it will straight out fail to
|
| 57 |
+
# do the conversion otherwise), and it's highly unlikely that the user
|
| 58 |
+
# actually wants the lossless conversion behavior (quoting the Python
|
| 59 |
+
# documentation):
|
| 60 |
+
# > If value is a float, the binary floating point value is losslessly
|
| 61 |
+
# > converted to its exact decimal equivalent.
|
| 62 |
+
# > This conversion can often require 53 or more digits of precision.
|
| 63 |
+
# Should the user want that behavior, they can simply pass in a pre-
|
| 64 |
+
# converted `Decimal` instance of desired accuracy.
|
| 65 |
+
n = decimal.Decimal(str(n))
|
| 66 |
+
|
| 67 |
+
if isinstance(n, decimal.Decimal):
|
| 68 |
+
dec_tuple = n.as_tuple()
|
| 69 |
+
exp = dec_tuple.exponent
|
| 70 |
+
fraction_digits = dec_tuple.digits[exp:] if exp < 0 else ()
|
| 71 |
+
trailing = ''.join(str(d) for d in fraction_digits)
|
| 72 |
+
no_trailing = trailing.rstrip('0')
|
| 73 |
+
v = len(trailing)
|
| 74 |
+
w = len(no_trailing)
|
| 75 |
+
f = int(trailing or 0)
|
| 76 |
+
t = int(no_trailing or 0)
|
| 77 |
+
else:
|
| 78 |
+
v = w = f = t = 0
|
| 79 |
+
c = e = 0 # TODO: c and e are not supported
|
| 80 |
+
return n, i, v, w, f, t, c, e
|
| 81 |
+
|
| 82 |
+
|
| 83 |
+
class PluralRule:
|
| 84 |
+
"""Represents a set of language pluralization rules. The constructor
|
| 85 |
+
accepts a list of (tag, expr) tuples or a dict of `CLDR rules`_. The
|
| 86 |
+
resulting object is callable and accepts one parameter with a positive or
|
| 87 |
+
negative number (both integer and float) for the number that indicates the
|
| 88 |
+
plural form for a string and returns the tag for the format:
|
| 89 |
+
|
| 90 |
+
>>> rule = PluralRule({'one': 'n is 1'})
|
| 91 |
+
>>> rule(1)
|
| 92 |
+
'one'
|
| 93 |
+
>>> rule(2)
|
| 94 |
+
'other'
|
| 95 |
+
|
| 96 |
+
Currently the CLDR defines these tags: zero, one, two, few, many and
|
| 97 |
+
other where other is an implicit default. Rules should be mutually
|
| 98 |
+
exclusive; for a given numeric value, only one rule should apply (i.e.
|
| 99 |
+
the condition should only be true for one of the plural rule elements.
|
| 100 |
+
|
| 101 |
+
.. _`CLDR rules`: https://www.unicode.org/reports/tr35/tr35-33/tr35-numbers.html#Language_Plural_Rules
|
| 102 |
+
"""
|
| 103 |
+
|
| 104 |
+
__slots__ = ('abstract', '_func')
|
| 105 |
+
|
| 106 |
+
def __init__(self, rules: Mapping[str, str] | Iterable[tuple[str, str]]) -> None:
|
| 107 |
+
"""Initialize the rule instance.
|
| 108 |
+
|
| 109 |
+
:param rules: a list of ``(tag, expr)``) tuples with the rules
|
| 110 |
+
conforming to UTS #35 or a dict with the tags as keys
|
| 111 |
+
and expressions as values.
|
| 112 |
+
:raise RuleError: if the expression is malformed
|
| 113 |
+
"""
|
| 114 |
+
if isinstance(rules, Mapping):
|
| 115 |
+
rules = rules.items()
|
| 116 |
+
found = set()
|
| 117 |
+
self.abstract: list[tuple[str, Any]] = []
|
| 118 |
+
for key, expr in sorted(rules):
|
| 119 |
+
if key not in _plural_tags:
|
| 120 |
+
raise ValueError(f"unknown tag {key!r}")
|
| 121 |
+
elif key in found:
|
| 122 |
+
raise ValueError(f"tag {key!r} defined twice")
|
| 123 |
+
found.add(key)
|
| 124 |
+
ast = _Parser(expr).ast
|
| 125 |
+
if ast:
|
| 126 |
+
self.abstract.append((key, ast))
|
| 127 |
+
|
| 128 |
+
def __repr__(self) -> str:
|
| 129 |
+
rules = self.rules
|
| 130 |
+
args = ", ".join(f"{tag}: {rules[tag]}" for tag in _plural_tags if tag in rules)
|
| 131 |
+
return f"<{type(self).__name__} {args!r}>"
|
| 132 |
+
|
| 133 |
+
@classmethod
|
| 134 |
+
def parse(
|
| 135 |
+
cls,
|
| 136 |
+
rules: Mapping[str, str] | Iterable[tuple[str, str]] | PluralRule,
|
| 137 |
+
) -> PluralRule:
|
| 138 |
+
"""Create a `PluralRule` instance for the given rules. If the rules
|
| 139 |
+
are a `PluralRule` object, that object is returned.
|
| 140 |
+
|
| 141 |
+
:param rules: the rules as list or dict, or a `PluralRule` object
|
| 142 |
+
:raise RuleError: if the expression is malformed
|
| 143 |
+
"""
|
| 144 |
+
if isinstance(rules, PluralRule):
|
| 145 |
+
return rules
|
| 146 |
+
return cls(rules)
|
| 147 |
+
|
| 148 |
+
@property
|
| 149 |
+
def rules(self) -> Mapping[str, str]:
|
| 150 |
+
"""The `PluralRule` as a dict of unicode plural rules.
|
| 151 |
+
|
| 152 |
+
>>> rule = PluralRule({'one': 'n is 1'})
|
| 153 |
+
>>> rule.rules
|
| 154 |
+
{'one': 'n is 1'}
|
| 155 |
+
"""
|
| 156 |
+
_compile = _UnicodeCompiler().compile
|
| 157 |
+
return {tag: _compile(ast) for tag, ast in self.abstract}
|
| 158 |
+
|
| 159 |
+
@property
|
| 160 |
+
def tags(self) -> frozenset[str]:
|
| 161 |
+
"""A set of explicitly defined tags in this rule. The implicit default
|
| 162 |
+
``'other'`` rules is not part of this set unless there is an explicit
|
| 163 |
+
rule for it.
|
| 164 |
+
"""
|
| 165 |
+
return frozenset(i[0] for i in self.abstract)
|
| 166 |
+
|
| 167 |
+
def __getstate__(self) -> list[tuple[str, Any]]:
|
| 168 |
+
return self.abstract
|
| 169 |
+
|
| 170 |
+
def __setstate__(self, abstract: list[tuple[str, Any]]) -> None:
|
| 171 |
+
self.abstract = abstract
|
| 172 |
+
|
| 173 |
+
def __call__(self, n: float | decimal.Decimal) -> str:
|
| 174 |
+
if not hasattr(self, '_func'):
|
| 175 |
+
self._func = to_python(self)
|
| 176 |
+
return self._func(n)
|
| 177 |
+
|
| 178 |
+
|
| 179 |
+
def to_javascript(rule: Mapping[str, str] | Iterable[tuple[str, str]] | PluralRule) -> str:
|
| 180 |
+
"""Convert a list/dict of rules or a `PluralRule` object into a JavaScript
|
| 181 |
+
function. This function depends on no external library:
|
| 182 |
+
|
| 183 |
+
>>> to_javascript({'one': 'n is 1'})
|
| 184 |
+
"(function(n) { return (n == 1) ? 'one' : 'other'; })"
|
| 185 |
+
|
| 186 |
+
Implementation detail: The function generated will probably evaluate
|
| 187 |
+
expressions involved into range operations multiple times. This has the
|
| 188 |
+
advantage that external helper functions are not required and is not a
|
| 189 |
+
big performance hit for these simple calculations.
|
| 190 |
+
|
| 191 |
+
:param rule: the rules as list or dict, or a `PluralRule` object
|
| 192 |
+
:raise RuleError: if the expression is malformed
|
| 193 |
+
"""
|
| 194 |
+
to_js = _JavaScriptCompiler().compile
|
| 195 |
+
result = ['(function(n) { return ']
|
| 196 |
+
for tag, ast in PluralRule.parse(rule).abstract:
|
| 197 |
+
result.append(f"{to_js(ast)} ? {tag!r} : ")
|
| 198 |
+
result.append('%r; })' % _fallback_tag)
|
| 199 |
+
return ''.join(result)
|
| 200 |
+
|
| 201 |
+
|
| 202 |
+
def to_python(
|
| 203 |
+
rule: Mapping[str, str] | Iterable[tuple[str, str]] | PluralRule,
|
| 204 |
+
) -> Callable[[float | decimal.Decimal], str]:
|
| 205 |
+
"""Convert a list/dict of rules or a `PluralRule` object into a regular
|
| 206 |
+
Python function. This is useful in situations where you need a real
|
| 207 |
+
function and don't are about the actual rule object:
|
| 208 |
+
|
| 209 |
+
>>> func = to_python({'one': 'n is 1', 'few': 'n in 2..4'})
|
| 210 |
+
>>> func(1)
|
| 211 |
+
'one'
|
| 212 |
+
>>> func(3)
|
| 213 |
+
'few'
|
| 214 |
+
>>> func = to_python({'one': 'n in 1,11', 'few': 'n in 3..10,13..19'})
|
| 215 |
+
>>> func(11)
|
| 216 |
+
'one'
|
| 217 |
+
>>> func(15)
|
| 218 |
+
'few'
|
| 219 |
+
|
| 220 |
+
:param rule: the rules as list or dict, or a `PluralRule` object
|
| 221 |
+
:raise RuleError: if the expression is malformed
|
| 222 |
+
"""
|
| 223 |
+
namespace = {
|
| 224 |
+
'IN': in_range_list,
|
| 225 |
+
'WITHIN': within_range_list,
|
| 226 |
+
'MOD': cldr_modulo,
|
| 227 |
+
'extract_operands': extract_operands,
|
| 228 |
+
}
|
| 229 |
+
to_python_func = _PythonCompiler().compile
|
| 230 |
+
result = [
|
| 231 |
+
'def evaluate(n):',
|
| 232 |
+
' n, i, v, w, f, t, c, e = extract_operands(n)',
|
| 233 |
+
]
|
| 234 |
+
for tag, ast in PluralRule.parse(rule).abstract:
|
| 235 |
+
# the str() call is to coerce the tag to the native string. It's
|
| 236 |
+
# a limited ascii restricted set of tags anyways so that is fine.
|
| 237 |
+
result.append(f" if ({to_python_func(ast)}): return {str(tag)!r}")
|
| 238 |
+
result.append(f" return {_fallback_tag!r}")
|
| 239 |
+
code = compile('\n'.join(result), '<rule>', 'exec')
|
| 240 |
+
eval(code, namespace)
|
| 241 |
+
return namespace['evaluate']
|
| 242 |
+
|
| 243 |
+
|
| 244 |
+
def to_gettext(rule: Mapping[str, str] | Iterable[tuple[str, str]] | PluralRule) -> str:
|
| 245 |
+
"""The plural rule as gettext expression. The gettext expression is
|
| 246 |
+
technically limited to integers and returns indices rather than tags.
|
| 247 |
+
|
| 248 |
+
>>> to_gettext({'one': 'n is 1', 'two': 'n is 2'})
|
| 249 |
+
'nplurals=3; plural=((n == 1) ? 0 : (n == 2) ? 1 : 2);'
|
| 250 |
+
|
| 251 |
+
:param rule: the rules as list or dict, or a `PluralRule` object
|
| 252 |
+
:raise RuleError: if the expression is malformed
|
| 253 |
+
"""
|
| 254 |
+
rule = PluralRule.parse(rule)
|
| 255 |
+
|
| 256 |
+
used_tags = rule.tags | {_fallback_tag}
|
| 257 |
+
_compile = _GettextCompiler().compile
|
| 258 |
+
_get_index = [tag for tag in _plural_tags if tag in used_tags].index
|
| 259 |
+
|
| 260 |
+
result = [f"nplurals={len(used_tags)}; plural=("]
|
| 261 |
+
for tag, ast in rule.abstract:
|
| 262 |
+
result.append(f"{_compile(ast)} ? {_get_index(tag)} : ")
|
| 263 |
+
result.append(f"{_get_index(_fallback_tag)});")
|
| 264 |
+
return ''.join(result)
|
| 265 |
+
|
| 266 |
+
|
| 267 |
+
def in_range_list(
|
| 268 |
+
num: float | decimal.Decimal,
|
| 269 |
+
range_list: Iterable[Iterable[float | decimal.Decimal]],
|
| 270 |
+
) -> bool:
|
| 271 |
+
"""Integer range list test. This is the callback for the "in" operator
|
| 272 |
+
of the UTS #35 pluralization rule language:
|
| 273 |
+
|
| 274 |
+
>>> in_range_list(1, [(1, 3)])
|
| 275 |
+
True
|
| 276 |
+
>>> in_range_list(3, [(1, 3)])
|
| 277 |
+
True
|
| 278 |
+
>>> in_range_list(3, [(1, 3), (5, 8)])
|
| 279 |
+
True
|
| 280 |
+
>>> in_range_list(1.2, [(1, 4)])
|
| 281 |
+
False
|
| 282 |
+
>>> in_range_list(10, [(1, 4)])
|
| 283 |
+
False
|
| 284 |
+
>>> in_range_list(10, [(1, 4), (6, 8)])
|
| 285 |
+
False
|
| 286 |
+
"""
|
| 287 |
+
return num == int(num) and within_range_list(num, range_list)
|
| 288 |
+
|
| 289 |
+
|
| 290 |
+
def within_range_list(
|
| 291 |
+
num: float | decimal.Decimal,
|
| 292 |
+
range_list: Iterable[Iterable[float | decimal.Decimal]],
|
| 293 |
+
) -> bool:
|
| 294 |
+
"""Float range test. This is the callback for the "within" operator
|
| 295 |
+
of the UTS #35 pluralization rule language:
|
| 296 |
+
|
| 297 |
+
>>> within_range_list(1, [(1, 3)])
|
| 298 |
+
True
|
| 299 |
+
>>> within_range_list(1.0, [(1, 3)])
|
| 300 |
+
True
|
| 301 |
+
>>> within_range_list(1.2, [(1, 4)])
|
| 302 |
+
True
|
| 303 |
+
>>> within_range_list(8.8, [(1, 4), (7, 15)])
|
| 304 |
+
True
|
| 305 |
+
>>> within_range_list(10, [(1, 4)])
|
| 306 |
+
False
|
| 307 |
+
>>> within_range_list(10.5, [(1, 4), (20, 30)])
|
| 308 |
+
False
|
| 309 |
+
"""
|
| 310 |
+
return any(min_ <= num <= max_ for min_, max_ in range_list)
|
| 311 |
+
|
| 312 |
+
|
| 313 |
+
def cldr_modulo(a: float, b: float) -> float:
|
| 314 |
+
"""Javaish modulo. This modulo operator returns the value with the sign
|
| 315 |
+
of the dividend rather than the divisor like Python does:
|
| 316 |
+
|
| 317 |
+
>>> cldr_modulo(-3, 5)
|
| 318 |
+
-3
|
| 319 |
+
>>> cldr_modulo(-3, -5)
|
| 320 |
+
-3
|
| 321 |
+
>>> cldr_modulo(3, 5)
|
| 322 |
+
3
|
| 323 |
+
"""
|
| 324 |
+
reverse = 0
|
| 325 |
+
if a < 0:
|
| 326 |
+
a *= -1
|
| 327 |
+
reverse = 1
|
| 328 |
+
if b < 0:
|
| 329 |
+
b *= -1
|
| 330 |
+
rv = a % b
|
| 331 |
+
if reverse:
|
| 332 |
+
rv *= -1
|
| 333 |
+
return rv
|
| 334 |
+
|
| 335 |
+
|
| 336 |
+
class RuleError(Exception):
|
| 337 |
+
"""Raised if a rule is malformed."""
|
| 338 |
+
|
| 339 |
+
|
| 340 |
+
_VARS = {
|
| 341 |
+
'n', # absolute value of the source number.
|
| 342 |
+
'i', # integer digits of n.
|
| 343 |
+
'v', # number of visible fraction digits in n, with trailing zeros.*
|
| 344 |
+
'w', # number of visible fraction digits in n, without trailing zeros.*
|
| 345 |
+
'f', # visible fraction digits in n, with trailing zeros.*
|
| 346 |
+
't', # visible fraction digits in n, without trailing zeros.*
|
| 347 |
+
'c', # compact decimal exponent value: exponent of the power of 10 used in compact decimal formatting.
|
| 348 |
+
'e', # currently, synonym for `c`. however, may be redefined in the future.
|
| 349 |
+
}
|
| 350 |
+
|
| 351 |
+
_RULES: list[tuple[str | None, re.Pattern[str]]] = [
|
| 352 |
+
(None, re.compile(r'\s+', re.UNICODE)),
|
| 353 |
+
('word', re.compile(rf'\b(and|or|is|(?:with)?in|not|mod|[{"".join(_VARS)}])\b')),
|
| 354 |
+
('value', re.compile(r'\d+')),
|
| 355 |
+
('symbol', re.compile(r'%|,|!=|=')),
|
| 356 |
+
('ellipsis', re.compile(r'\.{2,3}|\u2026', re.UNICODE)), # U+2026: ELLIPSIS
|
| 357 |
+
]
|
| 358 |
+
|
| 359 |
+
|
| 360 |
+
def tokenize_rule(s: str) -> list[tuple[str, str]]:
|
| 361 |
+
s = s.split('@')[0]
|
| 362 |
+
result: list[tuple[str, str]] = []
|
| 363 |
+
pos = 0
|
| 364 |
+
end = len(s)
|
| 365 |
+
while pos < end:
|
| 366 |
+
for tok, rule in _RULES:
|
| 367 |
+
match = rule.match(s, pos)
|
| 368 |
+
if match is not None:
|
| 369 |
+
pos = match.end()
|
| 370 |
+
if tok:
|
| 371 |
+
result.append((tok, match.group()))
|
| 372 |
+
break
|
| 373 |
+
else:
|
| 374 |
+
raise RuleError(f"malformed CLDR pluralization rule. Got unexpected {s[pos]!r}")
|
| 375 |
+
return result[::-1]
|
| 376 |
+
|
| 377 |
+
|
| 378 |
+
def test_next_token(
|
| 379 |
+
tokens: list[tuple[str, str]],
|
| 380 |
+
type_: str,
|
| 381 |
+
value: str | None = None,
|
| 382 |
+
) -> list[tuple[str, str]] | bool:
|
| 383 |
+
return tokens and tokens[-1][0] == type_ and (value is None or tokens[-1][1] == value)
|
| 384 |
+
|
| 385 |
+
|
| 386 |
+
def skip_token(tokens: list[tuple[str, str]], type_: str, value: str | None = None):
|
| 387 |
+
if test_next_token(tokens, type_, value):
|
| 388 |
+
return tokens.pop()
|
| 389 |
+
|
| 390 |
+
|
| 391 |
+
def value_node(value: int) -> tuple[Literal['value'], tuple[int]]:
|
| 392 |
+
return 'value', (value,)
|
| 393 |
+
|
| 394 |
+
|
| 395 |
+
def ident_node(name: str) -> tuple[str, tuple[()]]:
|
| 396 |
+
return name, ()
|
| 397 |
+
|
| 398 |
+
|
| 399 |
+
def range_list_node(
|
| 400 |
+
range_list: Iterable[Iterable[float | decimal.Decimal]],
|
| 401 |
+
) -> tuple[Literal['range_list'], Iterable[Iterable[float | decimal.Decimal]]]:
|
| 402 |
+
return 'range_list', range_list
|
| 403 |
+
|
| 404 |
+
|
| 405 |
+
def negate(rv: tuple[Any, ...]) -> tuple[Literal['not'], tuple[tuple[Any, ...]]]:
|
| 406 |
+
return 'not', (rv,)
|
| 407 |
+
|
| 408 |
+
|
| 409 |
+
class _Parser:
|
| 410 |
+
"""Internal parser. This class can translate a single rule into an abstract
|
| 411 |
+
tree of tuples. It implements the following grammar::
|
| 412 |
+
|
| 413 |
+
condition = and_condition ('or' and_condition)*
|
| 414 |
+
('@integer' samples)?
|
| 415 |
+
('@decimal' samples)?
|
| 416 |
+
and_condition = relation ('and' relation)*
|
| 417 |
+
relation = is_relation | in_relation | within_relation
|
| 418 |
+
is_relation = expr 'is' ('not')? value
|
| 419 |
+
in_relation = expr (('not')? 'in' | '=' | '!=') range_list
|
| 420 |
+
within_relation = expr ('not')? 'within' range_list
|
| 421 |
+
expr = operand (('mod' | '%') value)?
|
| 422 |
+
operand = 'n' | 'i' | 'f' | 't' | 'v' | 'w'
|
| 423 |
+
range_list = (range | value) (',' range_list)*
|
| 424 |
+
value = digit+
|
| 425 |
+
digit = 0|1|2|3|4|5|6|7|8|9
|
| 426 |
+
range = value'..'value
|
| 427 |
+
samples = sampleRange (',' sampleRange)* (',' ('…'|'...'))?
|
| 428 |
+
sampleRange = decimalValue '~' decimalValue
|
| 429 |
+
decimalValue = value ('.' value)?
|
| 430 |
+
|
| 431 |
+
- Whitespace can occur between or around any of the above tokens.
|
| 432 |
+
- Rules should be mutually exclusive; for a given numeric value, only one
|
| 433 |
+
rule should apply (i.e. the condition should only be true for one of
|
| 434 |
+
the plural rule elements).
|
| 435 |
+
- The in and within relations can take comma-separated lists, such as:
|
| 436 |
+
'n in 3,5,7..15'.
|
| 437 |
+
- Samples are ignored.
|
| 438 |
+
|
| 439 |
+
The translator parses the expression on instantiation into an attribute
|
| 440 |
+
called `ast`.
|
| 441 |
+
"""
|
| 442 |
+
|
| 443 |
+
def __init__(self, string):
|
| 444 |
+
self.tokens = tokenize_rule(string)
|
| 445 |
+
if not self.tokens:
|
| 446 |
+
# If the pattern is only samples, it's entirely possible
|
| 447 |
+
# no stream of tokens whatsoever is generated.
|
| 448 |
+
self.ast = None
|
| 449 |
+
return
|
| 450 |
+
self.ast = self.condition()
|
| 451 |
+
if self.tokens:
|
| 452 |
+
raise RuleError(f"Expected end of rule, got {self.tokens[-1][1]!r}")
|
| 453 |
+
|
| 454 |
+
def expect(self, type_, value=None, term=None):
|
| 455 |
+
token = skip_token(self.tokens, type_, value)
|
| 456 |
+
if token is not None:
|
| 457 |
+
return token
|
| 458 |
+
if term is None:
|
| 459 |
+
term = repr(value is None and type_ or value)
|
| 460 |
+
if not self.tokens:
|
| 461 |
+
raise RuleError(f"expected {term} but end of rule reached")
|
| 462 |
+
raise RuleError(f"expected {term} but got {self.tokens[-1][1]!r}")
|
| 463 |
+
|
| 464 |
+
def condition(self):
|
| 465 |
+
op = self.and_condition()
|
| 466 |
+
while skip_token(self.tokens, 'word', 'or'):
|
| 467 |
+
op = 'or', (op, self.and_condition())
|
| 468 |
+
return op
|
| 469 |
+
|
| 470 |
+
def and_condition(self):
|
| 471 |
+
op = self.relation()
|
| 472 |
+
while skip_token(self.tokens, 'word', 'and'):
|
| 473 |
+
op = 'and', (op, self.relation())
|
| 474 |
+
return op
|
| 475 |
+
|
| 476 |
+
def relation(self):
|
| 477 |
+
left = self.expr()
|
| 478 |
+
if skip_token(self.tokens, 'word', 'is'):
|
| 479 |
+
op = 'isnot' if skip_token(self.tokens, 'word', 'not') else 'is'
|
| 480 |
+
return op, (left, self.value())
|
| 481 |
+
negated = skip_token(self.tokens, 'word', 'not')
|
| 482 |
+
method = 'in'
|
| 483 |
+
if skip_token(self.tokens, 'word', 'within'):
|
| 484 |
+
method = 'within'
|
| 485 |
+
else:
|
| 486 |
+
if not skip_token(self.tokens, 'word', 'in'):
|
| 487 |
+
if negated:
|
| 488 |
+
raise RuleError('Cannot negate operator based rules.')
|
| 489 |
+
return self.newfangled_relation(left)
|
| 490 |
+
rv = 'relation', (method, left, self.range_list())
|
| 491 |
+
return negate(rv) if negated else rv
|
| 492 |
+
|
| 493 |
+
def newfangled_relation(self, left):
|
| 494 |
+
if skip_token(self.tokens, 'symbol', '='):
|
| 495 |
+
negated = False
|
| 496 |
+
elif skip_token(self.tokens, 'symbol', '!='):
|
| 497 |
+
negated = True
|
| 498 |
+
else:
|
| 499 |
+
raise RuleError('Expected "=" or "!=" or legacy relation')
|
| 500 |
+
rv = 'relation', ('in', left, self.range_list())
|
| 501 |
+
return negate(rv) if negated else rv
|
| 502 |
+
|
| 503 |
+
def range_or_value(self):
|
| 504 |
+
left = self.value()
|
| 505 |
+
if skip_token(self.tokens, 'ellipsis'):
|
| 506 |
+
return left, self.value()
|
| 507 |
+
else:
|
| 508 |
+
return left, left
|
| 509 |
+
|
| 510 |
+
def range_list(self):
|
| 511 |
+
range_list = [self.range_or_value()]
|
| 512 |
+
while skip_token(self.tokens, 'symbol', ','):
|
| 513 |
+
range_list.append(self.range_or_value())
|
| 514 |
+
return range_list_node(range_list)
|
| 515 |
+
|
| 516 |
+
def expr(self):
|
| 517 |
+
word = skip_token(self.tokens, 'word')
|
| 518 |
+
if word is None or word[1] not in _VARS:
|
| 519 |
+
raise RuleError('Expected identifier variable')
|
| 520 |
+
name = word[1]
|
| 521 |
+
if skip_token(self.tokens, 'word', 'mod'):
|
| 522 |
+
return 'mod', ((name, ()), self.value())
|
| 523 |
+
elif skip_token(self.tokens, 'symbol', '%'):
|
| 524 |
+
return 'mod', ((name, ()), self.value())
|
| 525 |
+
return ident_node(name)
|
| 526 |
+
|
| 527 |
+
def value(self):
|
| 528 |
+
return value_node(int(self.expect('value')[1]))
|
| 529 |
+
|
| 530 |
+
|
| 531 |
+
def _binary_compiler(tmpl):
|
| 532 |
+
"""Compiler factory for the `_Compiler`."""
|
| 533 |
+
return lambda self, left, right: tmpl % (self.compile(left), self.compile(right))
|
| 534 |
+
|
| 535 |
+
|
| 536 |
+
def _unary_compiler(tmpl):
|
| 537 |
+
"""Compiler factory for the `_Compiler`."""
|
| 538 |
+
return lambda self, x: tmpl % self.compile(x)
|
| 539 |
+
|
| 540 |
+
|
| 541 |
+
compile_zero = lambda x: '0'
|
| 542 |
+
|
| 543 |
+
|
| 544 |
+
class _Compiler:
|
| 545 |
+
"""The compilers are able to transform the expressions into multiple
|
| 546 |
+
output formats.
|
| 547 |
+
"""
|
| 548 |
+
|
| 549 |
+
def compile(self, arg):
|
| 550 |
+
op, args = arg
|
| 551 |
+
return getattr(self, f"compile_{op}")(*args)
|
| 552 |
+
|
| 553 |
+
compile_n = lambda x: 'n'
|
| 554 |
+
compile_i = lambda x: 'i'
|
| 555 |
+
compile_v = lambda x: 'v'
|
| 556 |
+
compile_w = lambda x: 'w'
|
| 557 |
+
compile_f = lambda x: 'f'
|
| 558 |
+
compile_t = lambda x: 't'
|
| 559 |
+
compile_c = lambda x: 'c'
|
| 560 |
+
compile_e = lambda x: 'e'
|
| 561 |
+
compile_value = lambda x, v: str(v)
|
| 562 |
+
compile_and = _binary_compiler('(%s && %s)')
|
| 563 |
+
compile_or = _binary_compiler('(%s || %s)')
|
| 564 |
+
compile_not = _unary_compiler('(!%s)')
|
| 565 |
+
compile_mod = _binary_compiler('(%s %% %s)')
|
| 566 |
+
compile_is = _binary_compiler('(%s == %s)')
|
| 567 |
+
compile_isnot = _binary_compiler('(%s != %s)')
|
| 568 |
+
|
| 569 |
+
def compile_relation(self, method, expr, range_list):
|
| 570 |
+
raise NotImplementedError()
|
| 571 |
+
|
| 572 |
+
|
| 573 |
+
class _PythonCompiler(_Compiler):
|
| 574 |
+
"""Compiles an expression to Python."""
|
| 575 |
+
|
| 576 |
+
compile_and = _binary_compiler('(%s and %s)')
|
| 577 |
+
compile_or = _binary_compiler('(%s or %s)')
|
| 578 |
+
compile_not = _unary_compiler('(not %s)')
|
| 579 |
+
compile_mod = _binary_compiler('MOD(%s, %s)')
|
| 580 |
+
|
| 581 |
+
def compile_relation(self, method, expr, range_list):
|
| 582 |
+
ranges = ",".join(
|
| 583 |
+
f"({self.compile(a)}, {self.compile(b)})" for (a, b) in range_list[1]
|
| 584 |
+
)
|
| 585 |
+
return f"{method.upper()}({self.compile(expr)}, [{ranges}])"
|
| 586 |
+
|
| 587 |
+
|
| 588 |
+
class _GettextCompiler(_Compiler):
|
| 589 |
+
"""Compile into a gettext plural expression."""
|
| 590 |
+
|
| 591 |
+
compile_i = _Compiler.compile_n
|
| 592 |
+
compile_v = compile_zero
|
| 593 |
+
compile_w = compile_zero
|
| 594 |
+
compile_f = compile_zero
|
| 595 |
+
compile_t = compile_zero
|
| 596 |
+
|
| 597 |
+
def compile_relation(self, method, expr, range_list):
|
| 598 |
+
rv = []
|
| 599 |
+
expr = self.compile(expr)
|
| 600 |
+
for item in range_list[1]:
|
| 601 |
+
if item[0] == item[1]:
|
| 602 |
+
rv.append(f"({expr} == {self.compile(item[0])})")
|
| 603 |
+
else:
|
| 604 |
+
min = self.compile(item[0])
|
| 605 |
+
max = self.compile(item[1])
|
| 606 |
+
rv.append(f"({expr} >= {min} && {expr} <= {max})")
|
| 607 |
+
return f"({' || '.join(rv)})"
|
| 608 |
+
|
| 609 |
+
|
| 610 |
+
class _JavaScriptCompiler(_GettextCompiler):
|
| 611 |
+
"""Compiles the expression to plain of JavaScript."""
|
| 612 |
+
|
| 613 |
+
# XXX: presently javascript does not support any of the
|
| 614 |
+
# fraction support and basically only deals with integers.
|
| 615 |
+
compile_i = lambda x: 'parseInt(n, 10)'
|
| 616 |
+
compile_v = compile_zero
|
| 617 |
+
compile_w = compile_zero
|
| 618 |
+
compile_f = compile_zero
|
| 619 |
+
compile_t = compile_zero
|
| 620 |
+
|
| 621 |
+
def compile_relation(self, method, expr, range_list):
|
| 622 |
+
code = _GettextCompiler.compile_relation(self, method, expr, range_list)
|
| 623 |
+
if method == 'in':
|
| 624 |
+
expr = self.compile(expr)
|
| 625 |
+
code = f"(parseInt({expr}, 10) == {expr} && {code})"
|
| 626 |
+
return code
|
| 627 |
+
|
| 628 |
+
|
| 629 |
+
class _UnicodeCompiler(_Compiler):
|
| 630 |
+
"""Returns a unicode pluralization rule again."""
|
| 631 |
+
|
| 632 |
+
# XXX: this currently spits out the old syntax instead of the new
|
| 633 |
+
# one. We can change that, but it will break a whole bunch of stuff
|
| 634 |
+
# for users I suppose.
|
| 635 |
+
|
| 636 |
+
compile_is = _binary_compiler('%s is %s')
|
| 637 |
+
compile_isnot = _binary_compiler('%s is not %s')
|
| 638 |
+
compile_and = _binary_compiler('%s and %s')
|
| 639 |
+
compile_or = _binary_compiler('%s or %s')
|
| 640 |
+
compile_mod = _binary_compiler('%s mod %s')
|
| 641 |
+
|
| 642 |
+
def compile_not(self, relation):
|
| 643 |
+
return self.compile_relation(*relation[1], negated=True)
|
| 644 |
+
|
| 645 |
+
def compile_relation(self, method, expr, range_list, negated=False):
|
| 646 |
+
ranges = []
|
| 647 |
+
for item in range_list[1]:
|
| 648 |
+
if item[0] == item[1]:
|
| 649 |
+
ranges.append(self.compile(item[0]))
|
| 650 |
+
else:
|
| 651 |
+
ranges.append(f"{self.compile(item[0])}..{self.compile(item[1])}")
|
| 652 |
+
return f"{self.compile(expr)}{' not' if negated else ''} {method} {','.join(ranges)}"
|
micromamba_root/Lib/site-packages/babel/py.typed
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
# Marker file for PEP 561. This package uses inline types.
|
micromamba_root/Lib/site-packages/babel/support.py
ADDED
|
@@ -0,0 +1,796 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
babel.support
|
| 3 |
+
~~~~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Several classes and functions that help with integrating and using Babel
|
| 6 |
+
in applications.
|
| 7 |
+
|
| 8 |
+
.. note: the code in this module is not used by Babel itself
|
| 9 |
+
|
| 10 |
+
:copyright: (c) 2013-2026 by the Babel Team.
|
| 11 |
+
:license: BSD, see LICENSE for more details.
|
| 12 |
+
"""
|
| 13 |
+
|
| 14 |
+
from __future__ import annotations
|
| 15 |
+
|
| 16 |
+
import gettext
|
| 17 |
+
import locale
|
| 18 |
+
import os
|
| 19 |
+
from collections.abc import Iterator
|
| 20 |
+
from typing import TYPE_CHECKING, Any, Callable, Iterable, Literal
|
| 21 |
+
|
| 22 |
+
from babel.core import Locale
|
| 23 |
+
from babel.dates import format_date, format_datetime, format_time, format_timedelta
|
| 24 |
+
from babel.numbers import (
|
| 25 |
+
format_compact_currency,
|
| 26 |
+
format_compact_decimal,
|
| 27 |
+
format_currency,
|
| 28 |
+
format_decimal,
|
| 29 |
+
format_percent,
|
| 30 |
+
format_scientific,
|
| 31 |
+
)
|
| 32 |
+
|
| 33 |
+
if TYPE_CHECKING:
|
| 34 |
+
import datetime as _datetime
|
| 35 |
+
from decimal import Decimal
|
| 36 |
+
|
| 37 |
+
from babel.dates import _PredefinedTimeFormat
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
class Format:
|
| 41 |
+
"""Wrapper class providing the various date and number formatting functions
|
| 42 |
+
bound to a specific locale and time-zone.
|
| 43 |
+
|
| 44 |
+
>>> from babel.util import UTC
|
| 45 |
+
>>> from datetime import date
|
| 46 |
+
>>> fmt = Format('en_US', UTC)
|
| 47 |
+
>>> fmt.date(date(2007, 4, 1))
|
| 48 |
+
'Apr 1, 2007'
|
| 49 |
+
>>> fmt.decimal(1.2345)
|
| 50 |
+
'1.234'
|
| 51 |
+
"""
|
| 52 |
+
|
| 53 |
+
def __init__(
|
| 54 |
+
self,
|
| 55 |
+
locale: Locale | str,
|
| 56 |
+
tzinfo: _datetime.tzinfo | None = None,
|
| 57 |
+
*,
|
| 58 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 59 |
+
) -> None:
|
| 60 |
+
"""Initialize the formatter.
|
| 61 |
+
|
| 62 |
+
:param locale: the locale identifier or `Locale` instance
|
| 63 |
+
:param tzinfo: the time-zone info (a `tzinfo` instance or `None`)
|
| 64 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 65 |
+
The special value "default" will use the default numbering system of the locale.
|
| 66 |
+
"""
|
| 67 |
+
self.locale = Locale.parse(locale)
|
| 68 |
+
self.tzinfo = tzinfo
|
| 69 |
+
self.numbering_system = numbering_system
|
| 70 |
+
|
| 71 |
+
def date(
|
| 72 |
+
self,
|
| 73 |
+
date: _datetime.date | None = None,
|
| 74 |
+
format: _PredefinedTimeFormat | str = 'medium',
|
| 75 |
+
) -> str:
|
| 76 |
+
"""Return a date formatted according to the given pattern.
|
| 77 |
+
|
| 78 |
+
>>> from datetime import date
|
| 79 |
+
>>> fmt = Format('en_US')
|
| 80 |
+
>>> fmt.date(date(2007, 4, 1))
|
| 81 |
+
'Apr 1, 2007'
|
| 82 |
+
"""
|
| 83 |
+
return format_date(date, format, locale=self.locale)
|
| 84 |
+
|
| 85 |
+
def datetime(
|
| 86 |
+
self,
|
| 87 |
+
datetime: _datetime.date | None = None,
|
| 88 |
+
format: _PredefinedTimeFormat | str = 'medium',
|
| 89 |
+
) -> str:
|
| 90 |
+
"""Return a date and time formatted according to the given pattern.
|
| 91 |
+
|
| 92 |
+
>>> from datetime import datetime
|
| 93 |
+
>>> from babel.dates import get_timezone
|
| 94 |
+
>>> fmt = Format('en_US', tzinfo=get_timezone('US/Eastern'))
|
| 95 |
+
>>> fmt.datetime(datetime(2007, 4, 1, 15, 30))
|
| 96 |
+
'Apr 1, 2007, 11:30:00\\u202fAM'
|
| 97 |
+
"""
|
| 98 |
+
return format_datetime(datetime, format, tzinfo=self.tzinfo, locale=self.locale)
|
| 99 |
+
|
| 100 |
+
def time(
|
| 101 |
+
self,
|
| 102 |
+
time: _datetime.time | _datetime.datetime | None = None,
|
| 103 |
+
format: _PredefinedTimeFormat | str = 'medium',
|
| 104 |
+
) -> str:
|
| 105 |
+
"""Return a time formatted according to the given pattern.
|
| 106 |
+
|
| 107 |
+
>>> from datetime import datetime
|
| 108 |
+
>>> from babel.dates import get_timezone
|
| 109 |
+
>>> fmt = Format('en_US', tzinfo=get_timezone('US/Eastern'))
|
| 110 |
+
>>> fmt.time(datetime(2007, 4, 1, 15, 30))
|
| 111 |
+
'11:30:00\\u202fAM'
|
| 112 |
+
"""
|
| 113 |
+
return format_time(time, format, tzinfo=self.tzinfo, locale=self.locale)
|
| 114 |
+
|
| 115 |
+
def timedelta(
|
| 116 |
+
self,
|
| 117 |
+
delta: _datetime.timedelta | int,
|
| 118 |
+
granularity: Literal[
|
| 119 |
+
"year",
|
| 120 |
+
"month",
|
| 121 |
+
"week",
|
| 122 |
+
"day",
|
| 123 |
+
"hour",
|
| 124 |
+
"minute",
|
| 125 |
+
"second",
|
| 126 |
+
] = "second",
|
| 127 |
+
threshold: float = 0.85,
|
| 128 |
+
format: Literal["narrow", "short", "medium", "long"] = "long",
|
| 129 |
+
add_direction: bool = False,
|
| 130 |
+
) -> str:
|
| 131 |
+
"""Return a time delta according to the rules of the given locale.
|
| 132 |
+
|
| 133 |
+
>>> from datetime import timedelta
|
| 134 |
+
>>> fmt = Format('en_US')
|
| 135 |
+
>>> fmt.timedelta(timedelta(weeks=11))
|
| 136 |
+
'3 months'
|
| 137 |
+
"""
|
| 138 |
+
return format_timedelta(
|
| 139 |
+
delta,
|
| 140 |
+
granularity=granularity,
|
| 141 |
+
threshold=threshold,
|
| 142 |
+
format=format,
|
| 143 |
+
add_direction=add_direction,
|
| 144 |
+
locale=self.locale,
|
| 145 |
+
)
|
| 146 |
+
|
| 147 |
+
def number(self, number: float | Decimal | str) -> str:
|
| 148 |
+
"""Return an integer number formatted for the locale.
|
| 149 |
+
|
| 150 |
+
>>> fmt = Format('en_US')
|
| 151 |
+
>>> fmt.number(1099)
|
| 152 |
+
'1,099'
|
| 153 |
+
"""
|
| 154 |
+
return format_decimal(
|
| 155 |
+
number,
|
| 156 |
+
locale=self.locale,
|
| 157 |
+
numbering_system=self.numbering_system,
|
| 158 |
+
)
|
| 159 |
+
|
| 160 |
+
def decimal(self, number: float | Decimal | str, format: str | None = None) -> str:
|
| 161 |
+
"""Return a decimal number formatted for the locale.
|
| 162 |
+
|
| 163 |
+
>>> fmt = Format('en_US')
|
| 164 |
+
>>> fmt.decimal(1.2345)
|
| 165 |
+
'1.234'
|
| 166 |
+
"""
|
| 167 |
+
return format_decimal(
|
| 168 |
+
number,
|
| 169 |
+
format,
|
| 170 |
+
locale=self.locale,
|
| 171 |
+
numbering_system=self.numbering_system,
|
| 172 |
+
)
|
| 173 |
+
|
| 174 |
+
def compact_decimal(
|
| 175 |
+
self,
|
| 176 |
+
number: float | Decimal | str,
|
| 177 |
+
format_type: Literal['short', 'long'] = 'short',
|
| 178 |
+
fraction_digits: int = 0,
|
| 179 |
+
) -> str:
|
| 180 |
+
"""Return a number formatted in compact form for the locale.
|
| 181 |
+
|
| 182 |
+
>>> fmt = Format('en_US')
|
| 183 |
+
>>> fmt.compact_decimal(123456789)
|
| 184 |
+
'123M'
|
| 185 |
+
>>> fmt.compact_decimal(1234567, format_type='long', fraction_digits=2)
|
| 186 |
+
'1.23 million'
|
| 187 |
+
"""
|
| 188 |
+
return format_compact_decimal(
|
| 189 |
+
number,
|
| 190 |
+
format_type=format_type,
|
| 191 |
+
fraction_digits=fraction_digits,
|
| 192 |
+
locale=self.locale,
|
| 193 |
+
numbering_system=self.numbering_system,
|
| 194 |
+
)
|
| 195 |
+
|
| 196 |
+
def currency(self, number: float | Decimal | str, currency: str) -> str:
|
| 197 |
+
"""Return a number in the given currency formatted for the locale."""
|
| 198 |
+
return format_currency(
|
| 199 |
+
number,
|
| 200 |
+
currency,
|
| 201 |
+
locale=self.locale,
|
| 202 |
+
numbering_system=self.numbering_system,
|
| 203 |
+
)
|
| 204 |
+
|
| 205 |
+
def compact_currency(
|
| 206 |
+
self,
|
| 207 |
+
number: float | Decimal | str,
|
| 208 |
+
currency: str,
|
| 209 |
+
format_type: Literal['short'] = 'short',
|
| 210 |
+
fraction_digits: int = 0,
|
| 211 |
+
) -> str:
|
| 212 |
+
"""Return a number in the given currency formatted for the locale
|
| 213 |
+
using the compact number format.
|
| 214 |
+
|
| 215 |
+
>>> Format('en_US').compact_currency(1234567, "USD", format_type='short', fraction_digits=2)
|
| 216 |
+
'$1.23M'
|
| 217 |
+
"""
|
| 218 |
+
return format_compact_currency(
|
| 219 |
+
number,
|
| 220 |
+
currency,
|
| 221 |
+
format_type=format_type,
|
| 222 |
+
fraction_digits=fraction_digits,
|
| 223 |
+
locale=self.locale,
|
| 224 |
+
numbering_system=self.numbering_system,
|
| 225 |
+
)
|
| 226 |
+
|
| 227 |
+
def percent(self, number: float | Decimal | str, format: str | None = None) -> str:
|
| 228 |
+
"""Return a number formatted as percentage for the locale.
|
| 229 |
+
|
| 230 |
+
>>> fmt = Format('en_US')
|
| 231 |
+
>>> fmt.percent(0.34)
|
| 232 |
+
'34%'
|
| 233 |
+
"""
|
| 234 |
+
return format_percent(
|
| 235 |
+
number,
|
| 236 |
+
format,
|
| 237 |
+
locale=self.locale,
|
| 238 |
+
numbering_system=self.numbering_system,
|
| 239 |
+
)
|
| 240 |
+
|
| 241 |
+
def scientific(self, number: float | Decimal | str) -> str:
|
| 242 |
+
"""Return a number formatted using scientific notation for the locale."""
|
| 243 |
+
return format_scientific(
|
| 244 |
+
number,
|
| 245 |
+
locale=self.locale,
|
| 246 |
+
numbering_system=self.numbering_system,
|
| 247 |
+
)
|
| 248 |
+
|
| 249 |
+
|
| 250 |
+
class LazyProxy:
|
| 251 |
+
"""Class for proxy objects that delegate to a specified function to evaluate
|
| 252 |
+
the actual object.
|
| 253 |
+
|
| 254 |
+
>>> def greeting(name='world'):
|
| 255 |
+
... return 'Hello, %s!' % name
|
| 256 |
+
>>> lazy_greeting = LazyProxy(greeting, name='Joe')
|
| 257 |
+
>>> print(lazy_greeting)
|
| 258 |
+
Hello, Joe!
|
| 259 |
+
>>> ' ' + lazy_greeting
|
| 260 |
+
' Hello, Joe!'
|
| 261 |
+
>>> '(%s)' % lazy_greeting
|
| 262 |
+
'(Hello, Joe!)'
|
| 263 |
+
|
| 264 |
+
This can be used, for example, to implement lazy translation functions that
|
| 265 |
+
delay the actual translation until the string is actually used. The
|
| 266 |
+
rationale for such behavior is that the locale of the user may not always
|
| 267 |
+
be available. In web applications, you only know the locale when processing
|
| 268 |
+
a request.
|
| 269 |
+
|
| 270 |
+
The proxy implementation attempts to be as complete as possible, so that
|
| 271 |
+
the lazy objects should mostly work as expected, for example for sorting:
|
| 272 |
+
|
| 273 |
+
>>> greetings = [
|
| 274 |
+
... LazyProxy(greeting, 'world'),
|
| 275 |
+
... LazyProxy(greeting, 'Joe'),
|
| 276 |
+
... LazyProxy(greeting, 'universe'),
|
| 277 |
+
... ]
|
| 278 |
+
>>> greetings.sort()
|
| 279 |
+
>>> for greeting in greetings:
|
| 280 |
+
... print(greeting)
|
| 281 |
+
Hello, Joe!
|
| 282 |
+
Hello, universe!
|
| 283 |
+
Hello, world!
|
| 284 |
+
"""
|
| 285 |
+
|
| 286 |
+
__slots__ = [
|
| 287 |
+
'_func',
|
| 288 |
+
'_args',
|
| 289 |
+
'_kwargs',
|
| 290 |
+
'_value',
|
| 291 |
+
'_is_cache_enabled',
|
| 292 |
+
'_attribute_error',
|
| 293 |
+
]
|
| 294 |
+
|
| 295 |
+
if TYPE_CHECKING:
|
| 296 |
+
_func: Callable[..., Any]
|
| 297 |
+
_args: tuple[Any, ...]
|
| 298 |
+
_kwargs: dict[str, Any]
|
| 299 |
+
_is_cache_enabled: bool
|
| 300 |
+
_value: Any
|
| 301 |
+
_attribute_error: AttributeError | None
|
| 302 |
+
|
| 303 |
+
def __init__(
|
| 304 |
+
self,
|
| 305 |
+
func: Callable[..., Any],
|
| 306 |
+
*args: Any,
|
| 307 |
+
enable_cache: bool = True,
|
| 308 |
+
**kwargs: Any,
|
| 309 |
+
) -> None:
|
| 310 |
+
# Avoid triggering our own __setattr__ implementation
|
| 311 |
+
object.__setattr__(self, '_func', func)
|
| 312 |
+
object.__setattr__(self, '_args', args)
|
| 313 |
+
object.__setattr__(self, '_kwargs', kwargs)
|
| 314 |
+
object.__setattr__(self, '_is_cache_enabled', enable_cache)
|
| 315 |
+
object.__setattr__(self, '_value', None)
|
| 316 |
+
object.__setattr__(self, '_attribute_error', None)
|
| 317 |
+
|
| 318 |
+
@property
|
| 319 |
+
def value(self) -> Any:
|
| 320 |
+
if self._value is None:
|
| 321 |
+
try:
|
| 322 |
+
value = self._func(*self._args, **self._kwargs)
|
| 323 |
+
except AttributeError as error:
|
| 324 |
+
object.__setattr__(self, '_attribute_error', error)
|
| 325 |
+
raise
|
| 326 |
+
|
| 327 |
+
if not self._is_cache_enabled:
|
| 328 |
+
return value
|
| 329 |
+
object.__setattr__(self, '_value', value)
|
| 330 |
+
return self._value
|
| 331 |
+
|
| 332 |
+
def __contains__(self, key: object) -> bool:
|
| 333 |
+
return key in self.value
|
| 334 |
+
|
| 335 |
+
def __bool__(self) -> bool:
|
| 336 |
+
return bool(self.value)
|
| 337 |
+
|
| 338 |
+
def __dir__(self) -> list[str]:
|
| 339 |
+
return dir(self.value)
|
| 340 |
+
|
| 341 |
+
def __iter__(self) -> Iterator[Any]:
|
| 342 |
+
return iter(self.value)
|
| 343 |
+
|
| 344 |
+
def __len__(self) -> int:
|
| 345 |
+
return len(self.value)
|
| 346 |
+
|
| 347 |
+
def __str__(self) -> str:
|
| 348 |
+
return str(self.value)
|
| 349 |
+
|
| 350 |
+
def __add__(self, other: object) -> Any:
|
| 351 |
+
return self.value + other
|
| 352 |
+
|
| 353 |
+
def __radd__(self, other: object) -> Any:
|
| 354 |
+
return other + self.value
|
| 355 |
+
|
| 356 |
+
def __mod__(self, other: object) -> Any:
|
| 357 |
+
return self.value % other
|
| 358 |
+
|
| 359 |
+
def __rmod__(self, other: object) -> Any:
|
| 360 |
+
return other % self.value
|
| 361 |
+
|
| 362 |
+
def __mul__(self, other: object) -> Any:
|
| 363 |
+
return self.value * other
|
| 364 |
+
|
| 365 |
+
def __rmul__(self, other: object) -> Any:
|
| 366 |
+
return other * self.value
|
| 367 |
+
|
| 368 |
+
def __call__(self, *args: Any, **kwargs: Any) -> Any:
|
| 369 |
+
return self.value(*args, **kwargs)
|
| 370 |
+
|
| 371 |
+
def __lt__(self, other: object) -> bool:
|
| 372 |
+
return self.value < other
|
| 373 |
+
|
| 374 |
+
def __le__(self, other: object) -> bool:
|
| 375 |
+
return self.value <= other
|
| 376 |
+
|
| 377 |
+
def __eq__(self, other: object) -> bool:
|
| 378 |
+
return self.value == other
|
| 379 |
+
|
| 380 |
+
def __ne__(self, other: object) -> bool:
|
| 381 |
+
return self.value != other
|
| 382 |
+
|
| 383 |
+
def __gt__(self, other: object) -> bool:
|
| 384 |
+
return self.value > other
|
| 385 |
+
|
| 386 |
+
def __ge__(self, other: object) -> bool:
|
| 387 |
+
return self.value >= other
|
| 388 |
+
|
| 389 |
+
def __delattr__(self, name: str) -> None:
|
| 390 |
+
delattr(self.value, name)
|
| 391 |
+
|
| 392 |
+
def __getattr__(self, name: str) -> Any:
|
| 393 |
+
if self._attribute_error is not None:
|
| 394 |
+
raise self._attribute_error
|
| 395 |
+
return getattr(self.value, name)
|
| 396 |
+
|
| 397 |
+
def __setattr__(self, name: str, value: Any) -> None:
|
| 398 |
+
setattr(self.value, name, value)
|
| 399 |
+
|
| 400 |
+
def __delitem__(self, key: Any) -> None:
|
| 401 |
+
del self.value[key]
|
| 402 |
+
|
| 403 |
+
def __getitem__(self, key: Any) -> Any:
|
| 404 |
+
return self.value[key]
|
| 405 |
+
|
| 406 |
+
def __setitem__(self, key: Any, value: Any) -> None:
|
| 407 |
+
self.value[key] = value
|
| 408 |
+
|
| 409 |
+
def __copy__(self) -> LazyProxy:
|
| 410 |
+
return LazyProxy(
|
| 411 |
+
self._func,
|
| 412 |
+
enable_cache=self._is_cache_enabled,
|
| 413 |
+
*self._args, # noqa: B026
|
| 414 |
+
**self._kwargs,
|
| 415 |
+
)
|
| 416 |
+
|
| 417 |
+
def __deepcopy__(self, memo: Any) -> LazyProxy:
|
| 418 |
+
from copy import deepcopy
|
| 419 |
+
|
| 420 |
+
return LazyProxy(
|
| 421 |
+
deepcopy(self._func, memo),
|
| 422 |
+
enable_cache=deepcopy(self._is_cache_enabled, memo),
|
| 423 |
+
*deepcopy(self._args, memo), # noqa: B026
|
| 424 |
+
**deepcopy(self._kwargs, memo),
|
| 425 |
+
)
|
| 426 |
+
|
| 427 |
+
|
| 428 |
+
class NullTranslations(gettext.NullTranslations):
|
| 429 |
+
if TYPE_CHECKING:
|
| 430 |
+
_info: dict[str, str]
|
| 431 |
+
_fallback: NullTranslations | None
|
| 432 |
+
|
| 433 |
+
DEFAULT_DOMAIN = None
|
| 434 |
+
|
| 435 |
+
def __init__(self, fp: gettext._TranslationsReader | None = None) -> None:
|
| 436 |
+
"""Initialize a simple translations class which is not backed by a
|
| 437 |
+
real catalog. Behaves similar to gettext.NullTranslations but also
|
| 438 |
+
offers Babel's on *gettext methods (e.g. 'dgettext()').
|
| 439 |
+
|
| 440 |
+
:param fp: a file-like object (ignored in this class)
|
| 441 |
+
"""
|
| 442 |
+
# These attributes are set by gettext.NullTranslations when a catalog
|
| 443 |
+
# is parsed (fp != None). Ensure that they are always present because
|
| 444 |
+
# some *gettext methods (including '.gettext()') rely on the attributes.
|
| 445 |
+
self._catalog: dict[tuple[str, Any] | str, str] = {}
|
| 446 |
+
self.plural: Callable[[float | Decimal], int] = lambda n: int(n != 1)
|
| 447 |
+
super().__init__(fp=fp)
|
| 448 |
+
self.files = list(filter(None, [getattr(fp, 'name', None)]))
|
| 449 |
+
self.domain = self.DEFAULT_DOMAIN
|
| 450 |
+
self._domains: dict[str, NullTranslations] = {}
|
| 451 |
+
|
| 452 |
+
def dgettext(self, domain: str, message: str) -> str:
|
| 453 |
+
"""Like ``gettext()``, but look the message up in the specified
|
| 454 |
+
domain.
|
| 455 |
+
"""
|
| 456 |
+
return self._domains.get(domain, self).gettext(message)
|
| 457 |
+
|
| 458 |
+
def ldgettext(self, domain: str, message: str) -> str:
|
| 459 |
+
"""Like ``lgettext()``, but look the message up in the specified
|
| 460 |
+
domain.
|
| 461 |
+
"""
|
| 462 |
+
import warnings
|
| 463 |
+
|
| 464 |
+
warnings.warn(
|
| 465 |
+
'ldgettext() is deprecated, use dgettext() instead',
|
| 466 |
+
DeprecationWarning,
|
| 467 |
+
stacklevel=2,
|
| 468 |
+
)
|
| 469 |
+
return self._domains.get(domain, self).lgettext(message)
|
| 470 |
+
|
| 471 |
+
def udgettext(self, domain: str, message: str) -> str:
|
| 472 |
+
"""Like ``ugettext()``, but look the message up in the specified
|
| 473 |
+
domain.
|
| 474 |
+
"""
|
| 475 |
+
return self._domains.get(domain, self).ugettext(message)
|
| 476 |
+
|
| 477 |
+
# backward compatibility with 0.9
|
| 478 |
+
dugettext = udgettext
|
| 479 |
+
|
| 480 |
+
def dngettext(self, domain: str, singular: str, plural: str, num: int) -> str:
|
| 481 |
+
"""Like ``ngettext()``, but look the message up in the specified
|
| 482 |
+
domain.
|
| 483 |
+
"""
|
| 484 |
+
return self._domains.get(domain, self).ngettext(singular, plural, num)
|
| 485 |
+
|
| 486 |
+
def ldngettext(self, domain: str, singular: str, plural: str, num: int) -> str:
|
| 487 |
+
"""Like ``lngettext()``, but look the message up in the specified
|
| 488 |
+
domain.
|
| 489 |
+
"""
|
| 490 |
+
import warnings
|
| 491 |
+
|
| 492 |
+
warnings.warn(
|
| 493 |
+
'ldngettext() is deprecated, use dngettext() instead',
|
| 494 |
+
DeprecationWarning,
|
| 495 |
+
stacklevel=2,
|
| 496 |
+
)
|
| 497 |
+
return self._domains.get(domain, self).lngettext(singular, plural, num)
|
| 498 |
+
|
| 499 |
+
def udngettext(self, domain: str, singular: str, plural: str, num: int) -> str:
|
| 500 |
+
"""Like ``ungettext()`` but look the message up in the specified
|
| 501 |
+
domain.
|
| 502 |
+
"""
|
| 503 |
+
return self._domains.get(domain, self).ungettext(singular, plural, num)
|
| 504 |
+
|
| 505 |
+
# backward compatibility with 0.9
|
| 506 |
+
dungettext = udngettext
|
| 507 |
+
|
| 508 |
+
# Most of the downwards code, until it gets included in stdlib, from:
|
| 509 |
+
# https://bugs.python.org/file10036/gettext-pgettext.patch
|
| 510 |
+
#
|
| 511 |
+
# The encoding of a msgctxt and a msgid in a .mo file is
|
| 512 |
+
# msgctxt + "\x04" + msgid (gettext version >= 0.15)
|
| 513 |
+
CONTEXT_ENCODING = '%s\x04%s'
|
| 514 |
+
|
| 515 |
+
def pgettext(self, context: str, message: str) -> str | object:
|
| 516 |
+
"""Look up the `context` and `message` id in the catalog and return the
|
| 517 |
+
corresponding message string, as an 8-bit string encoded with the
|
| 518 |
+
catalog's charset encoding, if known. If there is no entry in the
|
| 519 |
+
catalog for the `message` id and `context` , and a fallback has been
|
| 520 |
+
set, the look up is forwarded to the fallback's ``pgettext()``
|
| 521 |
+
method. Otherwise, the `message` id is returned.
|
| 522 |
+
"""
|
| 523 |
+
ctxt_msg_id = self.CONTEXT_ENCODING % (context, message)
|
| 524 |
+
missing = object()
|
| 525 |
+
tmsg = self._catalog.get(ctxt_msg_id, missing)
|
| 526 |
+
if tmsg is missing:
|
| 527 |
+
tmsg = self._catalog.get((ctxt_msg_id, self.plural(1)), missing)
|
| 528 |
+
if tmsg is not missing:
|
| 529 |
+
return tmsg
|
| 530 |
+
if self._fallback:
|
| 531 |
+
return self._fallback.pgettext(context, message)
|
| 532 |
+
return message
|
| 533 |
+
|
| 534 |
+
def lpgettext(self, context: str, message: str) -> str | bytes | object:
|
| 535 |
+
"""Equivalent to ``pgettext()``, but the translation is returned in the
|
| 536 |
+
preferred system encoding, if no other encoding was explicitly set with
|
| 537 |
+
``bind_textdomain_codeset()``.
|
| 538 |
+
"""
|
| 539 |
+
import warnings
|
| 540 |
+
|
| 541 |
+
warnings.warn(
|
| 542 |
+
'lpgettext() is deprecated, use pgettext() instead',
|
| 543 |
+
DeprecationWarning,
|
| 544 |
+
stacklevel=2,
|
| 545 |
+
)
|
| 546 |
+
tmsg = self.pgettext(context, message)
|
| 547 |
+
encoding = getattr(self, "_output_charset", None) or locale.getpreferredencoding()
|
| 548 |
+
return tmsg.encode(encoding) if isinstance(tmsg, str) else tmsg
|
| 549 |
+
|
| 550 |
+
def npgettext(self, context: str, singular: str, plural: str, num: int) -> str:
|
| 551 |
+
"""Do a plural-forms lookup of a message id. `singular` is used as the
|
| 552 |
+
message id for purposes of lookup in the catalog, while `num` is used to
|
| 553 |
+
determine which plural form to use. The returned message string is an
|
| 554 |
+
8-bit string encoded with the catalog's charset encoding, if known.
|
| 555 |
+
|
| 556 |
+
If the message id for `context` is not found in the catalog, and a
|
| 557 |
+
fallback is specified, the request is forwarded to the fallback's
|
| 558 |
+
``npgettext()`` method. Otherwise, when ``num`` is 1 ``singular`` is
|
| 559 |
+
returned, and ``plural`` is returned in all other cases.
|
| 560 |
+
"""
|
| 561 |
+
ctxt_msg_id = self.CONTEXT_ENCODING % (context, singular)
|
| 562 |
+
try:
|
| 563 |
+
tmsg = self._catalog[(ctxt_msg_id, self.plural(num))]
|
| 564 |
+
return tmsg
|
| 565 |
+
except KeyError:
|
| 566 |
+
if self._fallback:
|
| 567 |
+
return self._fallback.npgettext(context, singular, plural, num)
|
| 568 |
+
if num == 1:
|
| 569 |
+
return singular
|
| 570 |
+
else:
|
| 571 |
+
return plural
|
| 572 |
+
|
| 573 |
+
def lnpgettext(self, context: str, singular: str, plural: str, num: int) -> str | bytes:
|
| 574 |
+
"""Equivalent to ``npgettext()``, but the translation is returned in the
|
| 575 |
+
preferred system encoding, if no other encoding was explicitly set with
|
| 576 |
+
``bind_textdomain_codeset()``.
|
| 577 |
+
"""
|
| 578 |
+
import warnings
|
| 579 |
+
|
| 580 |
+
warnings.warn(
|
| 581 |
+
'lnpgettext() is deprecated, use npgettext() instead',
|
| 582 |
+
DeprecationWarning,
|
| 583 |
+
stacklevel=2,
|
| 584 |
+
)
|
| 585 |
+
ctxt_msg_id = self.CONTEXT_ENCODING % (context, singular)
|
| 586 |
+
try:
|
| 587 |
+
tmsg = self._catalog[(ctxt_msg_id, self.plural(num))]
|
| 588 |
+
encoding = getattr(self, "_output_charset", None) or locale.getpreferredencoding()
|
| 589 |
+
return tmsg.encode(encoding)
|
| 590 |
+
except KeyError:
|
| 591 |
+
if self._fallback:
|
| 592 |
+
return self._fallback.lnpgettext(context, singular, plural, num)
|
| 593 |
+
if num == 1:
|
| 594 |
+
return singular
|
| 595 |
+
else:
|
| 596 |
+
return plural
|
| 597 |
+
|
| 598 |
+
def upgettext(self, context: str, message: str) -> str:
|
| 599 |
+
"""Look up the `context` and `message` id in the catalog and return the
|
| 600 |
+
corresponding message string, as a Unicode string. If there is no entry
|
| 601 |
+
in the catalog for the `message` id and `context`, and a fallback has
|
| 602 |
+
been set, the look up is forwarded to the fallback's ``upgettext()``
|
| 603 |
+
method. Otherwise, the `message` id is returned.
|
| 604 |
+
"""
|
| 605 |
+
ctxt_message_id = self.CONTEXT_ENCODING % (context, message)
|
| 606 |
+
missing = object()
|
| 607 |
+
tmsg = self._catalog.get(ctxt_message_id, missing)
|
| 608 |
+
if tmsg is missing:
|
| 609 |
+
if self._fallback:
|
| 610 |
+
return self._fallback.upgettext(context, message)
|
| 611 |
+
return str(message)
|
| 612 |
+
assert isinstance(tmsg, str)
|
| 613 |
+
return tmsg
|
| 614 |
+
|
| 615 |
+
def unpgettext(self, context: str, singular: str, plural: str, num: int) -> str:
|
| 616 |
+
"""Do a plural-forms lookup of a message id. `singular` is used as the
|
| 617 |
+
message id for purposes of lookup in the catalog, while `num` is used to
|
| 618 |
+
determine which plural form to use. The returned message string is a
|
| 619 |
+
Unicode string.
|
| 620 |
+
|
| 621 |
+
If the message id for `context` is not found in the catalog, and a
|
| 622 |
+
fallback is specified, the request is forwarded to the fallback's
|
| 623 |
+
``unpgettext()`` method. Otherwise, when `num` is 1 `singular` is
|
| 624 |
+
returned, and `plural` is returned in all other cases.
|
| 625 |
+
"""
|
| 626 |
+
ctxt_message_id = self.CONTEXT_ENCODING % (context, singular)
|
| 627 |
+
try:
|
| 628 |
+
tmsg = self._catalog[(ctxt_message_id, self.plural(num))]
|
| 629 |
+
except KeyError:
|
| 630 |
+
if self._fallback:
|
| 631 |
+
return self._fallback.unpgettext(context, singular, plural, num)
|
| 632 |
+
tmsg = str(singular) if num == 1 else str(plural)
|
| 633 |
+
return tmsg
|
| 634 |
+
|
| 635 |
+
def dpgettext(self, domain: str, context: str, message: str) -> str | object:
|
| 636 |
+
"""Like `pgettext()`, but look the message up in the specified
|
| 637 |
+
`domain`.
|
| 638 |
+
"""
|
| 639 |
+
return self._domains.get(domain, self).pgettext(context, message)
|
| 640 |
+
|
| 641 |
+
def udpgettext(self, domain: str, context: str, message: str) -> str:
|
| 642 |
+
"""Like `upgettext()`, but look the message up in the specified
|
| 643 |
+
`domain`.
|
| 644 |
+
"""
|
| 645 |
+
return self._domains.get(domain, self).upgettext(context, message)
|
| 646 |
+
|
| 647 |
+
# backward compatibility with 0.9
|
| 648 |
+
dupgettext = udpgettext
|
| 649 |
+
|
| 650 |
+
def ldpgettext(self, domain: str, context: str, message: str) -> str | bytes | object:
|
| 651 |
+
"""Equivalent to ``dpgettext()``, but the translation is returned in the
|
| 652 |
+
preferred system encoding, if no other encoding was explicitly set with
|
| 653 |
+
``bind_textdomain_codeset()``.
|
| 654 |
+
"""
|
| 655 |
+
return self._domains.get(domain, self).lpgettext(context, message)
|
| 656 |
+
|
| 657 |
+
def dnpgettext(self, domain: str, context: str, singular: str, plural: str, num: int) -> str: # fmt: skip
|
| 658 |
+
"""Like ``npgettext``, but look the message up in the specified
|
| 659 |
+
`domain`.
|
| 660 |
+
"""
|
| 661 |
+
return self._domains.get(domain, self).npgettext(context, singular, plural, num)
|
| 662 |
+
|
| 663 |
+
def udnpgettext(self, domain: str, context: str, singular: str, plural: str, num: int) -> str: # fmt: skip
|
| 664 |
+
"""Like ``unpgettext``, but look the message up in the specified
|
| 665 |
+
`domain`.
|
| 666 |
+
"""
|
| 667 |
+
return self._domains.get(domain, self).unpgettext(context, singular, plural, num)
|
| 668 |
+
|
| 669 |
+
# backward compatibility with 0.9
|
| 670 |
+
dunpgettext = udnpgettext
|
| 671 |
+
|
| 672 |
+
def ldnpgettext(
|
| 673 |
+
self,
|
| 674 |
+
domain: str,
|
| 675 |
+
context: str,
|
| 676 |
+
singular: str,
|
| 677 |
+
plural: str,
|
| 678 |
+
num: int,
|
| 679 |
+
) -> str | bytes:
|
| 680 |
+
"""Equivalent to ``dnpgettext()``, but the translation is returned in
|
| 681 |
+
the preferred system encoding, if no other encoding was explicitly set
|
| 682 |
+
with ``bind_textdomain_codeset()``.
|
| 683 |
+
"""
|
| 684 |
+
return self._domains.get(domain, self).lnpgettext(context, singular, plural, num)
|
| 685 |
+
|
| 686 |
+
ugettext = gettext.NullTranslations.gettext
|
| 687 |
+
ungettext = gettext.NullTranslations.ngettext
|
| 688 |
+
|
| 689 |
+
|
| 690 |
+
class Translations(NullTranslations, gettext.GNUTranslations):
|
| 691 |
+
"""An extended translation catalog class."""
|
| 692 |
+
|
| 693 |
+
DEFAULT_DOMAIN = 'messages'
|
| 694 |
+
|
| 695 |
+
def __init__(
|
| 696 |
+
self,
|
| 697 |
+
fp: gettext._TranslationsReader | None = None,
|
| 698 |
+
domain: str | None = None,
|
| 699 |
+
):
|
| 700 |
+
"""Initialize the translations catalog.
|
| 701 |
+
|
| 702 |
+
:param fp: the file-like object the translation should be read from
|
| 703 |
+
:param domain: the message domain (default: 'messages')
|
| 704 |
+
"""
|
| 705 |
+
super().__init__(fp=fp)
|
| 706 |
+
self.domain = domain or self.DEFAULT_DOMAIN
|
| 707 |
+
|
| 708 |
+
ugettext = gettext.GNUTranslations.gettext
|
| 709 |
+
ungettext = gettext.GNUTranslations.ngettext
|
| 710 |
+
|
| 711 |
+
@classmethod
|
| 712 |
+
def load(
|
| 713 |
+
cls,
|
| 714 |
+
dirname: str | os.PathLike[str] | None = None,
|
| 715 |
+
locales: Iterable[str | Locale] | Locale | str | None = None,
|
| 716 |
+
domain: str | None = None,
|
| 717 |
+
) -> NullTranslations:
|
| 718 |
+
"""Load translations from the given directory.
|
| 719 |
+
|
| 720 |
+
:param dirname: the directory containing the ``MO`` files
|
| 721 |
+
:param locales: the list of locales in order of preference (items in
|
| 722 |
+
this list can be either `Locale` objects or locale
|
| 723 |
+
strings)
|
| 724 |
+
:param domain: the message domain (default: 'messages')
|
| 725 |
+
"""
|
| 726 |
+
if not domain:
|
| 727 |
+
domain = cls.DEFAULT_DOMAIN
|
| 728 |
+
filename = gettext.find(domain, dirname, _locales_to_names(locales))
|
| 729 |
+
if not filename:
|
| 730 |
+
return NullTranslations()
|
| 731 |
+
with open(filename, 'rb') as fp:
|
| 732 |
+
return cls(fp=fp, domain=domain)
|
| 733 |
+
|
| 734 |
+
def __repr__(self) -> str:
|
| 735 |
+
version = self._info.get('project-id-version')
|
| 736 |
+
return f'<{type(self).__name__}: "{version}">'
|
| 737 |
+
|
| 738 |
+
def add(self, translations: Translations, merge: bool = True):
|
| 739 |
+
"""Add the given translations to the catalog.
|
| 740 |
+
|
| 741 |
+
If the domain of the translations is different than that of the
|
| 742 |
+
current catalog, they are added as a catalog that is only accessible
|
| 743 |
+
by the various ``d*gettext`` functions.
|
| 744 |
+
|
| 745 |
+
:param translations: the `Translations` instance with the messages to
|
| 746 |
+
add
|
| 747 |
+
:param merge: whether translations for message domains that have
|
| 748 |
+
already been added should be merged with the existing
|
| 749 |
+
translations
|
| 750 |
+
"""
|
| 751 |
+
domain = getattr(translations, 'domain', self.DEFAULT_DOMAIN)
|
| 752 |
+
if merge and domain == self.domain:
|
| 753 |
+
return self.merge(translations)
|
| 754 |
+
|
| 755 |
+
existing = self._domains.get(domain)
|
| 756 |
+
if merge and isinstance(existing, Translations):
|
| 757 |
+
existing.merge(translations)
|
| 758 |
+
else:
|
| 759 |
+
translations.add_fallback(self)
|
| 760 |
+
self._domains[domain] = translations
|
| 761 |
+
|
| 762 |
+
return self
|
| 763 |
+
|
| 764 |
+
def merge(self, translations: Translations):
|
| 765 |
+
"""Merge the given translations into the catalog.
|
| 766 |
+
|
| 767 |
+
Message translations in the specified catalog override any messages
|
| 768 |
+
with the same identifier in the existing catalog.
|
| 769 |
+
|
| 770 |
+
:param translations: the `Translations` instance with the messages to
|
| 771 |
+
merge
|
| 772 |
+
"""
|
| 773 |
+
if isinstance(translations, gettext.GNUTranslations):
|
| 774 |
+
self._catalog.update(translations._catalog)
|
| 775 |
+
if isinstance(translations, Translations):
|
| 776 |
+
self.files.extend(translations.files)
|
| 777 |
+
|
| 778 |
+
return self
|
| 779 |
+
|
| 780 |
+
|
| 781 |
+
def _locales_to_names(
|
| 782 |
+
locales: Iterable[str | Locale] | Locale | str | None,
|
| 783 |
+
) -> list[str] | None:
|
| 784 |
+
"""Normalize a `locales` argument to a list of locale names.
|
| 785 |
+
|
| 786 |
+
:param locales: the list of locales in order of preference (items in
|
| 787 |
+
this list can be either `Locale` objects or locale
|
| 788 |
+
strings)
|
| 789 |
+
"""
|
| 790 |
+
if locales is None:
|
| 791 |
+
return None
|
| 792 |
+
if isinstance(locales, Locale):
|
| 793 |
+
return [str(locales)]
|
| 794 |
+
if isinstance(locales, str):
|
| 795 |
+
return [locales]
|
| 796 |
+
return [str(locale) for locale in locales]
|
micromamba_root/Lib/site-packages/babel/units.py
ADDED
|
@@ -0,0 +1,362 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from __future__ import annotations
|
| 2 |
+
|
| 3 |
+
import decimal
|
| 4 |
+
from typing import Literal
|
| 5 |
+
|
| 6 |
+
from babel.core import Locale
|
| 7 |
+
from babel.numbers import LC_NUMERIC, format_decimal
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
class UnknownUnitError(ValueError):
|
| 11 |
+
def __init__(self, unit: str, locale: Locale) -> None:
|
| 12 |
+
ValueError.__init__(self, f"{unit} is not a known unit in {locale}")
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
def get_unit_name(
|
| 16 |
+
measurement_unit: str,
|
| 17 |
+
length: Literal['short', 'long', 'narrow'] = 'long',
|
| 18 |
+
locale: Locale | str | None = None,
|
| 19 |
+
) -> str | None:
|
| 20 |
+
"""
|
| 21 |
+
Get the display name for a measurement unit in the given locale.
|
| 22 |
+
|
| 23 |
+
>>> get_unit_name("radian", locale="en")
|
| 24 |
+
'radians'
|
| 25 |
+
|
| 26 |
+
Unknown units will raise exceptions:
|
| 27 |
+
|
| 28 |
+
>>> get_unit_name("battery", locale="fi")
|
| 29 |
+
Traceback (most recent call last):
|
| 30 |
+
...
|
| 31 |
+
UnknownUnitError: battery/long is not a known unit/length in fi
|
| 32 |
+
|
| 33 |
+
:param measurement_unit: the code of a measurement unit.
|
| 34 |
+
Known units can be found in the CLDR Unit Validity XML file:
|
| 35 |
+
https://unicode.org/repos/cldr/tags/latest/common/validity/unit.xml
|
| 36 |
+
|
| 37 |
+
:param length: "short", "long" or "narrow"
|
| 38 |
+
:param locale: the `Locale` object or locale identifier. Defaults to the system numeric locale.
|
| 39 |
+
:return: The unit display name, or None.
|
| 40 |
+
"""
|
| 41 |
+
locale = Locale.parse(locale or LC_NUMERIC)
|
| 42 |
+
unit = _find_unit_pattern(measurement_unit, locale=locale)
|
| 43 |
+
if not unit:
|
| 44 |
+
raise UnknownUnitError(unit=measurement_unit, locale=locale)
|
| 45 |
+
return locale.unit_display_names.get(unit, {}).get(length)
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
def _find_unit_pattern(unit_id: str, locale: Locale | str | None = None) -> str | None:
|
| 49 |
+
"""
|
| 50 |
+
Expand a unit into a qualified form.
|
| 51 |
+
|
| 52 |
+
Known units can be found in the CLDR Unit Validity XML file:
|
| 53 |
+
https://unicode.org/repos/cldr/tags/latest/common/validity/unit.xml
|
| 54 |
+
|
| 55 |
+
>>> _find_unit_pattern("radian", locale="en")
|
| 56 |
+
'angle-radian'
|
| 57 |
+
|
| 58 |
+
Unknown values will return None.
|
| 59 |
+
|
| 60 |
+
>>> _find_unit_pattern("horse", locale="en")
|
| 61 |
+
|
| 62 |
+
:param unit_id: the code of a measurement unit.
|
| 63 |
+
:return: A key to the `unit_patterns` mapping, or None.
|
| 64 |
+
"""
|
| 65 |
+
locale = Locale.parse(locale or LC_NUMERIC)
|
| 66 |
+
unit_patterns: dict[str, str] = locale._data["unit_patterns"]
|
| 67 |
+
if unit_id in unit_patterns:
|
| 68 |
+
return unit_id
|
| 69 |
+
for unit_pattern in sorted(unit_patterns, key=len):
|
| 70 |
+
if unit_pattern.endswith(unit_id):
|
| 71 |
+
return unit_pattern
|
| 72 |
+
return None
|
| 73 |
+
|
| 74 |
+
|
| 75 |
+
def format_unit(
|
| 76 |
+
value: str | float | decimal.Decimal,
|
| 77 |
+
measurement_unit: str,
|
| 78 |
+
length: Literal['short', 'long', 'narrow'] = 'long',
|
| 79 |
+
format: str | None = None,
|
| 80 |
+
locale: Locale | str | None = None,
|
| 81 |
+
*,
|
| 82 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 83 |
+
) -> str:
|
| 84 |
+
"""Format a value of a given unit.
|
| 85 |
+
|
| 86 |
+
Values are formatted according to the locale's usual pluralization rules
|
| 87 |
+
and number formats.
|
| 88 |
+
|
| 89 |
+
>>> format_unit(12, 'length-meter', locale='ro_RO')
|
| 90 |
+
'12 metri'
|
| 91 |
+
>>> format_unit(15.5, 'length-mile', locale='fi_FI')
|
| 92 |
+
'15,5 mailia'
|
| 93 |
+
>>> format_unit(1200, 'pressure-millimeter-ofhg', locale='nb')
|
| 94 |
+
'1\\xa0200 millimeter kvikks\\xf8lv'
|
| 95 |
+
>>> format_unit(270, 'ton', locale='en')
|
| 96 |
+
'270 tons'
|
| 97 |
+
>>> format_unit(1234.5, 'kilogram', locale='ar_EG', numbering_system='default')
|
| 98 |
+
'1٬234٫5 كيلوغرام'
|
| 99 |
+
|
| 100 |
+
Number formats may be overridden with the ``format`` parameter.
|
| 101 |
+
|
| 102 |
+
>>> import decimal
|
| 103 |
+
>>> format_unit(decimal.Decimal("-42.774"), 'temperature-celsius', 'short', format='#.0', locale='fr')
|
| 104 |
+
'-42,8\\u202f\\xb0C'
|
| 105 |
+
|
| 106 |
+
The locale's usual pluralization rules are respected.
|
| 107 |
+
|
| 108 |
+
>>> format_unit(1, 'length-meter', locale='ro_RO')
|
| 109 |
+
'1 metru'
|
| 110 |
+
>>> format_unit(0, 'length-mile', locale='cy')
|
| 111 |
+
'0 mi'
|
| 112 |
+
>>> format_unit(1, 'length-mile', locale='cy')
|
| 113 |
+
'1 filltir'
|
| 114 |
+
>>> format_unit(3, 'length-mile', locale='cy')
|
| 115 |
+
'3 milltir'
|
| 116 |
+
|
| 117 |
+
>>> format_unit(15, 'length-horse', locale='fi')
|
| 118 |
+
Traceback (most recent call last):
|
| 119 |
+
...
|
| 120 |
+
UnknownUnitError: length-horse is not a known unit in fi
|
| 121 |
+
|
| 122 |
+
.. versionadded:: 2.2.0
|
| 123 |
+
|
| 124 |
+
:param value: the value to format. If this is a string, no number formatting will be attempted.
|
| 125 |
+
:param measurement_unit: the code of a measurement unit.
|
| 126 |
+
Known units can be found in the CLDR Unit Validity XML file:
|
| 127 |
+
https://unicode.org/repos/cldr/tags/latest/common/validity/unit.xml
|
| 128 |
+
:param length: "short", "long" or "narrow"
|
| 129 |
+
:param format: An optional format, as accepted by `format_decimal`.
|
| 130 |
+
:param locale: the `Locale` object or locale identifier. Defaults to the system numeric locale.
|
| 131 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 132 |
+
The special value "default" will use the default numbering system of the locale.
|
| 133 |
+
:raise `UnsupportedNumberingSystemError`: If the numbering system is not supported by the locale.
|
| 134 |
+
"""
|
| 135 |
+
locale = Locale.parse(locale or LC_NUMERIC)
|
| 136 |
+
|
| 137 |
+
q_unit = _find_unit_pattern(measurement_unit, locale=locale)
|
| 138 |
+
if not q_unit:
|
| 139 |
+
raise UnknownUnitError(unit=measurement_unit, locale=locale)
|
| 140 |
+
unit_patterns = locale._data["unit_patterns"][q_unit].get(length, {})
|
| 141 |
+
|
| 142 |
+
if isinstance(value, str): # Assume the value is a preformatted singular.
|
| 143 |
+
formatted_value = value
|
| 144 |
+
plural_form = "one"
|
| 145 |
+
else:
|
| 146 |
+
formatted_value = format_decimal(
|
| 147 |
+
value,
|
| 148 |
+
format,
|
| 149 |
+
locale,
|
| 150 |
+
numbering_system=numbering_system,
|
| 151 |
+
)
|
| 152 |
+
plural_form = locale.plural_form(value)
|
| 153 |
+
|
| 154 |
+
if plural_form in unit_patterns:
|
| 155 |
+
return unit_patterns[plural_form].format(formatted_value)
|
| 156 |
+
|
| 157 |
+
# Fall back to a somewhat bad representation.
|
| 158 |
+
# nb: This is marked as no-cover, as the current CLDR seemingly has no way for this to happen.
|
| 159 |
+
fallback_name = get_unit_name( # pragma: no cover
|
| 160 |
+
measurement_unit,
|
| 161 |
+
length=length,
|
| 162 |
+
locale=locale,
|
| 163 |
+
)
|
| 164 |
+
return f"{formatted_value} {fallback_name or measurement_unit}" # pragma: no cover
|
| 165 |
+
|
| 166 |
+
|
| 167 |
+
def _find_compound_unit(
|
| 168 |
+
numerator_unit: str,
|
| 169 |
+
denominator_unit: str,
|
| 170 |
+
locale: Locale | str | None = None,
|
| 171 |
+
) -> str | None:
|
| 172 |
+
"""
|
| 173 |
+
Find a predefined compound unit pattern.
|
| 174 |
+
|
| 175 |
+
Used internally by format_compound_unit.
|
| 176 |
+
|
| 177 |
+
>>> _find_compound_unit("kilometer", "hour", locale="en")
|
| 178 |
+
'speed-kilometer-per-hour'
|
| 179 |
+
|
| 180 |
+
>>> _find_compound_unit("mile", "gallon", locale="en")
|
| 181 |
+
'consumption-mile-per-gallon'
|
| 182 |
+
|
| 183 |
+
If no predefined compound pattern can be found, `None` is returned.
|
| 184 |
+
|
| 185 |
+
>>> _find_compound_unit("gallon", "mile", locale="en")
|
| 186 |
+
|
| 187 |
+
>>> _find_compound_unit("horse", "purple", locale="en")
|
| 188 |
+
|
| 189 |
+
:param numerator_unit: The numerator unit's identifier
|
| 190 |
+
:param denominator_unit: The denominator unit's identifier
|
| 191 |
+
:param locale: the `Locale` object or locale identifier. Defaults to the system numeric locale.
|
| 192 |
+
:return: A key to the `unit_patterns` mapping, or None.
|
| 193 |
+
:rtype: str|None
|
| 194 |
+
"""
|
| 195 |
+
locale = Locale.parse(locale or LC_NUMERIC)
|
| 196 |
+
|
| 197 |
+
# Qualify the numerator and denominator units. This will turn possibly partial
|
| 198 |
+
# units like "kilometer" or "hour" into actual units like "length-kilometer" and
|
| 199 |
+
# "duration-hour".
|
| 200 |
+
|
| 201 |
+
resolved_numerator_unit = _find_unit_pattern(numerator_unit, locale=locale)
|
| 202 |
+
resolved_denominator_unit = _find_unit_pattern(denominator_unit, locale=locale)
|
| 203 |
+
|
| 204 |
+
# If either was not found, we can't possibly build a suitable compound unit either.
|
| 205 |
+
if not (resolved_numerator_unit and resolved_denominator_unit):
|
| 206 |
+
return None
|
| 207 |
+
|
| 208 |
+
# Since compound units are named "speed-kilometer-per-hour", we'll have to slice off
|
| 209 |
+
# the quantities (i.e. "length", "duration") from both qualified units.
|
| 210 |
+
|
| 211 |
+
bare_numerator_unit = resolved_numerator_unit.split("-", 1)[-1]
|
| 212 |
+
bare_denominator_unit = resolved_denominator_unit.split("-", 1)[-1]
|
| 213 |
+
|
| 214 |
+
# Now we can try and rebuild a compound unit specifier, then qualify it:
|
| 215 |
+
|
| 216 |
+
return _find_unit_pattern(
|
| 217 |
+
f"{bare_numerator_unit}-per-{bare_denominator_unit}",
|
| 218 |
+
locale=locale,
|
| 219 |
+
)
|
| 220 |
+
|
| 221 |
+
|
| 222 |
+
def format_compound_unit(
|
| 223 |
+
numerator_value: str | float | decimal.Decimal,
|
| 224 |
+
numerator_unit: str | None = None,
|
| 225 |
+
denominator_value: str | float | decimal.Decimal = 1,
|
| 226 |
+
denominator_unit: str | None = None,
|
| 227 |
+
length: Literal["short", "long", "narrow"] = "long",
|
| 228 |
+
format: str | None = None,
|
| 229 |
+
locale: Locale | str | None = None,
|
| 230 |
+
*,
|
| 231 |
+
numbering_system: Literal["default"] | str = "latn",
|
| 232 |
+
) -> str | None:
|
| 233 |
+
"""
|
| 234 |
+
Format a compound number value, i.e. "kilometers per hour" or similar.
|
| 235 |
+
|
| 236 |
+
Both unit specifiers are optional to allow for formatting of arbitrary values still according
|
| 237 |
+
to the locale's general "per" formatting specifier.
|
| 238 |
+
|
| 239 |
+
>>> format_compound_unit(7, denominator_value=11, length="short", locale="pt")
|
| 240 |
+
'7/11'
|
| 241 |
+
|
| 242 |
+
>>> format_compound_unit(150, "kilometer", denominator_unit="hour", locale="sv")
|
| 243 |
+
'150 kilometer per timme'
|
| 244 |
+
|
| 245 |
+
>>> format_compound_unit(150, "kilowatt", denominator_unit="year", locale="fi")
|
| 246 |
+
'150 kilowattia / vuosi'
|
| 247 |
+
|
| 248 |
+
>>> format_compound_unit(32.5, "ton", 15, denominator_unit="hour", locale="en")
|
| 249 |
+
'32.5 tons per 15 hours'
|
| 250 |
+
|
| 251 |
+
>>> format_compound_unit(1234.5, "ton", 15, denominator_unit="hour", locale="ar_EG", numbering_system="arab")
|
| 252 |
+
'1٬234٫5 طن لكل 15 ساعة'
|
| 253 |
+
|
| 254 |
+
>>> format_compound_unit(160, denominator_unit="square-meter", locale="fr")
|
| 255 |
+
'160 par m\\xe8tre carr\\xe9'
|
| 256 |
+
|
| 257 |
+
>>> format_compound_unit(4, "meter", "ratakisko", length="short", locale="fi")
|
| 258 |
+
'4 m/ratakisko'
|
| 259 |
+
|
| 260 |
+
>>> format_compound_unit(35, "minute", denominator_unit="nautical-mile", locale="sv")
|
| 261 |
+
'35 minuter per nautisk mil'
|
| 262 |
+
|
| 263 |
+
>>> from babel.numbers import format_currency
|
| 264 |
+
>>> format_compound_unit(format_currency(35, "JPY", locale="de"), denominator_unit="liter", locale="de")
|
| 265 |
+
'35\\xa0\\xa5 pro Liter'
|
| 266 |
+
|
| 267 |
+
See https://www.unicode.org/reports/tr35/tr35-general.html#perUnitPatterns
|
| 268 |
+
|
| 269 |
+
:param numerator_value: The numerator value. This may be a string,
|
| 270 |
+
in which case it is considered preformatted and the unit is ignored.
|
| 271 |
+
:param numerator_unit: The numerator unit. See `format_unit`.
|
| 272 |
+
:param denominator_value: The denominator value. This may be a string,
|
| 273 |
+
in which case it is considered preformatted and the unit is ignored.
|
| 274 |
+
:param denominator_unit: The denominator unit. See `format_unit`.
|
| 275 |
+
:param length: The formatting length. "short", "long" or "narrow"
|
| 276 |
+
:param format: An optional format, as accepted by `format_decimal`.
|
| 277 |
+
:param locale: the `Locale` object or locale identifier. Defaults to the system numeric locale.
|
| 278 |
+
:param numbering_system: The numbering system used for formatting number symbols. Defaults to "latn".
|
| 279 |
+
The special value "default" will use the default numbering system of the locale.
|
| 280 |
+
:return: A formatted compound value.
|
| 281 |
+
:raise `UnsupportedNumberingSystemError`: If the numbering system is not supported by the locale.
|
| 282 |
+
"""
|
| 283 |
+
locale = Locale.parse(locale or LC_NUMERIC)
|
| 284 |
+
|
| 285 |
+
# Look for a specific compound unit first...
|
| 286 |
+
|
| 287 |
+
if numerator_unit and denominator_unit and denominator_value == 1:
|
| 288 |
+
compound_unit = _find_compound_unit(numerator_unit, denominator_unit, locale=locale)
|
| 289 |
+
if compound_unit:
|
| 290 |
+
return format_unit(
|
| 291 |
+
numerator_value,
|
| 292 |
+
compound_unit,
|
| 293 |
+
length=length,
|
| 294 |
+
format=format,
|
| 295 |
+
locale=locale,
|
| 296 |
+
numbering_system=numbering_system,
|
| 297 |
+
)
|
| 298 |
+
|
| 299 |
+
# ... failing that, construct one "by hand".
|
| 300 |
+
|
| 301 |
+
if isinstance(numerator_value, str): # Numerator is preformatted
|
| 302 |
+
formatted_numerator = numerator_value
|
| 303 |
+
elif numerator_unit: # Numerator has unit
|
| 304 |
+
formatted_numerator = format_unit(
|
| 305 |
+
numerator_value,
|
| 306 |
+
numerator_unit,
|
| 307 |
+
length=length,
|
| 308 |
+
format=format,
|
| 309 |
+
locale=locale,
|
| 310 |
+
numbering_system=numbering_system,
|
| 311 |
+
)
|
| 312 |
+
else: # Unitless numerator
|
| 313 |
+
formatted_numerator = format_decimal(
|
| 314 |
+
numerator_value,
|
| 315 |
+
format=format,
|
| 316 |
+
locale=locale,
|
| 317 |
+
numbering_system=numbering_system,
|
| 318 |
+
)
|
| 319 |
+
|
| 320 |
+
if isinstance(denominator_value, str): # Denominator is preformatted
|
| 321 |
+
formatted_denominator = denominator_value
|
| 322 |
+
elif denominator_unit: # Denominator has unit
|
| 323 |
+
if denominator_value == 1: # support perUnitPatterns when the denominator is 1
|
| 324 |
+
denominator_unit = _find_unit_pattern(denominator_unit, locale=locale)
|
| 325 |
+
per_pattern = (
|
| 326 |
+
locale._data["unit_patterns"]
|
| 327 |
+
.get(denominator_unit, {})
|
| 328 |
+
.get(length, {})
|
| 329 |
+
.get("per")
|
| 330 |
+
)
|
| 331 |
+
if per_pattern:
|
| 332 |
+
return per_pattern.format(formatted_numerator)
|
| 333 |
+
# See TR-35's per-unit pattern algorithm, point 3.2.
|
| 334 |
+
# For denominator 1, we replace the value to be formatted with the empty string;
|
| 335 |
+
# this will make `format_unit` return " second" instead of "1 second".
|
| 336 |
+
denominator_value = ""
|
| 337 |
+
|
| 338 |
+
formatted_denominator = format_unit(
|
| 339 |
+
denominator_value,
|
| 340 |
+
measurement_unit=(denominator_unit or ""),
|
| 341 |
+
length=length,
|
| 342 |
+
format=format,
|
| 343 |
+
locale=locale,
|
| 344 |
+
numbering_system=numbering_system,
|
| 345 |
+
).strip()
|
| 346 |
+
else: # Bare denominator
|
| 347 |
+
formatted_denominator = format_decimal(
|
| 348 |
+
denominator_value,
|
| 349 |
+
format=format,
|
| 350 |
+
locale=locale,
|
| 351 |
+
numbering_system=numbering_system,
|
| 352 |
+
)
|
| 353 |
+
|
| 354 |
+
# TODO: this doesn't support "compound_variations" (or "prefix"), and will fall back to the "x/y" representation
|
| 355 |
+
per_pattern = (
|
| 356 |
+
locale._data["compound_unit_patterns"]
|
| 357 |
+
.get("per", {})
|
| 358 |
+
.get(length, {})
|
| 359 |
+
.get("compound", "{0}/{1}")
|
| 360 |
+
)
|
| 361 |
+
|
| 362 |
+
return per_pattern.format(formatted_numerator, formatted_denominator)
|
micromamba_root/Lib/site-packages/babel/util.py
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
babel.util
|
| 3 |
+
~~~~~~~~~~
|
| 4 |
+
|
| 5 |
+
Various utility classes and functions.
|
| 6 |
+
|
| 7 |
+
:copyright: (c) 2013-2026 by the Babel Team.
|
| 8 |
+
:license: BSD, see LICENSE for more details.
|
| 9 |
+
"""
|
| 10 |
+
|
| 11 |
+
from __future__ import annotations
|
| 12 |
+
|
| 13 |
+
import codecs
|
| 14 |
+
import datetime
|
| 15 |
+
import os
|
| 16 |
+
import re
|
| 17 |
+
import textwrap
|
| 18 |
+
import warnings
|
| 19 |
+
from collections.abc import Generator, Iterable
|
| 20 |
+
from typing import IO, Any, TypeVar
|
| 21 |
+
|
| 22 |
+
from babel import dates, localtime
|
| 23 |
+
|
| 24 |
+
missing = object()
|
| 25 |
+
|
| 26 |
+
_T = TypeVar("_T")
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def distinct(iterable: Iterable[_T]) -> Generator[_T, None, None]:
|
| 30 |
+
"""Yield all items in an iterable collection that are distinct.
|
| 31 |
+
|
| 32 |
+
Unlike when using sets for a similar effect, the original ordering of the
|
| 33 |
+
items in the collection is preserved by this function.
|
| 34 |
+
|
| 35 |
+
>>> print(list(distinct([1, 2, 1, 3, 4, 4])))
|
| 36 |
+
[1, 2, 3, 4]
|
| 37 |
+
>>> print(list(distinct('foobar')))
|
| 38 |
+
['f', 'o', 'b', 'a', 'r']
|
| 39 |
+
|
| 40 |
+
:param iterable: the iterable collection providing the data
|
| 41 |
+
"""
|
| 42 |
+
seen = set()
|
| 43 |
+
for item in iter(iterable):
|
| 44 |
+
if item not in seen:
|
| 45 |
+
yield item
|
| 46 |
+
seen.add(item)
|
| 47 |
+
|
| 48 |
+
|
| 49 |
+
# Regexp to match python magic encoding line
|
| 50 |
+
PYTHON_MAGIC_COMMENT_re = re.compile(
|
| 51 |
+
rb'[ \t\f]* \# .* coding[=:][ \t]*([-\w.]+)',
|
| 52 |
+
flags=re.VERBOSE,
|
| 53 |
+
)
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
def parse_encoding(fp: IO[bytes]) -> str | None:
|
| 57 |
+
"""Deduce the encoding of a source file from magic comment.
|
| 58 |
+
|
| 59 |
+
It does this in the same way as the `Python interpreter`__
|
| 60 |
+
|
| 61 |
+
.. __: https://docs.python.org/3.4/reference/lexical_analysis.html#encoding-declarations
|
| 62 |
+
|
| 63 |
+
The ``fp`` argument should be a seekable file object.
|
| 64 |
+
|
| 65 |
+
(From Jeff Dairiki)
|
| 66 |
+
"""
|
| 67 |
+
pos = fp.tell()
|
| 68 |
+
fp.seek(0)
|
| 69 |
+
try:
|
| 70 |
+
line1 = fp.readline()
|
| 71 |
+
has_bom = line1.startswith(codecs.BOM_UTF8)
|
| 72 |
+
if has_bom:
|
| 73 |
+
line1 = line1[len(codecs.BOM_UTF8) :]
|
| 74 |
+
|
| 75 |
+
m = PYTHON_MAGIC_COMMENT_re.match(line1)
|
| 76 |
+
if not m:
|
| 77 |
+
try:
|
| 78 |
+
import ast
|
| 79 |
+
|
| 80 |
+
ast.parse(line1.decode('latin-1'))
|
| 81 |
+
except (ImportError, SyntaxError, UnicodeEncodeError):
|
| 82 |
+
# Either it's a real syntax error, in which case the source is
|
| 83 |
+
# not valid python source, or line2 is a continuation of line1,
|
| 84 |
+
# in which case we don't want to scan line2 for a magic
|
| 85 |
+
# comment.
|
| 86 |
+
pass
|
| 87 |
+
else:
|
| 88 |
+
line2 = fp.readline()
|
| 89 |
+
m = PYTHON_MAGIC_COMMENT_re.match(line2)
|
| 90 |
+
|
| 91 |
+
if has_bom:
|
| 92 |
+
if m:
|
| 93 |
+
magic_comment_encoding = m.group(1).decode('latin-1')
|
| 94 |
+
if magic_comment_encoding != 'utf-8':
|
| 95 |
+
raise SyntaxError(f"encoding problem: {magic_comment_encoding} with BOM")
|
| 96 |
+
return 'utf-8'
|
| 97 |
+
elif m:
|
| 98 |
+
return m.group(1).decode('latin-1')
|
| 99 |
+
else:
|
| 100 |
+
return None
|
| 101 |
+
finally:
|
| 102 |
+
fp.seek(pos)
|
| 103 |
+
|
| 104 |
+
|
| 105 |
+
PYTHON_FUTURE_IMPORT_re = re.compile(r'from\s+__future__\s+import\s+\(*(.+)\)*')
|
| 106 |
+
|
| 107 |
+
|
| 108 |
+
def parse_future_flags(fp: IO[bytes], encoding: str = 'latin-1') -> int:
|
| 109 |
+
"""Parse the compiler flags by :mod:`__future__` from the given Python
|
| 110 |
+
code.
|
| 111 |
+
"""
|
| 112 |
+
import __future__
|
| 113 |
+
|
| 114 |
+
pos = fp.tell()
|
| 115 |
+
fp.seek(0)
|
| 116 |
+
flags = 0
|
| 117 |
+
try:
|
| 118 |
+
body = fp.read().decode(encoding)
|
| 119 |
+
|
| 120 |
+
# Fix up the source to be (hopefully) parsable by regexpen.
|
| 121 |
+
# This will likely do untoward things if the source code itself is broken.
|
| 122 |
+
|
| 123 |
+
# (1) Fix `import (\n...` to be `import (...`.
|
| 124 |
+
body = re.sub(r'import\s*\([\r\n]+', 'import (', body)
|
| 125 |
+
# (2) Join line-ending commas with the next line.
|
| 126 |
+
body = re.sub(r',\s*[\r\n]+', ', ', body)
|
| 127 |
+
# (3) Remove backslash line continuations.
|
| 128 |
+
body = re.sub(r'\\\s*[\r\n]+', ' ', body)
|
| 129 |
+
|
| 130 |
+
for m in PYTHON_FUTURE_IMPORT_re.finditer(body):
|
| 131 |
+
names = [x.strip().strip('()') for x in m.group(1).split(',')]
|
| 132 |
+
for name in names:
|
| 133 |
+
feature = getattr(__future__, name, None)
|
| 134 |
+
if feature:
|
| 135 |
+
flags |= feature.compiler_flag
|
| 136 |
+
finally:
|
| 137 |
+
fp.seek(pos)
|
| 138 |
+
return flags
|
| 139 |
+
|
| 140 |
+
|
| 141 |
+
def pathmatch(pattern: str, filename: str) -> bool:
|
| 142 |
+
"""Extended pathname pattern matching.
|
| 143 |
+
|
| 144 |
+
This function is similar to what is provided by the ``fnmatch`` module in
|
| 145 |
+
the Python standard library, but:
|
| 146 |
+
|
| 147 |
+
* can match complete (relative or absolute) path names, and not just file
|
| 148 |
+
names, and
|
| 149 |
+
* also supports a convenience pattern ("**") to match files at any
|
| 150 |
+
directory level.
|
| 151 |
+
|
| 152 |
+
Examples:
|
| 153 |
+
|
| 154 |
+
>>> pathmatch('**.py', 'bar.py')
|
| 155 |
+
True
|
| 156 |
+
>>> pathmatch('**.py', 'foo/bar/baz.py')
|
| 157 |
+
True
|
| 158 |
+
>>> pathmatch('**.py', 'templates/index.html')
|
| 159 |
+
False
|
| 160 |
+
|
| 161 |
+
>>> pathmatch('./foo/**.py', 'foo/bar/baz.py')
|
| 162 |
+
True
|
| 163 |
+
>>> pathmatch('./foo/**.py', 'bar/baz.py')
|
| 164 |
+
False
|
| 165 |
+
|
| 166 |
+
>>> pathmatch('^foo/**.py', 'foo/bar/baz.py')
|
| 167 |
+
True
|
| 168 |
+
>>> pathmatch('^foo/**.py', 'bar/baz.py')
|
| 169 |
+
False
|
| 170 |
+
|
| 171 |
+
>>> pathmatch('**/templates/*.html', 'templates/index.html')
|
| 172 |
+
True
|
| 173 |
+
>>> pathmatch('**/templates/*.html', 'templates/foo/bar.html')
|
| 174 |
+
False
|
| 175 |
+
|
| 176 |
+
:param pattern: the glob pattern
|
| 177 |
+
:param filename: the path name of the file to match against
|
| 178 |
+
"""
|
| 179 |
+
symbols = {
|
| 180 |
+
'?': '[^/]',
|
| 181 |
+
'?/': '[^/]/',
|
| 182 |
+
'*': '[^/]+',
|
| 183 |
+
'*/': '[^/]+/',
|
| 184 |
+
'**/': '(?:.+/)*?',
|
| 185 |
+
'**': '(?:.+/)*?[^/]+',
|
| 186 |
+
}
|
| 187 |
+
|
| 188 |
+
if pattern.startswith('^'):
|
| 189 |
+
buf = ['^']
|
| 190 |
+
pattern = pattern[1:]
|
| 191 |
+
elif pattern.startswith('./'):
|
| 192 |
+
buf = ['^']
|
| 193 |
+
pattern = pattern[2:]
|
| 194 |
+
else:
|
| 195 |
+
buf = []
|
| 196 |
+
|
| 197 |
+
for idx, part in enumerate(re.split('([?*]+/?)', pattern)):
|
| 198 |
+
if idx % 2:
|
| 199 |
+
buf.append(symbols[part])
|
| 200 |
+
elif part:
|
| 201 |
+
buf.append(re.escape(part))
|
| 202 |
+
match = re.match(f"{''.join(buf)}$", filename.replace(os.sep, "/"))
|
| 203 |
+
return match is not None
|
| 204 |
+
|
| 205 |
+
|
| 206 |
+
class TextWrapper(textwrap.TextWrapper):
|
| 207 |
+
wordsep_re = re.compile(
|
| 208 |
+
r'(\s+|' # any whitespace
|
| 209 |
+
r'(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))', # em-dash
|
| 210 |
+
)
|
| 211 |
+
|
| 212 |
+
# e.g. '\u2068foo bar.py\u2069:42'
|
| 213 |
+
_enclosed_filename_re = re.compile(r'(\u2068[^\u2068]+?\u2069(?::-?\d+)?)')
|
| 214 |
+
|
| 215 |
+
def _split(self, text):
|
| 216 |
+
"""Splits the text into indivisible chunks while ensuring that file names
|
| 217 |
+
containing spaces are not broken up.
|
| 218 |
+
"""
|
| 219 |
+
enclosed_filename_start = '\u2068'
|
| 220 |
+
if enclosed_filename_start not in text:
|
| 221 |
+
# There are no file names which contain spaces, fallback to the default implementation
|
| 222 |
+
return super()._split(text)
|
| 223 |
+
|
| 224 |
+
chunks = []
|
| 225 |
+
for chunk in re.split(self._enclosed_filename_re, text):
|
| 226 |
+
if chunk.startswith(enclosed_filename_start):
|
| 227 |
+
chunks.append(chunk)
|
| 228 |
+
else:
|
| 229 |
+
chunks.extend(super()._split(chunk))
|
| 230 |
+
return [c for c in chunks if c]
|
| 231 |
+
|
| 232 |
+
|
| 233 |
+
def wraptext(
|
| 234 |
+
text: str,
|
| 235 |
+
width: int = 70,
|
| 236 |
+
initial_indent: str = '',
|
| 237 |
+
subsequent_indent: str = '',
|
| 238 |
+
) -> list[str]:
|
| 239 |
+
"""Simple wrapper around the ``textwrap.wrap`` function in the standard
|
| 240 |
+
library. This version does not wrap lines on hyphens in words. It also
|
| 241 |
+
does not wrap PO file locations containing spaces.
|
| 242 |
+
|
| 243 |
+
:param text: the text to wrap
|
| 244 |
+
:param width: the maximum line width
|
| 245 |
+
:param initial_indent: string that will be prepended to the first line of
|
| 246 |
+
wrapped output
|
| 247 |
+
:param subsequent_indent: string that will be prepended to all lines save
|
| 248 |
+
the first of wrapped output
|
| 249 |
+
"""
|
| 250 |
+
warnings.warn(
|
| 251 |
+
"`babel.util.wraptext` is deprecated and will be removed in a future version of Babel. "
|
| 252 |
+
"If you need this functionality, use the `babel.util.TextWrapper` class directly.",
|
| 253 |
+
DeprecationWarning,
|
| 254 |
+
stacklevel=2,
|
| 255 |
+
)
|
| 256 |
+
return TextWrapper(
|
| 257 |
+
width=width,
|
| 258 |
+
initial_indent=initial_indent,
|
| 259 |
+
subsequent_indent=subsequent_indent,
|
| 260 |
+
break_long_words=False,
|
| 261 |
+
).wrap(text)
|
| 262 |
+
|
| 263 |
+
|
| 264 |
+
# TODO (Babel 3.x): Remove this re-export
|
| 265 |
+
odict = dict
|
| 266 |
+
|
| 267 |
+
|
| 268 |
+
class FixedOffsetTimezone(datetime.tzinfo):
|
| 269 |
+
"""
|
| 270 |
+
Fixed offset in minutes east from UTC.
|
| 271 |
+
|
| 272 |
+
DEPRECATED: Use the standard library `datetime.timezone` instead.
|
| 273 |
+
"""
|
| 274 |
+
|
| 275 |
+
# TODO (Babel 3.x): Remove this class
|
| 276 |
+
|
| 277 |
+
def __init__(self, offset: float, name: str | None = None) -> None:
|
| 278 |
+
warnings.warn(
|
| 279 |
+
"`FixedOffsetTimezone` is deprecated and will be removed in a future version of Babel. "
|
| 280 |
+
"Use the standard library `datetime.timezone` class.",
|
| 281 |
+
DeprecationWarning,
|
| 282 |
+
stacklevel=2,
|
| 283 |
+
)
|
| 284 |
+
self._offset = datetime.timedelta(minutes=offset)
|
| 285 |
+
if name is None:
|
| 286 |
+
name = 'Etc/GMT%+d' % offset
|
| 287 |
+
self.zone = name
|
| 288 |
+
|
| 289 |
+
def __str__(self) -> str:
|
| 290 |
+
return self.zone
|
| 291 |
+
|
| 292 |
+
def __repr__(self) -> str:
|
| 293 |
+
return f'<FixedOffset "{self.zone}" {self._offset}>'
|
| 294 |
+
|
| 295 |
+
def utcoffset(self, dt: datetime.datetime) -> datetime.timedelta:
|
| 296 |
+
return self._offset
|
| 297 |
+
|
| 298 |
+
def tzname(self, dt: datetime.datetime) -> str:
|
| 299 |
+
return self.zone
|
| 300 |
+
|
| 301 |
+
def dst(self, dt: datetime.datetime) -> datetime.timedelta:
|
| 302 |
+
return ZERO
|
| 303 |
+
|
| 304 |
+
|
| 305 |
+
# Export the localtime functionality here because that's
|
| 306 |
+
# where it was in the past.
|
| 307 |
+
# TODO(3.0): remove these aliases
|
| 308 |
+
UTC = dates.UTC
|
| 309 |
+
LOCALTZ = dates.LOCALTZ
|
| 310 |
+
get_localzone = localtime.get_localzone
|
| 311 |
+
STDOFFSET = localtime.STDOFFSET
|
| 312 |
+
DSTOFFSET = localtime.DSTOFFSET
|
| 313 |
+
DSTDIFF = localtime.DSTDIFF
|
| 314 |
+
ZERO = localtime.ZERO
|
| 315 |
+
|
| 316 |
+
|
| 317 |
+
def _cmp(a: Any, b: Any):
|
| 318 |
+
return (a > b) - (a < b)
|
micromamba_root/Lib/site-packages/backrefs-7.0.dist-info/INSTALLER
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
conda
|
micromamba_root/Lib/site-packages/backrefs-7.0.dist-info/METADATA
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Metadata-Version: 2.4
|
| 2 |
+
Name: backrefs
|
| 3 |
+
Version: 7.0
|
| 4 |
+
Summary: A wrapper around re and regex that adds additional back references.
|
| 5 |
+
Project-URL: Homepage, https://github.com/facelessuser/backrefs
|
| 6 |
+
Author-email: Isaac Muse <Isaac.Muse@gmail.com>
|
| 7 |
+
License-Expression: MIT
|
| 8 |
+
License-File: LICENSE.md
|
| 9 |
+
Keywords: re,regex
|
| 10 |
+
Classifier: Development Status :: 5 - Production/Stable
|
| 11 |
+
Classifier: Environment :: Console
|
| 12 |
+
Classifier: Intended Audience :: Developers
|
| 13 |
+
Classifier: License :: OSI Approved :: MIT License
|
| 14 |
+
Classifier: Operating System :: OS Independent
|
| 15 |
+
Classifier: Programming Language :: Python :: 3
|
| 16 |
+
Classifier: Programming Language :: Python :: 3.10
|
| 17 |
+
Classifier: Programming Language :: Python :: 3.11
|
| 18 |
+
Classifier: Programming Language :: Python :: 3.12
|
| 19 |
+
Classifier: Programming Language :: Python :: 3.13
|
| 20 |
+
Classifier: Programming Language :: Python :: 3.14
|
| 21 |
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
| 22 |
+
Classifier: Typing :: Typed
|
| 23 |
+
Requires-Python: >=3.10
|
| 24 |
+
Provides-Extra: extras
|
| 25 |
+
Requires-Dist: regex; extra == 'extras'
|
| 26 |
+
Description-Content-Type: text/markdown
|
| 27 |
+
|
| 28 |
+
[![Donate via PayPal][donate-image]][donate-link]
|
| 29 |
+
[![Coverage Status][codecov-image]][codecov-link]
|
| 30 |
+
[![PyPI Version][pypi-image]][pypi-link]
|
| 31 |
+
[![PyPI Downloads][pypi-down]][pypi-link]
|
| 32 |
+
[![PyPI - Python Version][python-image]][pypi-link]
|
| 33 |
+
[![License][license-image-mit]][license-link]
|
| 34 |
+
|
| 35 |
+
# Backrefs
|
| 36 |
+
|
| 37 |
+
Backrefs is a wrapper around Python's built-in [Re][re] and the 3rd party [Regex][regex] library. Backrefs adds various
|
| 38 |
+
additional back references (and a couple other features) that are known to some regular expression engines, but not to
|
| 39 |
+
Python's Re and/or Regex. The supported back references actually vary depending on the regular expression engine being
|
| 40 |
+
used as the engine may already have support for some.
|
| 41 |
+
|
| 42 |
+
```python
|
| 43 |
+
>>> from backrefs import bre
|
| 44 |
+
>>> pattern = bre.compile(r'(\p{Letter}+)')
|
| 45 |
+
>>> pattern.sub(r'\C\1\E', 'sometext')
|
| 46 |
+
'SOMETEXT'
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
# Documentation
|
| 50 |
+
|
| 51 |
+
https://facelessuser.github.io/backrefs/
|
| 52 |
+
|
| 53 |
+
# License
|
| 54 |
+
|
| 55 |
+
MIT
|
| 56 |
+
|
| 57 |
+
[codecov-image]: https://img.shields.io/codecov/c/github/facelessuser/backrefs/master.svg?logo=codecov&logoColor=aaaaaa&labelColor=333333
|
| 58 |
+
[codecov-link]: https://codecov.io/github/facelessuser/backrefs
|
| 59 |
+
[pypi-image]: https://img.shields.io/pypi/v/backrefs.svg?logo=pypi&logoColor=aaaaaa&labelColor=333333
|
| 60 |
+
[pypi-down]: https://img.shields.io/pypi/dm/backrefs.svg?logo=pypi&logoColor=aaaaaa&labelColor=333333
|
| 61 |
+
[pypi-link]: https://pypi.python.org/pypi/backrefs
|
| 62 |
+
[python-image]: https://img.shields.io/pypi/pyversions/backrefs?logo=python&logoColor=aaaaaa&labelColor=333333
|
| 63 |
+
[license-image-mit]: https://img.shields.io/badge/license-MIT-blue.svg?labelColor=333333
|
| 64 |
+
[license-link]: https://github.com/facelessuser/backrefs/blob/main/LICENSE.md
|
| 65 |
+
[donate-image]: https://img.shields.io/badge/Donate-PayPal-3fabd1?logo=paypal
|
| 66 |
+
[donate-link]: https://www.paypal.me/facelessuser
|
| 67 |
+
|
| 68 |
+
[re]: https://docs.python.org/3/library/re.html
|
| 69 |
+
[regex]: https://pypi.python.org/pypi/regex
|
micromamba_root/Lib/site-packages/backrefs-7.0.dist-info/RECORD
ADDED
|
@@ -0,0 +1,78 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
backrefs-7.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
|
| 2 |
+
backrefs-7.0.dist-info/METADATA,sha256=kL_4w7oA3i4cWJUxh6aZX6koCAJQP-ca1JsFSTDMMoU,2950
|
| 3 |
+
backrefs-7.0.dist-info/RECORD,,
|
| 4 |
+
backrefs-7.0.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 5 |
+
backrefs-7.0.dist-info/WHEEL,sha256=ojDajBq3ct6non4OtZMDMYPko3aJdmUetNgf7PgkDgk,89
|
| 6 |
+
backrefs-7.0.dist-info/direct_url.json,sha256=_DvuoHK3-1cIOvEvBPWDdca8Uvl9Daecth3HBvyBihE,119
|
| 7 |
+
backrefs-7.0.dist-info/licenses/LICENSE.md,sha256=wRJ7Q2O3NbeJinEnOW_35PqkjljSIcXZ3GFlM_gRolw,1084
|
| 8 |
+
backrefs/__init__.py,sha256=8Qt-anmlWzm-8FEjX1c9xYa47PG8-ccQgWQOAiKA4PM,90
|
| 9 |
+
backrefs/__meta__.py,sha256=dZvWX2DNALnYk-E_ZZ29yTZaRuplYRT_rCDJu-0Qr5w,6766
|
| 10 |
+
backrefs/__pycache__/__init__.cpython-310.pyc,,
|
| 11 |
+
backrefs/__pycache__/__meta__.cpython-310.pyc,,
|
| 12 |
+
backrefs/__pycache__/_bre_parse.cpython-310.pyc,,
|
| 13 |
+
backrefs/__pycache__/_bregex_parse.cpython-310.pyc,,
|
| 14 |
+
backrefs/__pycache__/_bregex_typing.cpython-310.pyc,,
|
| 15 |
+
backrefs/__pycache__/bre.cpython-310.pyc,,
|
| 16 |
+
backrefs/__pycache__/bregex.cpython-310.pyc,,
|
| 17 |
+
backrefs/__pycache__/util.cpython-310.pyc,,
|
| 18 |
+
backrefs/_bre_parse.py,sha256=3-gvvGCMGRrPT5CX9uNTem4hLJUBOsCDGv1lsDoBDgs,53121
|
| 19 |
+
backrefs/_bregex_parse.py,sha256=YCyKr9ZEeydT3w430QfdWkV8axPBFi4ICKCz75-UDwQ,47181
|
| 20 |
+
backrefs/_bregex_typing.py,sha256=THgf80whbUAJrpKWayEMJx8ixrU5oXwmVaQAa8n0DsQ,236
|
| 21 |
+
backrefs/bre.py,sha256=naZaNxLmNUcPgcQTBYR-1rVxfyWPk25cevt0JZu3X0s,19843
|
| 22 |
+
backrefs/bregex.py,sha256=CQ077-rAyjIy6hzL7-Z3rjnpb0VphNduSEc8yjRBalo,20947
|
| 23 |
+
backrefs/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
| 24 |
+
backrefs/uniprops/__init__.py,sha256=6Ylu7wHmppGsp-rzW-D937st2fo7SR10ZXYUvsR5SQs,22720
|
| 25 |
+
backrefs/uniprops/__pycache__/__init__.cpython-310.pyc,,
|
| 26 |
+
backrefs/uniprops/unidata/__init__.py,sha256=4hmJdh2Z89-XVgY0BU9vwHClJQFXmQyWZvUmLmpqOsU,64
|
| 27 |
+
backrefs/uniprops/unidata/__pycache__/__init__.cpython-310.pyc,,
|
| 28 |
+
backrefs/uniprops/unidata/__pycache__/age.cpython-310.pyc,,
|
| 29 |
+
backrefs/uniprops/unidata/__pycache__/alias.cpython-310.pyc,,
|
| 30 |
+
backrefs/uniprops/unidata/__pycache__/bidiclass.cpython-310.pyc,,
|
| 31 |
+
backrefs/uniprops/unidata/__pycache__/bidipairedbrackettype.cpython-310.pyc,,
|
| 32 |
+
backrefs/uniprops/unidata/__pycache__/binary.cpython-310.pyc,,
|
| 33 |
+
backrefs/uniprops/unidata/__pycache__/block.cpython-310.pyc,,
|
| 34 |
+
backrefs/uniprops/unidata/__pycache__/canonicalcombiningclass.cpython-310.pyc,,
|
| 35 |
+
backrefs/uniprops/unidata/__pycache__/decompositiontype.cpython-310.pyc,,
|
| 36 |
+
backrefs/uniprops/unidata/__pycache__/eastasianwidth.cpython-310.pyc,,
|
| 37 |
+
backrefs/uniprops/unidata/__pycache__/generalcategory.cpython-310.pyc,,
|
| 38 |
+
backrefs/uniprops/unidata/__pycache__/graphemeclusterbreak.cpython-310.pyc,,
|
| 39 |
+
backrefs/uniprops/unidata/__pycache__/hangulsyllabletype.cpython-310.pyc,,
|
| 40 |
+
backrefs/uniprops/unidata/__pycache__/indicpositionalcategory.cpython-310.pyc,,
|
| 41 |
+
backrefs/uniprops/unidata/__pycache__/indicsyllabiccategory.cpython-310.pyc,,
|
| 42 |
+
backrefs/uniprops/unidata/__pycache__/joininggroup.cpython-310.pyc,,
|
| 43 |
+
backrefs/uniprops/unidata/__pycache__/joiningtype.cpython-310.pyc,,
|
| 44 |
+
backrefs/uniprops/unidata/__pycache__/linebreak.cpython-310.pyc,,
|
| 45 |
+
backrefs/uniprops/unidata/__pycache__/numerictype.cpython-310.pyc,,
|
| 46 |
+
backrefs/uniprops/unidata/__pycache__/numericvalue.cpython-310.pyc,,
|
| 47 |
+
backrefs/uniprops/unidata/__pycache__/quickcheck.cpython-310.pyc,,
|
| 48 |
+
backrefs/uniprops/unidata/__pycache__/script.cpython-310.pyc,,
|
| 49 |
+
backrefs/uniprops/unidata/__pycache__/scriptextensions.cpython-310.pyc,,
|
| 50 |
+
backrefs/uniprops/unidata/__pycache__/sentencebreak.cpython-310.pyc,,
|
| 51 |
+
backrefs/uniprops/unidata/__pycache__/verticalorientation.cpython-310.pyc,,
|
| 52 |
+
backrefs/uniprops/unidata/__pycache__/wordbreak.cpython-310.pyc,,
|
| 53 |
+
backrefs/uniprops/unidata/age.py,sha256=IQdRIGXjJZOyERlyaw--2N0D1kuCna9AsKoJjpUT2Kw,67580
|
| 54 |
+
backrefs/uniprops/unidata/alias.py,sha256=Kr5epc3yiquCVZIAh9nsHvvFRKVt06Kjt3qtLgEaUxw,22967
|
| 55 |
+
backrefs/uniprops/unidata/bidiclass.py,sha256=IrzoiTOspQnv4bJ1jXTrwoVOVd3OgeeDNAXgPaZyoAU,42795
|
| 56 |
+
backrefs/uniprops/unidata/bidipairedbrackettype.py,sha256=7irbKlDIIQzn5veY4TB5eiZ3vDLlntJLkJ8QMTXyFoI,3090
|
| 57 |
+
backrefs/uniprops/unidata/binary.py,sha256=TymHcEUW2WjtAYxgslYfLxebkHphqfmip6Z8YPx46DA,388118
|
| 58 |
+
backrefs/uniprops/unidata/block.py,sha256=qvGzVYf9vnyVsugtwwD4AY88bCZM6_aBNC-bLYqHnS4,55282
|
| 59 |
+
backrefs/uniprops/unidata/canonicalcombiningclass.py,sha256=dHscCj-oQ079Up_17Fp-X8ZqObDFHKntiUqOYe6vYzw,36976
|
| 60 |
+
backrefs/uniprops/unidata/decompositiontype.py,sha256=uh2xuHQuXP4UB8kbFEAZF31jJrVQkV8KPSmFlftsRZs,26912
|
| 61 |
+
backrefs/uniprops/unidata/eastasianwidth.py,sha256=gW6tz7Oc6-oNFLCtpZD7bqYw-HDmUVtJp73GeSN45oQ,15108
|
| 62 |
+
backrefs/uniprops/unidata/generalcategory.py,sha256=J-VqKl-tA87Gd3fqt3IMuU1heMPVlJ8EgBUAoLBN0sk,130520
|
| 63 |
+
backrefs/uniprops/unidata/graphemeclusterbreak.py,sha256=nbGc8iE4rWXeztuG8GhqaYWqnaN6fv2iPgK9qHJi9QM,40875
|
| 64 |
+
backrefs/uniprops/unidata/hangulsyllabletype.py,sha256=EgjfnsOz1ARQE_oBfiTFPY7HUw0ctGQYo0XjbiT2WK0,16173
|
| 65 |
+
backrefs/uniprops/unidata/indicpositionalcategory.py,sha256=lKUMImOsbinJKe5luY6eoLY2IugOQapLFpftQsY5tZg,23630
|
| 66 |
+
backrefs/uniprops/unidata/indicsyllabiccategory.py,sha256=GfvRadQ9LNLG4aHTUbqy9z2A8MGy_hiXMHFRrW1xBoc,34031
|
| 67 |
+
backrefs/uniprops/unidata/joininggroup.py,sha256=JjrGIgsE4RdHi-dgveof4WW1XIUOwChAb4pijACf7bE,17426
|
| 68 |
+
backrefs/uniprops/unidata/joiningtype.py,sha256=L7Aq6ck6CVewxA39rrw-Sxa_nDBrrM7IqJ-KZ5IkuDk,23444
|
| 69 |
+
backrefs/uniprops/unidata/linebreak.py,sha256=SuhXXI-Qv1Rxu9oc2n7tcByU0OYb_P4KzahOMj7VPgE,88850
|
| 70 |
+
backrefs/uniprops/unidata/numerictype.py,sha256=iMl6ALFpJXjETx6iLrIZ9_B-CTCYQ0wCz8JpbVsenuw,13259
|
| 71 |
+
backrefs/uniprops/unidata/numericvalue.py,sha256=hE-PwRf3-sawlgDYF5F1wOSuYohOgLBTJg_mwgHeWSQ,66531
|
| 72 |
+
backrefs/uniprops/unidata/quickcheck.py,sha256=m6mMe0kCeR5ZiWCsPkPQYCWomlRLsd3KuEm8MXL7diU,47014
|
| 73 |
+
backrefs/uniprops/unidata/script.py,sha256=1s7iAsALdA6IeRco9hFtf4KDy0yXl7NJR8sfdImyeUw,64788
|
| 74 |
+
backrefs/uniprops/unidata/scriptextensions.py,sha256=ZEj1jiVT6kw-AsYtReeu0DlvGlUSi03IMUyjMv29zeQ,69629
|
| 75 |
+
backrefs/uniprops/unidata/sentencebreak.py,sha256=V_1mPfXllfLJO-9fImlty6a5Z8E8o0qBHiojxyTjEAo,73389
|
| 76 |
+
backrefs/uniprops/unidata/verticalorientation.py,sha256=lltUNd4YEBf68XqluOb1XGvbszO2DBQkhWUsj1y1Da8,6776
|
| 77 |
+
backrefs/uniprops/unidata/wordbreak.py,sha256=LUftxtrRfNsS3NbLRDwrqUmkTbj3KcBKBpWiCSAkQRw,51319
|
| 78 |
+
backrefs/util.py,sha256=2qnLiUsB06IKKIdrjWIxYqwUG7OFqtOhafgx23ZwBn8,4285
|
micromamba_root/Lib/site-packages/backrefs-7.0.dist-info/REQUESTED
ADDED
|
File without changes
|
micromamba_root/Lib/site-packages/backrefs-7.0.dist-info/WHEEL
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Wheel-Version: 1.0
|
| 2 |
+
Generator: hatchling 1.29.0
|
| 3 |
+
Root-Is-Purelib: true
|
| 4 |
+
Tag: py310-none-any
|
micromamba_root/Lib/site-packages/backrefs-7.0.dist-info/direct_url.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"dir_info": {}, "url": "file:///home/conda/feedstock_root/build_artifacts/bld/rattler-build_backrefs_1777493261/work"}
|
micromamba_root/Lib/site-packages/backrefs/__init__.py
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Backrefs package."""
|
| 2 |
+
from .__meta__ import __version__, __version_info__ # noqa: F401
|
micromamba_root/Lib/site-packages/backrefs/__meta__.py
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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d+))?
|
| 9 |
+
(?:(?P<type>a|b|rc)(?P<pre>\d+))?
|
| 10 |
+
(?:\.post(?P<post>\d+))?
|
| 11 |
+
(?:\.dev(?P<dev>\d+))?
|
| 12 |
+
'''
|
| 13 |
+
)
|
| 14 |
+
|
| 15 |
+
REL_MAP = {
|
| 16 |
+
".dev": "",
|
| 17 |
+
".dev-alpha": "a",
|
| 18 |
+
".dev-beta": "b",
|
| 19 |
+
".dev-candidate": "rc",
|
| 20 |
+
"alpha": "a",
|
| 21 |
+
"beta": "b",
|
| 22 |
+
"candidate": "rc",
|
| 23 |
+
"final": ""
|
| 24 |
+
}
|
| 25 |
+
|
| 26 |
+
DEV_STATUS = {
|
| 27 |
+
".dev": "2 - Pre-Alpha",
|
| 28 |
+
".dev-alpha": "2 - Pre-Alpha",
|
| 29 |
+
".dev-beta": "2 - Pre-Alpha",
|
| 30 |
+
".dev-candidate": "2 - Pre-Alpha",
|
| 31 |
+
"alpha": "3 - Alpha",
|
| 32 |
+
"beta": "4 - Beta",
|
| 33 |
+
"candidate": "4 - Beta",
|
| 34 |
+
"final": "5 - Production/Stable"
|
| 35 |
+
}
|
| 36 |
+
|
| 37 |
+
PRE_REL_MAP = {"a": 'alpha', "b": 'beta', "rc": 'candidate'}
|
| 38 |
+
|
| 39 |
+
|
| 40 |
+
class Version(namedtuple("Version", ["major", "minor", "micro", "release", "pre", "post", "dev"])):
|
| 41 |
+
"""
|
| 42 |
+
Get the version (PEP 440).
|
| 43 |
+
|
| 44 |
+
A biased approach to the PEP 440 semantic version.
|
| 45 |
+
|
| 46 |
+
Provides a tuple structure which is sorted for comparisons `v1 > v2` etc.
|
| 47 |
+
(major, minor, micro, release type, pre-release build, post-release build, development release build)
|
| 48 |
+
Release types are named in is such a way they are comparable with ease.
|
| 49 |
+
Accessors to check if a development, pre-release, or post-release build. Also provides accessor to get
|
| 50 |
+
development status for setup files.
|
| 51 |
+
|
| 52 |
+
How it works (currently):
|
| 53 |
+
|
| 54 |
+
- You must specify a release type as either `final`, `alpha`, `beta`, or `candidate`.
|
| 55 |
+
- To define a development release, you can use either `.dev`, `.dev-alpha`, `.dev-beta`, or `.dev-candidate`.
|
| 56 |
+
The dot is used to ensure all development specifiers are sorted before `alpha`.
|
| 57 |
+
You can specify a `dev` number for development builds, but do not have to as implicit development releases
|
| 58 |
+
are allowed.
|
| 59 |
+
- You must specify a `pre` value greater than zero if using a prerelease as this project (not PEP 440) does not
|
| 60 |
+
allow implicit prereleases.
|
| 61 |
+
- You can optionally set `post` to a value greater than zero to make the build a post release. While post releases
|
| 62 |
+
are technically allowed in prereleases, it is strongly discouraged, so we are rejecting them. It should be
|
| 63 |
+
noted that we do not allow `post0` even though PEP 440 does not restrict this. This project specifically
|
| 64 |
+
does not allow implicit post releases.
|
| 65 |
+
- It should be noted that we do not support epochs `1!` or local versions `+some-custom.version-1`.
|
| 66 |
+
|
| 67 |
+
Acceptable version releases:
|
| 68 |
+
|
| 69 |
+
```
|
| 70 |
+
Version(1, 0, 0, "final") 1.0
|
| 71 |
+
Version(1, 2, 0, "final") 1.2
|
| 72 |
+
Version(1, 2, 3, "final") 1.2.3
|
| 73 |
+
Version(1, 2, 0, ".dev-alpha", pre=4) 1.2a4
|
| 74 |
+
Version(1, 2, 0, ".dev-beta", pre=4) 1.2b4
|
| 75 |
+
Version(1, 2, 0, ".dev-candidate", pre=4) 1.2rc4
|
| 76 |
+
Version(1, 2, 0, "final", post=1) 1.2.post1
|
| 77 |
+
Version(1, 2, 3, ".dev") 1.2.3.dev0
|
| 78 |
+
Version(1, 2, 3, ".dev", dev=1) 1.2.3.dev1
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
"""
|
| 82 |
+
|
| 83 |
+
def __new__(
|
| 84 |
+
cls,
|
| 85 |
+
major: int, minor: int, micro: int, release: str = "final",
|
| 86 |
+
pre: int = 0, post: int = 0, dev: int = 0
|
| 87 |
+
) -> Version:
|
| 88 |
+
"""Validate version info."""
|
| 89 |
+
|
| 90 |
+
# Ensure all parts are positive integers.
|
| 91 |
+
for value in (major, minor, micro, pre, post):
|
| 92 |
+
if not (isinstance(value, int) and value >= 0):
|
| 93 |
+
raise ValueError("All version parts except 'release' should be integers.")
|
| 94 |
+
|
| 95 |
+
if release not in REL_MAP:
|
| 96 |
+
raise ValueError(f"'{release}' is not a valid release type.")
|
| 97 |
+
|
| 98 |
+
# Ensure valid pre-release (we do not allow implicit pre-releases).
|
| 99 |
+
if ".dev-candidate" < release < "final":
|
| 100 |
+
if pre == 0:
|
| 101 |
+
raise ValueError("Implicit pre-releases not allowed.")
|
| 102 |
+
elif dev:
|
| 103 |
+
raise ValueError("Version is not a development release.")
|
| 104 |
+
elif post:
|
| 105 |
+
raise ValueError("Post-releases are not allowed with pre-releases.")
|
| 106 |
+
|
| 107 |
+
# Ensure valid development or development/pre release
|
| 108 |
+
elif release < "alpha":
|
| 109 |
+
if release > ".dev" and pre == 0:
|
| 110 |
+
raise ValueError("Implicit pre-release not allowed.")
|
| 111 |
+
elif post:
|
| 112 |
+
raise ValueError("Post-releases are not allowed with pre-releases.")
|
| 113 |
+
|
| 114 |
+
# Ensure a valid normal release
|
| 115 |
+
else:
|
| 116 |
+
if pre:
|
| 117 |
+
raise ValueError("Version is not a pre-release.")
|
| 118 |
+
elif dev:
|
| 119 |
+
raise ValueError("Version is not a development release.")
|
| 120 |
+
|
| 121 |
+
return super().__new__(cls, major, minor, micro, release, pre, post, dev)
|
| 122 |
+
|
| 123 |
+
def _is_pre(self) -> bool:
|
| 124 |
+
"""Is prerelease."""
|
| 125 |
+
|
| 126 |
+
return bool(self.pre > 0)
|
| 127 |
+
|
| 128 |
+
def _is_dev(self) -> bool:
|
| 129 |
+
"""Is development."""
|
| 130 |
+
|
| 131 |
+
return bool(self.release < "alpha")
|
| 132 |
+
|
| 133 |
+
def _is_post(self) -> bool:
|
| 134 |
+
"""Is post."""
|
| 135 |
+
|
| 136 |
+
return bool(self.post > 0)
|
| 137 |
+
|
| 138 |
+
def _get_dev_status(self) -> str: # pragma: no cover
|
| 139 |
+
"""Get development status string."""
|
| 140 |
+
|
| 141 |
+
return DEV_STATUS[self.release]
|
| 142 |
+
|
| 143 |
+
def _get_canonical(self) -> str:
|
| 144 |
+
"""Get the canonical output string."""
|
| 145 |
+
|
| 146 |
+
# Assemble major, minor, micro version and append `pre`, `post`, or `dev` if needed..
|
| 147 |
+
if self.micro == 0:
|
| 148 |
+
ver = f"{self.major}.{self.minor}"
|
| 149 |
+
else:
|
| 150 |
+
ver = f"{self.major}.{self.minor}.{self.micro}"
|
| 151 |
+
if self._is_pre():
|
| 152 |
+
ver += f'{REL_MAP[self.release]}{self.pre}'
|
| 153 |
+
if self._is_post():
|
| 154 |
+
ver += f".post{self.post}"
|
| 155 |
+
if self._is_dev():
|
| 156 |
+
ver += f".dev{self.dev}"
|
| 157 |
+
|
| 158 |
+
return ver
|
| 159 |
+
|
| 160 |
+
|
| 161 |
+
def parse_version(ver: str) -> Version:
|
| 162 |
+
"""Parse version into a comparable Version tuple."""
|
| 163 |
+
|
| 164 |
+
m = RE_VER.match(ver)
|
| 165 |
+
|
| 166 |
+
if m is None:
|
| 167 |
+
raise ValueError(f"'{ver}' is not a valid version")
|
| 168 |
+
|
| 169 |
+
# Handle major, minor, micro
|
| 170 |
+
major = int(m.group('major'))
|
| 171 |
+
minor = int(m.group('minor')) if m.group('minor') else 0
|
| 172 |
+
micro = int(m.group('micro')) if m.group('micro') else 0
|
| 173 |
+
|
| 174 |
+
# Handle pre releases
|
| 175 |
+
if m.group('type'):
|
| 176 |
+
release = PRE_REL_MAP[m.group('type')]
|
| 177 |
+
pre = int(m.group('pre'))
|
| 178 |
+
else:
|
| 179 |
+
release = "final"
|
| 180 |
+
pre = 0
|
| 181 |
+
|
| 182 |
+
# Handle development releases
|
| 183 |
+
dev = m.group('dev') if m.group('dev') else 0
|
| 184 |
+
if m.group('dev'):
|
| 185 |
+
dev = int(m.group('dev'))
|
| 186 |
+
release = '.dev-' + release if pre else '.dev'
|
| 187 |
+
else:
|
| 188 |
+
dev = 0
|
| 189 |
+
|
| 190 |
+
# Handle post
|
| 191 |
+
post = int(m.group('post')) if m.group('post') else 0
|
| 192 |
+
|
| 193 |
+
return Version(major, minor, micro, release, pre, post, dev)
|
| 194 |
+
|
| 195 |
+
|
| 196 |
+
__version_info__ = Version(7, 0, 0, "final")
|
| 197 |
+
__version__ = __version_info__._get_canonical()
|
micromamba_root/Lib/site-packages/backrefs/_bre_parse.py
ADDED
|
@@ -0,0 +1,1547 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""
|
| 2 |
+
Backrefs Re parser.
|
| 3 |
+
|
| 4 |
+
Licensed under MIT
|
| 5 |
+
Copyright (c) 2011 - 2020 Isaac Muse <isaacmuse@gmail.com>
|
| 6 |
+
"""
|
| 7 |
+
from __future__ import annotations
|
| 8 |
+
import re as _re
|
| 9 |
+
import sys
|
| 10 |
+
import copyreg as _copyreg
|
| 11 |
+
from . import util as _util
|
| 12 |
+
import unicodedata as _unicodedata
|
| 13 |
+
from . import uniprops as _uniprops
|
| 14 |
+
from typing import Generic, AnyStr, Match, Any, Pattern, cast
|
| 15 |
+
|
| 16 |
+
if sys.version_info >= (3, 11):
|
| 17 |
+
import re._parser as _parser # type: ignore[import]
|
| 18 |
+
else:
|
| 19 |
+
import sre_parse as _parser
|
| 20 |
+
|
| 21 |
+
__all__ = ("ReplaceTemplate",)
|
| 22 |
+
|
| 23 |
+
_ASCII_LETTERS = frozenset(
|
| 24 |
+
(
|
| 25 |
+
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm',
|
| 26 |
+
'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z',
|
| 27 |
+
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',
|
| 28 |
+
'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
|
| 29 |
+
)
|
| 30 |
+
)
|
| 31 |
+
_DIGIT = frozenset(('0', '1', '2', '3', '4', '5', '6', '7', '8', '9'))
|
| 32 |
+
_OCTAL = frozenset(('0', '1', '2', '3', '4', '5', '6', '7'))
|
| 33 |
+
_HEX = frozenset(('a', 'b', 'c', 'd', 'e', 'f', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9'))
|
| 34 |
+
_LETTERS_UNDERSCORE = _ASCII_LETTERS | frozenset(('_',))
|
| 35 |
+
_WORD = _LETTERS_UNDERSCORE | _DIGIT
|
| 36 |
+
_STANDARD_ESCAPES = frozenset(('a', 'b', 'f', 'n', 'r', 't', 'v'))
|
| 37 |
+
_CURLY_BRACKETS = frozenset(('{', '}'))
|
| 38 |
+
_PROPERTY_STRIP = frozenset((' ', '-', '_'))
|
| 39 |
+
_PROPERTY = _WORD | _DIGIT | _PROPERTY_STRIP
|
| 40 |
+
_GLOBAL_FLAGS = frozenset(('a', 'i', 'L', 'm', 's', 'u', 'x'))
|
| 41 |
+
_SCOPED_FLAGS = frozenset(('i', 'm', 's', 'x'))
|
| 42 |
+
_SCOPED_END = frozenset((':', ')'))
|
| 43 |
+
|
| 44 |
+
_CURLY_BRACKETS_ORD = frozenset((0x7b, 0x7d))
|
| 45 |
+
|
| 46 |
+
_COMPATIBILITY_PROPERTIES = frozenset(
|
| 47 |
+
(
|
| 48 |
+
'alpha', 'lower', 'upper', 'punct', 'digit', 'xdigit', 'alnum',
|
| 49 |
+
'space', 'blank', 'cntrl', 'graph', 'print', 'word'
|
| 50 |
+
)
|
| 51 |
+
)
|
| 52 |
+
|
| 53 |
+
# Case upper or lower
|
| 54 |
+
_UPPER = 1
|
| 55 |
+
_LOWER = 2
|
| 56 |
+
|
| 57 |
+
# Format Constants
|
| 58 |
+
_BACK_SLASH_TRANSLATION = {
|
| 59 |
+
"\\a": '\a',
|
| 60 |
+
"\\b": '\b',
|
| 61 |
+
"\\f": '\f',
|
| 62 |
+
"\\r": '\r',
|
| 63 |
+
"\\t": '\t',
|
| 64 |
+
"\\n": '\n',
|
| 65 |
+
"\\v": '\v',
|
| 66 |
+
"\\\\": '\\'
|
| 67 |
+
}
|
| 68 |
+
|
| 69 |
+
_FMT_CONV_TYPE = ('a', 'r', 's')
|
| 70 |
+
|
| 71 |
+
|
| 72 |
+
class LoopException(Exception):
|
| 73 |
+
"""Loop exception."""
|
| 74 |
+
|
| 75 |
+
|
| 76 |
+
class GlobalRetryException(Exception):
|
| 77 |
+
"""Global retry exception."""
|
| 78 |
+
|
| 79 |
+
|
| 80 |
+
class _SearchParser(Generic[AnyStr]):
|
| 81 |
+
"""Search Template."""
|
| 82 |
+
|
| 83 |
+
_new_refs = ("c", "C", "e", "E", "h", "l", "L", "m", "M", "N", "p", "P", "Q", "R", "X")
|
| 84 |
+
_re_start_wb = r"\b(?=\w)"
|
| 85 |
+
_re_end_wb = r"\b(?<=\w)"
|
| 86 |
+
_line_break = r'(?:\r\n|(?!\r\n)[\n\v\f\r\x85\u2028\u2029])'
|
| 87 |
+
_bytes_line_break = r'(?>\r\n|[\n\v\f\r\x85])' if _util.PY311 else r'(?:\r\n|(?!\r\n)[\n\v\f\r\x85])'
|
| 88 |
+
_grapheme_cluster = r'(?:{}{}*(?!{}))'
|
| 89 |
+
|
| 90 |
+
verbose: bool
|
| 91 |
+
unicode: bool
|
| 92 |
+
global_flag_swap: dict[str, bool]
|
| 93 |
+
temp_global_flag_swap: dict[str, bool]
|
| 94 |
+
ascii: bool # noqa: A003
|
| 95 |
+
is_bytes: bool
|
| 96 |
+
search: AnyStr
|
| 97 |
+
|
| 98 |
+
def __init__(self, search: AnyStr, re_verbose: bool = False, re_unicode: bool | None = None) -> None:
|
| 99 |
+
"""Initialize."""
|
| 100 |
+
|
| 101 |
+
if isinstance(search, bytes):
|
| 102 |
+
self.is_bytes = True
|
| 103 |
+
else:
|
| 104 |
+
self.is_bytes = False
|
| 105 |
+
|
| 106 |
+
if self.is_bytes:
|
| 107 |
+
self._re_line_break = self._bytes_line_break
|
| 108 |
+
else:
|
| 109 |
+
self._re_line_break = self._line_break
|
| 110 |
+
self.search = search
|
| 111 |
+
self.re_verbose = re_verbose
|
| 112 |
+
self.re_unicode = re_unicode
|
| 113 |
+
|
| 114 |
+
def process_quotes(self, text: str) -> str:
|
| 115 |
+
"""Process quotes."""
|
| 116 |
+
|
| 117 |
+
escaped = False
|
| 118 |
+
in_quotes = False
|
| 119 |
+
current = []
|
| 120 |
+
quoted = [] # type: list[str]
|
| 121 |
+
i = _util.StringIter(text)
|
| 122 |
+
|
| 123 |
+
for t in i:
|
| 124 |
+
if not escaped and t == "\\":
|
| 125 |
+
escaped = True
|
| 126 |
+
elif escaped:
|
| 127 |
+
escaped = False
|
| 128 |
+
if t == "E":
|
| 129 |
+
if in_quotes:
|
| 130 |
+
current.append(_re.escape("".join(quoted)))
|
| 131 |
+
quoted = []
|
| 132 |
+
in_quotes = False
|
| 133 |
+
elif t == "Q" and not in_quotes:
|
| 134 |
+
in_quotes = True
|
| 135 |
+
elif in_quotes:
|
| 136 |
+
quoted.extend(["\\", t])
|
| 137 |
+
else:
|
| 138 |
+
current.extend(["\\", t])
|
| 139 |
+
elif in_quotes:
|
| 140 |
+
quoted.extend(t)
|
| 141 |
+
else:
|
| 142 |
+
current.append(t)
|
| 143 |
+
|
| 144 |
+
if in_quotes and escaped:
|
| 145 |
+
quoted.append("\\")
|
| 146 |
+
elif escaped:
|
| 147 |
+
current.append("\\")
|
| 148 |
+
|
| 149 |
+
if quoted:
|
| 150 |
+
current.append(_re.escape("".join(quoted)))
|
| 151 |
+
|
| 152 |
+
return "".join(current)
|
| 153 |
+
|
| 154 |
+
def verbose_comment(self, t: str, i: _util.StringIter) -> list[str]:
|
| 155 |
+
"""Handle verbose comments."""
|
| 156 |
+
|
| 157 |
+
current = []
|
| 158 |
+
escaped = False
|
| 159 |
+
|
| 160 |
+
try:
|
| 161 |
+
while t != "\n":
|
| 162 |
+
if not escaped and t == "\\":
|
| 163 |
+
escaped = True
|
| 164 |
+
current.append(t)
|
| 165 |
+
elif escaped:
|
| 166 |
+
escaped = False
|
| 167 |
+
if t in self._new_refs:
|
| 168 |
+
current.append("\\")
|
| 169 |
+
current.append(t)
|
| 170 |
+
else:
|
| 171 |
+
current.append(t)
|
| 172 |
+
t = next(i)
|
| 173 |
+
except StopIteration:
|
| 174 |
+
pass
|
| 175 |
+
|
| 176 |
+
if t == "\n":
|
| 177 |
+
current.append(t)
|
| 178 |
+
return current
|
| 179 |
+
|
| 180 |
+
def flags(self, text: str, scoped: bool = False) -> None:
|
| 181 |
+
"""Analyze flags."""
|
| 182 |
+
|
| 183 |
+
flags = text.split('-')
|
| 184 |
+
enable = flags[0]
|
| 185 |
+
disable = flags[1] if len(flags) > 1 else ''
|
| 186 |
+
|
| 187 |
+
global_retry = False
|
| 188 |
+
if ('a' in enable or 'L' in enable) and self.unicode:
|
| 189 |
+
self.unicode = False
|
| 190 |
+
if not scoped:
|
| 191 |
+
self.temp_global_flag_swap["unicode"] = True
|
| 192 |
+
global_retry = True
|
| 193 |
+
elif 'u' in enable and not self.unicode and not self.is_bytes:
|
| 194 |
+
self.unicode = True
|
| 195 |
+
if not scoped:
|
| 196 |
+
self.temp_global_flag_swap["unicode"] = True
|
| 197 |
+
global_retry = True
|
| 198 |
+
if 'x' in disable and self.verbose:
|
| 199 |
+
self.verbose = False
|
| 200 |
+
elif 'x' in enable and not self.verbose:
|
| 201 |
+
self.verbose = True
|
| 202 |
+
if not scoped:
|
| 203 |
+
self.temp_global_flag_swap["verbose"] = True
|
| 204 |
+
global_retry = True
|
| 205 |
+
if global_retry:
|
| 206 |
+
raise GlobalRetryException('Global Retry')
|
| 207 |
+
|
| 208 |
+
def get_unicode_property(self, i: _util.StringIter, brackets: bool = False) -> tuple[str, str]:
|
| 209 |
+
"""Get Unicode property."""
|
| 210 |
+
|
| 211 |
+
index = i.index
|
| 212 |
+
prop = []
|
| 213 |
+
value = []
|
| 214 |
+
try:
|
| 215 |
+
c = next(i)
|
| 216 |
+
if c.upper() in _ASCII_LETTERS:
|
| 217 |
+
prop.append(c)
|
| 218 |
+
elif (not brackets and c != '{') or (brackets and c != ':'):
|
| 219 |
+
raise SyntaxError(f"Unicode property missing '{{' at {i.index - 1}!")
|
| 220 |
+
else:
|
| 221 |
+
c = next(i)
|
| 222 |
+
if c == '^':
|
| 223 |
+
prop.append(c)
|
| 224 |
+
c = next(i)
|
| 225 |
+
|
| 226 |
+
while c not in (':', '=', '}'):
|
| 227 |
+
if c not in _PROPERTY:
|
| 228 |
+
raise SyntaxError(f'Invalid Unicode property character at {i.index - 1}!')
|
| 229 |
+
if c not in _PROPERTY_STRIP:
|
| 230 |
+
prop.append(c)
|
| 231 |
+
c = next(i)
|
| 232 |
+
|
| 233 |
+
if c in (':', '='):
|
| 234 |
+
skip = False
|
| 235 |
+
if brackets:
|
| 236 |
+
is_colon = c == ':'
|
| 237 |
+
c = next(i)
|
| 238 |
+
if is_colon and c == ']':
|
| 239 |
+
# That's the end of the property
|
| 240 |
+
skip = True
|
| 241 |
+
end = ':'
|
| 242 |
+
else:
|
| 243 |
+
c = next(i)
|
| 244 |
+
end = '}'
|
| 245 |
+
|
| 246 |
+
# Get the property value
|
| 247 |
+
if not skip:
|
| 248 |
+
while c != end:
|
| 249 |
+
if c not in _PROPERTY:
|
| 250 |
+
raise SyntaxError(f'Invalid Unicode property character at {i.index - 1}!')
|
| 251 |
+
if c not in _PROPERTY_STRIP:
|
| 252 |
+
value.append(c)
|
| 253 |
+
c = next(i)
|
| 254 |
+
if brackets and c == ':':
|
| 255 |
+
c = next(i)
|
| 256 |
+
if c != ']':
|
| 257 |
+
raise SyntaxError(f'Invalid Unicode property character at {i.index - 1}!')
|
| 258 |
+
if not value:
|
| 259 |
+
raise SyntaxError('Invalid Unicode property!')
|
| 260 |
+
|
| 261 |
+
except StopIteration as e:
|
| 262 |
+
if brackets:
|
| 263 |
+
raise SyntaxError(f"Missing or unmatched ':]' at {index}!") from e
|
| 264 |
+
else:
|
| 265 |
+
raise SyntaxError(f"Missing or unmatched '{{' at {index}!") from e
|
| 266 |
+
|
| 267 |
+
p = ''.join(prop).lower()
|
| 268 |
+
v = ''.join(value).lower()
|
| 269 |
+
|
| 270 |
+
# Ensure when using POSIX form, that any property considered a compatibility property uses the POSIX form.
|
| 271 |
+
# POSIX form is not guaranteed to be different from standard form and sometimes is just an alias for standard.
|
| 272 |
+
if brackets and p in _COMPATIBILITY_PROPERTIES:
|
| 273 |
+
p = 'posix' + p
|
| 274 |
+
|
| 275 |
+
return p, v
|
| 276 |
+
|
| 277 |
+
def get_named_unicode(self, i: _util.StringIter) -> str:
|
| 278 |
+
"""Get Unicode name."""
|
| 279 |
+
|
| 280 |
+
index = i.index
|
| 281 |
+
value = []
|
| 282 |
+
try:
|
| 283 |
+
if next(i) != '{':
|
| 284 |
+
raise ValueError(f"Named Unicode missing '{{' {i.index - 1}!")
|
| 285 |
+
c = next(i)
|
| 286 |
+
while c != '}':
|
| 287 |
+
value.append(c)
|
| 288 |
+
c = next(i)
|
| 289 |
+
except Exception as e:
|
| 290 |
+
raise SyntaxError(f"Unmatched '{{' at {index}!") from e
|
| 291 |
+
|
| 292 |
+
return ''.join(value)
|
| 293 |
+
|
| 294 |
+
def reference(self, t: str, i: _util.StringIter, in_group: bool = False) -> list[str]:
|
| 295 |
+
"""Handle references."""
|
| 296 |
+
|
| 297 |
+
current = []
|
| 298 |
+
|
| 299 |
+
if not in_group and t == "m":
|
| 300 |
+
current.append(self._re_start_wb)
|
| 301 |
+
elif not in_group and t == "M":
|
| 302 |
+
current.append(self._re_end_wb)
|
| 303 |
+
elif not in_group and t == "R":
|
| 304 |
+
current.append(self._re_line_break)
|
| 305 |
+
elif not in_group and t == "X":
|
| 306 |
+
no_mark = self.unicode_props("^m", None, in_group=False)[0]
|
| 307 |
+
mark = self.unicode_props("m", None, in_group=False)[0]
|
| 308 |
+
current.extend(self._grapheme_cluster.format(no_mark, mark, mark))
|
| 309 |
+
elif t == 'p':
|
| 310 |
+
prop = self.get_unicode_property(i)
|
| 311 |
+
current.extend(self.unicode_props(prop[0], prop[1], in_group=in_group))
|
| 312 |
+
if in_group:
|
| 313 |
+
self.found_property = True
|
| 314 |
+
elif t == 'P':
|
| 315 |
+
prop = self.get_unicode_property(i)
|
| 316 |
+
current.extend(self.unicode_props(prop[0], prop[1], in_group=in_group, negate=True))
|
| 317 |
+
if in_group:
|
| 318 |
+
self.found_property = True
|
| 319 |
+
elif t == "N":
|
| 320 |
+
text = self.get_named_unicode(i)
|
| 321 |
+
current.extend(self.unicode_name(text, in_group))
|
| 322 |
+
if in_group:
|
| 323 |
+
self.found_named_unicode = True
|
| 324 |
+
else:
|
| 325 |
+
current.extend(["\\", t])
|
| 326 |
+
return current
|
| 327 |
+
|
| 328 |
+
def get_comments(self, i: _util.StringIter) -> str | None:
|
| 329 |
+
"""Get comments."""
|
| 330 |
+
|
| 331 |
+
index = i.index
|
| 332 |
+
value = ['(']
|
| 333 |
+
escaped = False
|
| 334 |
+
try:
|
| 335 |
+
c = next(i)
|
| 336 |
+
if c != '?':
|
| 337 |
+
i.rewind(1)
|
| 338 |
+
return None
|
| 339 |
+
value.append(c)
|
| 340 |
+
c = next(i)
|
| 341 |
+
if c != '#':
|
| 342 |
+
i.rewind(2)
|
| 343 |
+
return None
|
| 344 |
+
value.append(c)
|
| 345 |
+
c = next(i)
|
| 346 |
+
while c != ')' or escaped is True:
|
| 347 |
+
if escaped:
|
| 348 |
+
escaped = False
|
| 349 |
+
elif c == '\\':
|
| 350 |
+
escaped = True
|
| 351 |
+
value.append(c)
|
| 352 |
+
c = next(i)
|
| 353 |
+
value.append(c)
|
| 354 |
+
except StopIteration as e:
|
| 355 |
+
raise SyntaxError(f"Unmatched '(' at {index - 1}!") from e
|
| 356 |
+
|
| 357 |
+
return ''.join(value)
|
| 358 |
+
|
| 359 |
+
def get_flags(self, i: _util.StringIter) -> tuple[str | None, bool]:
|
| 360 |
+
"""
|
| 361 |
+
Get flags.
|
| 362 |
+
|
| 363 |
+
In Re, flags are quite predictable when global or scoped.
|
| 364 |
+
Global can never be disabled with minus, and never have a `:` after them.
|
| 365 |
+
The global flag set is also very specific, but can be used as enablers in scoped.
|
| 366 |
+
|
| 367 |
+
The returned scoped status will indicate whether flags are generally considered
|
| 368 |
+
scoped flags or global flags.
|
| 369 |
+
"""
|
| 370 |
+
|
| 371 |
+
index = i.index
|
| 372 |
+
value = ['(']
|
| 373 |
+
toggle = False
|
| 374 |
+
smells_scoped = False
|
| 375 |
+
try:
|
| 376 |
+
c = next(i)
|
| 377 |
+
if c != '?':
|
| 378 |
+
i.rewind(1)
|
| 379 |
+
return None, False
|
| 380 |
+
value.append(c)
|
| 381 |
+
c = next(i)
|
| 382 |
+
while c not in _SCOPED_END:
|
| 383 |
+
if toggle:
|
| 384 |
+
if c not in _SCOPED_FLAGS:
|
| 385 |
+
raise ValueError('Bad scope')
|
| 386 |
+
elif c == '-':
|
| 387 |
+
smells_scoped = True
|
| 388 |
+
toggle = True
|
| 389 |
+
elif c not in _GLOBAL_FLAGS:
|
| 390 |
+
raise ValueError("Bad flag")
|
| 391 |
+
value.append(c)
|
| 392 |
+
c = next(i)
|
| 393 |
+
if smells_scoped and c != ':':
|
| 394 |
+
raise ValueError("Bad flag")
|
| 395 |
+
elif c == ':':
|
| 396 |
+
smells_scoped = True
|
| 397 |
+
value.append(c)
|
| 398 |
+
except Exception:
|
| 399 |
+
i.rewind(i.index - index)
|
| 400 |
+
value = []
|
| 401 |
+
|
| 402 |
+
return ''.join(value) if value else None, smells_scoped
|
| 403 |
+
|
| 404 |
+
def subgroup(self, t: str, i: _util.StringIter) -> list[str]:
|
| 405 |
+
"""Handle parenthesis."""
|
| 406 |
+
|
| 407 |
+
current = [] # type: list[str]
|
| 408 |
+
|
| 409 |
+
# (?#comment)
|
| 410 |
+
comments = self.get_comments(i)
|
| 411 |
+
if comments:
|
| 412 |
+
return [comments]
|
| 413 |
+
|
| 414 |
+
verbose = self.verbose
|
| 415 |
+
unicode_flag = self.unicode
|
| 416 |
+
|
| 417 |
+
# (?flags:pattern) or (?flags)
|
| 418 |
+
flags, scoped = self.get_flags(i)
|
| 419 |
+
if flags: # pragma: no cover
|
| 420 |
+
t = flags
|
| 421 |
+
self.flags(flags[2:-1], scoped=scoped)
|
| 422 |
+
if not scoped:
|
| 423 |
+
return [flags]
|
| 424 |
+
|
| 425 |
+
current = []
|
| 426 |
+
try:
|
| 427 |
+
while t != ')':
|
| 428 |
+
if not current:
|
| 429 |
+
current.append(t)
|
| 430 |
+
else:
|
| 431 |
+
current.extend(self.normal(t, i))
|
| 432 |
+
|
| 433 |
+
t = next(i)
|
| 434 |
+
except StopIteration:
|
| 435 |
+
pass
|
| 436 |
+
|
| 437 |
+
# Restore flags after group
|
| 438 |
+
self.verbose = verbose
|
| 439 |
+
self.unicode = unicode_flag
|
| 440 |
+
|
| 441 |
+
if t == ")":
|
| 442 |
+
current.append(t)
|
| 443 |
+
return current
|
| 444 |
+
|
| 445 |
+
def char_groups(self, t: str, i: _util.StringIter) -> list[str]:
|
| 446 |
+
"""Handle character groups."""
|
| 447 |
+
|
| 448 |
+
current = []
|
| 449 |
+
pos = i.index - 1
|
| 450 |
+
found = False
|
| 451 |
+
escaped = False
|
| 452 |
+
first = 0
|
| 453 |
+
found_property = False
|
| 454 |
+
self.found_property = False
|
| 455 |
+
self.found_named_unicode = False
|
| 456 |
+
|
| 457 |
+
try:
|
| 458 |
+
while True:
|
| 459 |
+
# Prevent POSIX/Unicode class from being part of a range.
|
| 460 |
+
if self.found_property and t == '-':
|
| 461 |
+
current.append(_re.escape(t))
|
| 462 |
+
pos += 1
|
| 463 |
+
t = next(i)
|
| 464 |
+
self.found_property = False
|
| 465 |
+
continue
|
| 466 |
+
else:
|
| 467 |
+
self.found_property = False
|
| 468 |
+
|
| 469 |
+
if not escaped and t == "\\":
|
| 470 |
+
escaped = True
|
| 471 |
+
elif escaped:
|
| 472 |
+
escaped = False
|
| 473 |
+
idx = len(current) - 1
|
| 474 |
+
current.extend(self.reference(t, i, True))
|
| 475 |
+
if self.found_property:
|
| 476 |
+
# Prevent Unicode class from being part of a range.
|
| 477 |
+
if idx >= 0 and current[idx] == '-':
|
| 478 |
+
current[idx] = _re.escape('-')
|
| 479 |
+
found_property = True
|
| 480 |
+
elif t == "[" and not found:
|
| 481 |
+
found = True
|
| 482 |
+
first = pos
|
| 483 |
+
current.append(t)
|
| 484 |
+
elif t == "[":
|
| 485 |
+
index = i.index
|
| 486 |
+
try:
|
| 487 |
+
prop = self.get_unicode_property(i, True) # type: tuple[str, str] | None
|
| 488 |
+
except Exception:
|
| 489 |
+
prop = None
|
| 490 |
+
i.rewind(i.index - index)
|
| 491 |
+
if prop is not None:
|
| 492 |
+
value = self.unicode_props(prop[0], prop[1], in_group=True)
|
| 493 |
+
if current[-1] == '-':
|
| 494 |
+
current[-1] = _re.escape('-')
|
| 495 |
+
current.extend(value)
|
| 496 |
+
found_property = True
|
| 497 |
+
pos = i.index - 2
|
| 498 |
+
else:
|
| 499 |
+
current.append(t)
|
| 500 |
+
elif t == "^" and found and (pos == first + 1):
|
| 501 |
+
first = pos
|
| 502 |
+
current.append(t)
|
| 503 |
+
elif t == "]" and found and (pos != first + 1):
|
| 504 |
+
found = False
|
| 505 |
+
current.append(t)
|
| 506 |
+
break
|
| 507 |
+
else:
|
| 508 |
+
current.append(t)
|
| 509 |
+
pos += 1
|
| 510 |
+
t = next(i)
|
| 511 |
+
except StopIteration:
|
| 512 |
+
pass
|
| 513 |
+
|
| 514 |
+
if escaped:
|
| 515 |
+
current.append(t)
|
| 516 |
+
|
| 517 |
+
# Handle properties that return an empty string.
|
| 518 |
+
# This will occur when a property's values exceed
|
| 519 |
+
# either the Unicode char limit on a narrow system,
|
| 520 |
+
# or the ASCII limit in a byte string pattern.
|
| 521 |
+
if found_property or self.found_named_unicode:
|
| 522 |
+
temp = "".join(current)
|
| 523 |
+
if temp == '[]':
|
| 524 |
+
# We specified some properties, but they are all
|
| 525 |
+
# out of reach. Therefore we can match nothing.
|
| 526 |
+
current = [f'[^{_uniprops.ASCII_RANGE if self.is_bytes else _uniprops.UNICODE_RANGE}]']
|
| 527 |
+
elif temp == '[^]':
|
| 528 |
+
current = [f'[{_uniprops.ASCII_RANGE if self.is_bytes else _uniprops.UNICODE_RANGE}]']
|
| 529 |
+
else:
|
| 530 |
+
current = [temp]
|
| 531 |
+
|
| 532 |
+
return current
|
| 533 |
+
|
| 534 |
+
def normal(self, t: str, i: _util.StringIter) -> list[str]:
|
| 535 |
+
"""Handle normal chars."""
|
| 536 |
+
|
| 537 |
+
current = []
|
| 538 |
+
|
| 539 |
+
if t == "\\":
|
| 540 |
+
try:
|
| 541 |
+
t = next(i)
|
| 542 |
+
current.extend(self.reference(t, i))
|
| 543 |
+
except StopIteration:
|
| 544 |
+
current.append(t)
|
| 545 |
+
elif t == "(":
|
| 546 |
+
current.extend(self.subgroup(t, i))
|
| 547 |
+
elif self.verbose and t == "#":
|
| 548 |
+
current.extend(self.verbose_comment(t, i))
|
| 549 |
+
elif t == "[":
|
| 550 |
+
current.extend(self.char_groups(t, i))
|
| 551 |
+
else:
|
| 552 |
+
current.append(t)
|
| 553 |
+
return current
|
| 554 |
+
|
| 555 |
+
def unicode_name(self, name: str, in_group: bool = False) -> list[str]:
|
| 556 |
+
"""Insert Unicode value by its name."""
|
| 557 |
+
|
| 558 |
+
value = ord(_unicodedata.lookup(name))
|
| 559 |
+
if self.is_bytes and value > 0xFF:
|
| 560 |
+
if not in_group:
|
| 561 |
+
return [f'[^{_uniprops.ASCII_RANGE if self.is_bytes else _uniprops.UNICODE_RANGE}]']
|
| 562 |
+
else:
|
| 563 |
+
return ['']
|
| 564 |
+
return [f'\\{value:03o}' if value <= 0xFF else chr(value)]
|
| 565 |
+
|
| 566 |
+
def unicode_props(
|
| 567 |
+
self,
|
| 568 |
+
props: str,
|
| 569 |
+
prop_value: str | None,
|
| 570 |
+
in_group: bool = False,
|
| 571 |
+
negate: bool = False
|
| 572 |
+
) -> list[str]:
|
| 573 |
+
"""
|
| 574 |
+
Insert Unicode properties.
|
| 575 |
+
|
| 576 |
+
Unicode properties are very forgiving.
|
| 577 |
+
Case doesn't matter and `[ -_]` will be stripped out.
|
| 578 |
+
"""
|
| 579 |
+
|
| 580 |
+
if props.startswith("^"):
|
| 581 |
+
if negate:
|
| 582 |
+
props = props[1:]
|
| 583 |
+
elif negate:
|
| 584 |
+
props = '^' + props
|
| 585 |
+
if not prop_value and prop_value is not None:
|
| 586 |
+
prop_value = None
|
| 587 |
+
|
| 588 |
+
if self.is_bytes:
|
| 589 |
+
mode = _uniprops.MODE_ASCII
|
| 590 |
+
elif not self.unicode:
|
| 591 |
+
mode = _uniprops.MODE_NORMAL
|
| 592 |
+
else:
|
| 593 |
+
mode = _uniprops.MODE_UNICODE
|
| 594 |
+
|
| 595 |
+
v = _uniprops.get_unicode_property(props, prop_value, mode)
|
| 596 |
+
if not in_group:
|
| 597 |
+
if not v:
|
| 598 |
+
v = f'^{_uniprops.ASCII_RANGE if self.is_bytes else _uniprops.UNICODE_RANGE}'
|
| 599 |
+
v = f"[{v}]"
|
| 600 |
+
properties = [v]
|
| 601 |
+
|
| 602 |
+
return properties
|
| 603 |
+
|
| 604 |
+
def main_group(self, i: _util.StringIter) -> list[str]:
|
| 605 |
+
"""The main group: group 0."""
|
| 606 |
+
|
| 607 |
+
current = []
|
| 608 |
+
try:
|
| 609 |
+
while True:
|
| 610 |
+
t = next(i)
|
| 611 |
+
current.extend(self.normal(t, i))
|
| 612 |
+
except StopIteration:
|
| 613 |
+
pass
|
| 614 |
+
return current
|
| 615 |
+
|
| 616 |
+
def _parse(self, search: str) -> str:
|
| 617 |
+
"""Begin parsing."""
|
| 618 |
+
|
| 619 |
+
self.verbose = bool(self.re_verbose)
|
| 620 |
+
self.unicode = bool(self.re_unicode)
|
| 621 |
+
self.global_flag_swap = {
|
| 622 |
+
"unicode": False,
|
| 623 |
+
"verbose": False
|
| 624 |
+
}
|
| 625 |
+
self.temp_global_flag_swap = {
|
| 626 |
+
"unicode": False,
|
| 627 |
+
"verbose": False
|
| 628 |
+
}
|
| 629 |
+
self.ascii = self.re_unicode is not None and not self.re_unicode
|
| 630 |
+
if not self.unicode and not self.ascii:
|
| 631 |
+
self.unicode = True
|
| 632 |
+
|
| 633 |
+
new_pattern = []
|
| 634 |
+
i = _util.StringIter(self.process_quotes(search))
|
| 635 |
+
|
| 636 |
+
retry = True
|
| 637 |
+
while retry:
|
| 638 |
+
retry = False
|
| 639 |
+
try:
|
| 640 |
+
new_pattern = self.main_group(i)
|
| 641 |
+
except GlobalRetryException as e:
|
| 642 |
+
# Prevent a loop of retry over and over for a pattern like ((?u)(?a))
|
| 643 |
+
# or (?-x:(?x))
|
| 644 |
+
if self.temp_global_flag_swap['unicode']:
|
| 645 |
+
if self.global_flag_swap['unicode']:
|
| 646 |
+
raise LoopException('Global unicode flag recursion.') from e
|
| 647 |
+
else:
|
| 648 |
+
self.global_flag_swap["unicode"] = True
|
| 649 |
+
if self.temp_global_flag_swap['verbose']:
|
| 650 |
+
if self.global_flag_swap['verbose']:
|
| 651 |
+
raise LoopException('Global verbose flag recursion.') from e
|
| 652 |
+
else:
|
| 653 |
+
self.global_flag_swap['verbose'] = True
|
| 654 |
+
self.temp_global_flag_swap = {
|
| 655 |
+
"unicode": False,
|
| 656 |
+
"verbose": False
|
| 657 |
+
}
|
| 658 |
+
i.rewind(i.index)
|
| 659 |
+
retry = True
|
| 660 |
+
return "".join(new_pattern)
|
| 661 |
+
|
| 662 |
+
def parse(self) -> AnyStr:
|
| 663 |
+
"""Apply search template."""
|
| 664 |
+
|
| 665 |
+
if isinstance(self.search, bytes):
|
| 666 |
+
return self._parse(self.search.decode('latin-1')).encode('latin-1')
|
| 667 |
+
else:
|
| 668 |
+
return self._parse(self.search)
|
| 669 |
+
|
| 670 |
+
|
| 671 |
+
class _ReplaceParser(Generic[AnyStr]):
|
| 672 |
+
"""Pre-replace template."""
|
| 673 |
+
|
| 674 |
+
def __init__(self, pattern: Pattern[AnyStr], template: AnyStr, use_format: bool = False) -> None:
|
| 675 |
+
"""Initialize."""
|
| 676 |
+
|
| 677 |
+
self.pattern = pattern # type: Pattern[AnyStr]
|
| 678 |
+
self._original = template # type: AnyStr
|
| 679 |
+
self._template = template # type: AnyStr
|
| 680 |
+
self.use_format = use_format
|
| 681 |
+
self.end_found = False
|
| 682 |
+
self.group_slots = [] # type: list[tuple[int, tuple[int | None, int | None, Any]]]
|
| 683 |
+
self.literal_slots = [] # type: list[str]
|
| 684 |
+
self.result = [] # type: list[str]
|
| 685 |
+
self.span_stack = [] # type: list[int]
|
| 686 |
+
self.single_stack = [] # type: list[int]
|
| 687 |
+
self.literals = [] # type: list[AnyStr | None]
|
| 688 |
+
self.groups = [] # type: list[tuple[int, int]]
|
| 689 |
+
self.slot = 0
|
| 690 |
+
self.manual = False
|
| 691 |
+
self.auto = False
|
| 692 |
+
self.auto_index = 0
|
| 693 |
+
self.is_bytes = isinstance(self._original, bytes)
|
| 694 |
+
|
| 695 |
+
def parse_format_index(self, text: str) -> int | str:
|
| 696 |
+
"""Parse format index."""
|
| 697 |
+
|
| 698 |
+
base = 10
|
| 699 |
+
prefix = text[1:3] if text[0] == "-" else text[:2]
|
| 700 |
+
if prefix[0:1] == "0":
|
| 701 |
+
char = prefix[-1]
|
| 702 |
+
if char == "b":
|
| 703 |
+
base = 2
|
| 704 |
+
elif char == "o":
|
| 705 |
+
base = 8
|
| 706 |
+
elif char == "x":
|
| 707 |
+
base = 16
|
| 708 |
+
try:
|
| 709 |
+
idx = int(text, base) # type: int | str
|
| 710 |
+
except Exception:
|
| 711 |
+
idx = text
|
| 712 |
+
return idx
|
| 713 |
+
|
| 714 |
+
def get_format(self, c: str, i: _util.StringIter) -> tuple[str, list[tuple[int, Any]]]:
|
| 715 |
+
"""Get format group."""
|
| 716 |
+
|
| 717 |
+
index = i.index
|
| 718 |
+
field = ''
|
| 719 |
+
value = [] # type: list[tuple[int, Any]]
|
| 720 |
+
|
| 721 |
+
try:
|
| 722 |
+
if c == '}':
|
| 723 |
+
value.append((_util.FMT_FIELD, ''))
|
| 724 |
+
value.append((_util.FMT_INDEX, -1))
|
| 725 |
+
else:
|
| 726 |
+
# Field
|
| 727 |
+
temp = [] # type: list[str]
|
| 728 |
+
if c in _LETTERS_UNDERSCORE:
|
| 729 |
+
# Handle name
|
| 730 |
+
temp.append(c)
|
| 731 |
+
c = self.format_next(i)
|
| 732 |
+
while c in _WORD:
|
| 733 |
+
temp.append(c)
|
| 734 |
+
c = self.format_next(i)
|
| 735 |
+
elif c in _DIGIT:
|
| 736 |
+
# Handle group number
|
| 737 |
+
temp.append(c)
|
| 738 |
+
c = self.format_next(i)
|
| 739 |
+
while c in _DIGIT:
|
| 740 |
+
temp.append(c)
|
| 741 |
+
c = self.format_next(i)
|
| 742 |
+
|
| 743 |
+
# Try and covert to integer index
|
| 744 |
+
field = ''.join(temp).strip()
|
| 745 |
+
try:
|
| 746 |
+
value = [(_util.FMT_FIELD, str(int(field, 10)))]
|
| 747 |
+
except ValueError:
|
| 748 |
+
value = [(_util.FMT_FIELD, field)]
|
| 749 |
+
pass
|
| 750 |
+
|
| 751 |
+
if c != '[':
|
| 752 |
+
value.append((_util.FMT_INDEX, None))
|
| 753 |
+
|
| 754 |
+
# Attributes and indexes
|
| 755 |
+
while c in ('[', '.'):
|
| 756 |
+
if c == '[':
|
| 757 |
+
findex = []
|
| 758 |
+
sindex = i.index - 1
|
| 759 |
+
c = self.format_next(i)
|
| 760 |
+
try:
|
| 761 |
+
while c != ']':
|
| 762 |
+
findex.append(c)
|
| 763 |
+
c = self.format_next(i)
|
| 764 |
+
except StopIteration as e:
|
| 765 |
+
raise SyntaxError(f"Unmatched '[' at {sindex - 1}") from e
|
| 766 |
+
idx = self.parse_format_index(''.join(findex))
|
| 767 |
+
value.append((_util.FMT_INDEX, idx))
|
| 768 |
+
c = self.format_next(i)
|
| 769 |
+
else:
|
| 770 |
+
findex = []
|
| 771 |
+
c = self.format_next(i)
|
| 772 |
+
while c in _WORD:
|
| 773 |
+
findex.append(c)
|
| 774 |
+
c = self.format_next(i)
|
| 775 |
+
value.append((_util.FMT_ATTR, ''.join(findex)))
|
| 776 |
+
|
| 777 |
+
# Conversion
|
| 778 |
+
if c == '!':
|
| 779 |
+
c = self.format_next(i)
|
| 780 |
+
if c not in _FMT_CONV_TYPE:
|
| 781 |
+
raise SyntaxError(f"Invalid conversion type at {i.index - 1}!")
|
| 782 |
+
value.append((_util.FMT_CONV, c))
|
| 783 |
+
c = self.format_next(i)
|
| 784 |
+
|
| 785 |
+
# Format spec
|
| 786 |
+
if c == ':':
|
| 787 |
+
fill = None # type: str | None
|
| 788 |
+
width = []
|
| 789 |
+
align = None
|
| 790 |
+
convert = None
|
| 791 |
+
c = self.format_next(i)
|
| 792 |
+
|
| 793 |
+
if c in ('<', '>', '^'):
|
| 794 |
+
# Get fill and alignment
|
| 795 |
+
align = c
|
| 796 |
+
c = self.format_next(i)
|
| 797 |
+
if c in ('<', '>', '^'):
|
| 798 |
+
fill = align
|
| 799 |
+
align = c
|
| 800 |
+
c = self.format_next(i)
|
| 801 |
+
elif c in _DIGIT:
|
| 802 |
+
# Get Width
|
| 803 |
+
fill = c
|
| 804 |
+
c = self.format_next(i)
|
| 805 |
+
if c in ('<', '>', '^'):
|
| 806 |
+
align = c
|
| 807 |
+
c = self.format_next(i)
|
| 808 |
+
else:
|
| 809 |
+
width.append(fill)
|
| 810 |
+
fill = None
|
| 811 |
+
else:
|
| 812 |
+
fill = c
|
| 813 |
+
c = self.format_next(i)
|
| 814 |
+
if fill == 's' and c == '}':
|
| 815 |
+
convert = fill
|
| 816 |
+
fill = None
|
| 817 |
+
if fill is not None:
|
| 818 |
+
if c not in ('<', '>', '^'):
|
| 819 |
+
raise SyntaxError(f'Invalid format spec char at {i.index - 1}!')
|
| 820 |
+
align = c
|
| 821 |
+
c = self.format_next(i)
|
| 822 |
+
|
| 823 |
+
while c in _DIGIT:
|
| 824 |
+
width.append(c)
|
| 825 |
+
c = self.format_next(i)
|
| 826 |
+
|
| 827 |
+
if not align and len(width) and width[0] == '0':
|
| 828 |
+
raise ValueError("'=' alignment is not supported!")
|
| 829 |
+
if align and not fill and len(width) and width[0] == '0':
|
| 830 |
+
fill = '0'
|
| 831 |
+
|
| 832 |
+
if c == 's':
|
| 833 |
+
convert = c
|
| 834 |
+
c = self.format_next(i)
|
| 835 |
+
|
| 836 |
+
if not fill:
|
| 837 |
+
fill = ' '
|
| 838 |
+
|
| 839 |
+
value.append(
|
| 840 |
+
(
|
| 841 |
+
_util.FMT_SPEC,
|
| 842 |
+
(
|
| 843 |
+
fill.encode('latin-1') if self.is_bytes else fill,
|
| 844 |
+
align,
|
| 845 |
+
(int(''.join(width)) if width else 0),
|
| 846 |
+
convert
|
| 847 |
+
)
|
| 848 |
+
)
|
| 849 |
+
)
|
| 850 |
+
|
| 851 |
+
if c != '}':
|
| 852 |
+
raise SyntaxError(f"Unmatched '{{' at {index - 1}")
|
| 853 |
+
except StopIteration as e:
|
| 854 |
+
raise SyntaxError(f"Unmatched '{{' at {index - 1}!") from e
|
| 855 |
+
|
| 856 |
+
return field, value
|
| 857 |
+
|
| 858 |
+
def handle_format(self, t: str, i: _util.StringIter) -> None:
|
| 859 |
+
"""Handle format."""
|
| 860 |
+
|
| 861 |
+
if t == '{':
|
| 862 |
+
t = self.format_next(i)
|
| 863 |
+
if t == '{':
|
| 864 |
+
self.get_single_stack()
|
| 865 |
+
self.result.append(t)
|
| 866 |
+
else:
|
| 867 |
+
field, text = self.get_format(t, i)
|
| 868 |
+
self.handle_format_group(field, text)
|
| 869 |
+
else:
|
| 870 |
+
t = self.format_next(i)
|
| 871 |
+
if t == '}':
|
| 872 |
+
self.get_single_stack()
|
| 873 |
+
self.result.append(t)
|
| 874 |
+
else:
|
| 875 |
+
raise SyntaxError(f"Unmatched '}}' at {i.index - 2}!")
|
| 876 |
+
|
| 877 |
+
def get_octal(self, c: str, i: _util.StringIter) -> str | None:
|
| 878 |
+
"""Get octal."""
|
| 879 |
+
|
| 880 |
+
index = i.index
|
| 881 |
+
value = []
|
| 882 |
+
zero_count = 0
|
| 883 |
+
try:
|
| 884 |
+
if c == '0':
|
| 885 |
+
for _ in range(3):
|
| 886 |
+
if c != '0':
|
| 887 |
+
break
|
| 888 |
+
value.append(c)
|
| 889 |
+
c = next(i)
|
| 890 |
+
zero_count = len(value)
|
| 891 |
+
if zero_count < 3:
|
| 892 |
+
for _ in range(3 - zero_count):
|
| 893 |
+
if c not in _OCTAL:
|
| 894 |
+
break
|
| 895 |
+
value.append(c)
|
| 896 |
+
c = next(i)
|
| 897 |
+
i.rewind(1)
|
| 898 |
+
except StopIteration:
|
| 899 |
+
pass
|
| 900 |
+
|
| 901 |
+
octal_count = len(value)
|
| 902 |
+
if not (self.use_format and octal_count) and not (zero_count and octal_count < 3) and octal_count != 3:
|
| 903 |
+
i.rewind(i.index - index)
|
| 904 |
+
value = []
|
| 905 |
+
|
| 906 |
+
return ''.join(value) if value else None
|
| 907 |
+
|
| 908 |
+
def parse_octal(self, text: str, i: _util.StringIter) -> None:
|
| 909 |
+
"""Parse octal value."""
|
| 910 |
+
|
| 911 |
+
value = int(text, 8)
|
| 912 |
+
if value > 0xFF and self.is_bytes:
|
| 913 |
+
# Re fails on octal greater than `0o377` or `0xFF`
|
| 914 |
+
raise ValueError("octal escape value outside of range 0-0o377!")
|
| 915 |
+
else:
|
| 916 |
+
single = self.get_single_stack()
|
| 917 |
+
if self.span_stack:
|
| 918 |
+
text = self.convert_case(chr(value), self.span_stack[-1])
|
| 919 |
+
value = ord(self.convert_case(text, single)) if single is not None else ord(text)
|
| 920 |
+
elif single:
|
| 921 |
+
value = ord(self.convert_case(chr(value), single))
|
| 922 |
+
if self.use_format and value in _CURLY_BRACKETS_ORD:
|
| 923 |
+
self.handle_format(chr(value), i)
|
| 924 |
+
elif value <= 0xFF:
|
| 925 |
+
self.result.append(f'\\{value:03o}')
|
| 926 |
+
else:
|
| 927 |
+
self.result.append(chr(value))
|
| 928 |
+
|
| 929 |
+
def get_named_unicode(self, i: _util.StringIter) -> str:
|
| 930 |
+
"""Get named Unicode."""
|
| 931 |
+
|
| 932 |
+
index = i.index
|
| 933 |
+
value = []
|
| 934 |
+
try:
|
| 935 |
+
if next(i) != '{':
|
| 936 |
+
raise SyntaxError(f"Named Unicode missing '{{' at {i.index - 1}!")
|
| 937 |
+
c = next(i)
|
| 938 |
+
while c != '}':
|
| 939 |
+
value.append(c)
|
| 940 |
+
c = next(i)
|
| 941 |
+
except StopIteration as e:
|
| 942 |
+
raise SyntaxError(f"Unmatched '}}' at {index}!") from e
|
| 943 |
+
|
| 944 |
+
return ''.join(value)
|
| 945 |
+
|
| 946 |
+
def parse_named_unicode(self, i: _util.StringIter) -> None:
|
| 947 |
+
"""Parse named Unicode."""
|
| 948 |
+
|
| 949 |
+
value = ord(_unicodedata.lookup(self.get_named_unicode(i)))
|
| 950 |
+
single = self.get_single_stack()
|
| 951 |
+
if self.span_stack:
|
| 952 |
+
text = self.convert_case(chr(value), self.span_stack[-1])
|
| 953 |
+
value = ord(self.convert_case(text, single)) if single is not None else ord(text)
|
| 954 |
+
elif single:
|
| 955 |
+
value = ord(self.convert_case(chr(value), single))
|
| 956 |
+
if self.use_format and value in _CURLY_BRACKETS_ORD:
|
| 957 |
+
self.handle_format(chr(value), i)
|
| 958 |
+
elif value <= 0xFF:
|
| 959 |
+
self.result.append(f'\\{value:03o}')
|
| 960 |
+
else:
|
| 961 |
+
self.result.append(chr(value))
|
| 962 |
+
|
| 963 |
+
def get_wide_unicode(self, i: _util.StringIter) -> str:
|
| 964 |
+
"""Get narrow Unicode."""
|
| 965 |
+
|
| 966 |
+
value = []
|
| 967 |
+
for _ in range(3):
|
| 968 |
+
c = next(i)
|
| 969 |
+
if c == '0':
|
| 970 |
+
value.append(c)
|
| 971 |
+
else: # pragma: no cover
|
| 972 |
+
raise SyntaxError(f'Invalid wide Unicode character at {i.index - 1}!')
|
| 973 |
+
|
| 974 |
+
c = next(i)
|
| 975 |
+
if c in ('0', '1'):
|
| 976 |
+
value.append(c)
|
| 977 |
+
else: # pragma: no cover
|
| 978 |
+
raise SyntaxError(f'Invalid wide Unicode character at {i.index - 1}!')
|
| 979 |
+
|
| 980 |
+
for _ in range(4):
|
| 981 |
+
c = next(i)
|
| 982 |
+
if c.lower() in _HEX:
|
| 983 |
+
value.append(c)
|
| 984 |
+
else: # pragma: no cover
|
| 985 |
+
raise SyntaxError(f'Invalid wide Unicode character at {i.index - 1}!')
|
| 986 |
+
return ''.join(value)
|
| 987 |
+
|
| 988 |
+
def get_narrow_unicode(self, i: _util.StringIter) -> str:
|
| 989 |
+
"""Get narrow Unicode."""
|
| 990 |
+
|
| 991 |
+
value = []
|
| 992 |
+
for _ in range(4):
|
| 993 |
+
c = next(i)
|
| 994 |
+
if c.lower() in _HEX:
|
| 995 |
+
value.append(c)
|
| 996 |
+
else: # pragma: no cover
|
| 997 |
+
raise SyntaxError(f'Invalid Unicode character at {i.index - 1}!')
|
| 998 |
+
return ''.join(value)
|
| 999 |
+
|
| 1000 |
+
def parse_unicode(self, i: _util.StringIter, wide: bool = False) -> None:
|
| 1001 |
+
"""Parse Unicode."""
|
| 1002 |
+
|
| 1003 |
+
text = self.get_wide_unicode(i) if wide else self.get_narrow_unicode(i)
|
| 1004 |
+
value = int(text, 16)
|
| 1005 |
+
single = self.get_single_stack()
|
| 1006 |
+
if self.span_stack:
|
| 1007 |
+
text = self.convert_case(chr(value), self.span_stack[-1])
|
| 1008 |
+
value = ord(self.convert_case(text, single)) if single is not None else ord(text)
|
| 1009 |
+
elif single:
|
| 1010 |
+
value = ord(self.convert_case(chr(value), single))
|
| 1011 |
+
if self.use_format and value in _CURLY_BRACKETS_ORD:
|
| 1012 |
+
self.handle_format(chr(value), i)
|
| 1013 |
+
elif value <= 0xFF:
|
| 1014 |
+
self.result.append(f'\\{value:03o}')
|
| 1015 |
+
else:
|
| 1016 |
+
self.result.append(chr(value))
|
| 1017 |
+
|
| 1018 |
+
def get_byte(self, i: _util.StringIter) -> str:
|
| 1019 |
+
"""Get byte."""
|
| 1020 |
+
|
| 1021 |
+
value = []
|
| 1022 |
+
for _x in range(2):
|
| 1023 |
+
c = next(i)
|
| 1024 |
+
if c.lower() in _HEX:
|
| 1025 |
+
value.append(c)
|
| 1026 |
+
else: # pragma: no cover
|
| 1027 |
+
raise SyntaxError(f'Invalid byte character at {i.index - 1}!')
|
| 1028 |
+
return ''.join(value)
|
| 1029 |
+
|
| 1030 |
+
def parse_bytes(self, i: _util.StringIter) -> None:
|
| 1031 |
+
"""Parse byte."""
|
| 1032 |
+
|
| 1033 |
+
value = int(self.get_byte(i), 16)
|
| 1034 |
+
single = self.get_single_stack()
|
| 1035 |
+
if self.span_stack:
|
| 1036 |
+
text = self.convert_case(chr(value), self.span_stack[-1])
|
| 1037 |
+
value = ord(self.convert_case(text, single)) if single is not None else ord(text)
|
| 1038 |
+
elif single:
|
| 1039 |
+
value = ord(self.convert_case(chr(value), single))
|
| 1040 |
+
if self.use_format and value in _CURLY_BRACKETS_ORD:
|
| 1041 |
+
self.handle_format(chr(value), i)
|
| 1042 |
+
else:
|
| 1043 |
+
self.result.append(f'\\{value:03o}')
|
| 1044 |
+
|
| 1045 |
+
def get_named_group(self, t: str, i: _util.StringIter) -> str:
|
| 1046 |
+
"""Get group number."""
|
| 1047 |
+
|
| 1048 |
+
index = i.index
|
| 1049 |
+
value = [t]
|
| 1050 |
+
try:
|
| 1051 |
+
c = next(i)
|
| 1052 |
+
if c != "<":
|
| 1053 |
+
raise SyntaxError(f"Group missing '<' at {i.index - 1}!")
|
| 1054 |
+
value.append(c)
|
| 1055 |
+
c = next(i)
|
| 1056 |
+
if c in _DIGIT:
|
| 1057 |
+
value.append(c)
|
| 1058 |
+
c = next(i)
|
| 1059 |
+
while c != '>':
|
| 1060 |
+
if c in _DIGIT:
|
| 1061 |
+
value.append(c)
|
| 1062 |
+
c = next(i)
|
| 1063 |
+
value.append(c)
|
| 1064 |
+
elif c in _LETTERS_UNDERSCORE:
|
| 1065 |
+
value.append(c)
|
| 1066 |
+
c = next(i)
|
| 1067 |
+
while c != '>':
|
| 1068 |
+
if c in _WORD:
|
| 1069 |
+
value.append(c)
|
| 1070 |
+
c = next(i)
|
| 1071 |
+
value.append(c)
|
| 1072 |
+
else:
|
| 1073 |
+
raise SyntaxError(f"Invalid group character at {i.index - 1}!")
|
| 1074 |
+
except StopIteration as e:
|
| 1075 |
+
raise SyntaxError(f"Unmatched '<' at {index}!") from e
|
| 1076 |
+
|
| 1077 |
+
return ''.join(value)
|
| 1078 |
+
|
| 1079 |
+
def get_group(self, t: str, i: _util.StringIter) -> str | None:
|
| 1080 |
+
"""Get group number."""
|
| 1081 |
+
|
| 1082 |
+
value = []
|
| 1083 |
+
try:
|
| 1084 |
+
if t in _DIGIT and t != '0':
|
| 1085 |
+
value.append(t)
|
| 1086 |
+
t = next(i)
|
| 1087 |
+
if t in _DIGIT:
|
| 1088 |
+
value.append(t)
|
| 1089 |
+
else:
|
| 1090 |
+
i.rewind(1)
|
| 1091 |
+
except StopIteration:
|
| 1092 |
+
pass
|
| 1093 |
+
return ''.join(value) if value else None
|
| 1094 |
+
|
| 1095 |
+
def format_next(self, i: _util.StringIter) -> str:
|
| 1096 |
+
"""Get next format char."""
|
| 1097 |
+
|
| 1098 |
+
c = next(i)
|
| 1099 |
+
return self.format_references(next(i), i) if c == '\\' else c
|
| 1100 |
+
|
| 1101 |
+
def format_references(self, t: str, i: _util.StringIter) -> str:
|
| 1102 |
+
"""Handle format references."""
|
| 1103 |
+
|
| 1104 |
+
octal = self.get_octal(t, i)
|
| 1105 |
+
if octal:
|
| 1106 |
+
o = int(octal, 8)
|
| 1107 |
+
if o > 0xFF and self.is_bytes:
|
| 1108 |
+
# Re fails on octal greater than `0o377` or `0xFF`
|
| 1109 |
+
raise ValueError("octal escape value outside of range 0-0o377!")
|
| 1110 |
+
value = chr(o)
|
| 1111 |
+
elif t in _STANDARD_ESCAPES or t == '\\':
|
| 1112 |
+
value = _BACK_SLASH_TRANSLATION['\\' + t]
|
| 1113 |
+
elif not self.is_bytes and t == "U":
|
| 1114 |
+
value = chr(int(self.get_wide_unicode(i), 16))
|
| 1115 |
+
elif not self.is_bytes and t == "u":
|
| 1116 |
+
value = chr(int(self.get_narrow_unicode(i), 16))
|
| 1117 |
+
elif not self.is_bytes and t == "N":
|
| 1118 |
+
value = _unicodedata.lookup(self.get_named_unicode(i))
|
| 1119 |
+
elif t == "x":
|
| 1120 |
+
value = chr(int(self.get_byte(i), 16))
|
| 1121 |
+
else:
|
| 1122 |
+
i.rewind(1)
|
| 1123 |
+
value = '\\'
|
| 1124 |
+
return value
|
| 1125 |
+
|
| 1126 |
+
def reference(self, t: str, i: _util.StringIter) -> None:
|
| 1127 |
+
"""Handle references."""
|
| 1128 |
+
octal = self.get_octal(t, i)
|
| 1129 |
+
if t in _OCTAL and octal:
|
| 1130 |
+
self.parse_octal(octal, i)
|
| 1131 |
+
elif (t in _DIGIT or t == 'g') and not self.use_format:
|
| 1132 |
+
group = self.get_group(t, i)
|
| 1133 |
+
if not group:
|
| 1134 |
+
group = self.get_named_group(t, i)
|
| 1135 |
+
self.handle_group('\\' + group)
|
| 1136 |
+
elif t in _STANDARD_ESCAPES:
|
| 1137 |
+
self.get_single_stack()
|
| 1138 |
+
self.result.append('\\' + t)
|
| 1139 |
+
elif t == "l":
|
| 1140 |
+
self.single_case(i, _LOWER)
|
| 1141 |
+
elif t == "L":
|
| 1142 |
+
self.span_case(i, _LOWER)
|
| 1143 |
+
elif t == "c":
|
| 1144 |
+
self.single_case(i, _UPPER)
|
| 1145 |
+
elif t == "C":
|
| 1146 |
+
self.span_case(i, _UPPER)
|
| 1147 |
+
elif t == "E":
|
| 1148 |
+
self.end_found = True
|
| 1149 |
+
elif not self.is_bytes and t == "U":
|
| 1150 |
+
self.parse_unicode(i, True)
|
| 1151 |
+
elif not self.is_bytes and t == "u":
|
| 1152 |
+
self.parse_unicode(i)
|
| 1153 |
+
elif not self.is_bytes and t == "N":
|
| 1154 |
+
self.parse_named_unicode(i)
|
| 1155 |
+
elif t == "x":
|
| 1156 |
+
self.parse_bytes(i)
|
| 1157 |
+
elif self.use_format and t in _CURLY_BRACKETS:
|
| 1158 |
+
self.result.append('\\\\')
|
| 1159 |
+
self.handle_format(t, i)
|
| 1160 |
+
elif self.use_format and t == 'g':
|
| 1161 |
+
self.result.append('\\\\')
|
| 1162 |
+
self.result.append(t)
|
| 1163 |
+
else:
|
| 1164 |
+
value = '\\' + t
|
| 1165 |
+
self.get_single_stack()
|
| 1166 |
+
if self.span_stack:
|
| 1167 |
+
value = self.convert_case(value, self.span_stack[-1])
|
| 1168 |
+
self.result.append(value)
|
| 1169 |
+
|
| 1170 |
+
def _parse_template(self, template: str) -> str:
|
| 1171 |
+
"""Parse template."""
|
| 1172 |
+
|
| 1173 |
+
self.result = [""]
|
| 1174 |
+
|
| 1175 |
+
i = _util.StringIter(template)
|
| 1176 |
+
|
| 1177 |
+
try:
|
| 1178 |
+
while True:
|
| 1179 |
+
t = next(i)
|
| 1180 |
+
if self.use_format and t in _CURLY_BRACKETS:
|
| 1181 |
+
self.handle_format(t, i)
|
| 1182 |
+
elif t == '\\':
|
| 1183 |
+
try:
|
| 1184 |
+
t = next(i)
|
| 1185 |
+
self.reference(t, i)
|
| 1186 |
+
except StopIteration:
|
| 1187 |
+
self.result.append(t)
|
| 1188 |
+
raise
|
| 1189 |
+
else:
|
| 1190 |
+
self.result.append(t)
|
| 1191 |
+
except StopIteration:
|
| 1192 |
+
pass
|
| 1193 |
+
|
| 1194 |
+
if len(self.result) > 1:
|
| 1195 |
+
self.literal_slots.append("".join(self.result))
|
| 1196 |
+
del self.result[:]
|
| 1197 |
+
self.result.append("")
|
| 1198 |
+
self.slot += 1
|
| 1199 |
+
|
| 1200 |
+
return "".join(self.literal_slots)
|
| 1201 |
+
|
| 1202 |
+
def parse_template(self) -> None:
|
| 1203 |
+
"""Parse template."""
|
| 1204 |
+
|
| 1205 |
+
if isinstance(self._original, bytes):
|
| 1206 |
+
self._template = self._parse_template(self._original.decode('latin-1')).encode('latin-1')
|
| 1207 |
+
else:
|
| 1208 |
+
self._template = self._parse_template(self._original)
|
| 1209 |
+
|
| 1210 |
+
if _util.PY312:
|
| 1211 |
+
count = 0
|
| 1212 |
+
for part in _parser.parse_template(self._template, self.pattern):
|
| 1213 |
+
if isinstance(part, int):
|
| 1214 |
+
self.groups.append((count, part))
|
| 1215 |
+
self.literals.append(None)
|
| 1216 |
+
elif part:
|
| 1217 |
+
self.literals.append(cast(AnyStr, part))
|
| 1218 |
+
else:
|
| 1219 |
+
continue
|
| 1220 |
+
count += 1
|
| 1221 |
+
else:
|
| 1222 |
+
self.groups, self.literals = _parser.parse_template(self._template, self.pattern)
|
| 1223 |
+
|
| 1224 |
+
def span_case(self, i: _util.StringIter, case: int) -> None:
|
| 1225 |
+
"""Uppercase or lowercase the next range of characters until end marker is found."""
|
| 1226 |
+
|
| 1227 |
+
# A new \L, \C or \E should pop the last in the stack.
|
| 1228 |
+
if self.span_stack:
|
| 1229 |
+
self.span_stack.pop()
|
| 1230 |
+
if self.single_stack:
|
| 1231 |
+
self.single_stack.pop()
|
| 1232 |
+
self.span_stack.append(case)
|
| 1233 |
+
count = len(self.span_stack)
|
| 1234 |
+
self.end_found = False
|
| 1235 |
+
try:
|
| 1236 |
+
while not self.end_found:
|
| 1237 |
+
t = next(i)
|
| 1238 |
+
if self.use_format and t in _CURLY_BRACKETS:
|
| 1239 |
+
self.handle_format(t, i)
|
| 1240 |
+
elif t == '\\':
|
| 1241 |
+
try:
|
| 1242 |
+
t = next(i)
|
| 1243 |
+
self.reference(t, i)
|
| 1244 |
+
except StopIteration:
|
| 1245 |
+
self.result.append(t)
|
| 1246 |
+
raise
|
| 1247 |
+
else:
|
| 1248 |
+
self.result.append(self.convert_case(t, case))
|
| 1249 |
+
if self.end_found or count > len(self.span_stack):
|
| 1250 |
+
self.end_found = False
|
| 1251 |
+
break
|
| 1252 |
+
except StopIteration:
|
| 1253 |
+
pass
|
| 1254 |
+
if count == len(self.span_stack):
|
| 1255 |
+
self.span_stack.pop()
|
| 1256 |
+
|
| 1257 |
+
def convert_case(self, value: str, case: int) -> str:
|
| 1258 |
+
"""Convert case."""
|
| 1259 |
+
|
| 1260 |
+
if self.is_bytes:
|
| 1261 |
+
cased = []
|
| 1262 |
+
for c in value:
|
| 1263 |
+
if c in _ASCII_LETTERS:
|
| 1264 |
+
cased.append(c.lower() if case == _LOWER else c.upper())
|
| 1265 |
+
else:
|
| 1266 |
+
cased.append(c)
|
| 1267 |
+
return "".join(cased)
|
| 1268 |
+
else:
|
| 1269 |
+
return value.lower() if case == _LOWER else value.upper()
|
| 1270 |
+
|
| 1271 |
+
def single_case(self, i: _util.StringIter, case: int) -> None:
|
| 1272 |
+
"""Uppercase or lowercase the next character."""
|
| 1273 |
+
|
| 1274 |
+
# Pop a previous case if we have consecutive ones.
|
| 1275 |
+
if self.single_stack:
|
| 1276 |
+
self.single_stack.pop()
|
| 1277 |
+
self.single_stack.append(case)
|
| 1278 |
+
try:
|
| 1279 |
+
t = next(i)
|
| 1280 |
+
if self.use_format and t in _CURLY_BRACKETS:
|
| 1281 |
+
self.handle_format(t, i)
|
| 1282 |
+
elif t == '\\':
|
| 1283 |
+
try:
|
| 1284 |
+
t = next(i)
|
| 1285 |
+
self.reference(t, i)
|
| 1286 |
+
except StopIteration:
|
| 1287 |
+
self.result.append(t)
|
| 1288 |
+
raise
|
| 1289 |
+
elif self.single_stack:
|
| 1290 |
+
this_case = self.get_single_stack()
|
| 1291 |
+
if this_case is not None:
|
| 1292 |
+
self.result.append(self.convert_case(t, this_case))
|
| 1293 |
+
except StopIteration:
|
| 1294 |
+
pass
|
| 1295 |
+
|
| 1296 |
+
def get_single_stack(self) -> int | None:
|
| 1297 |
+
"""Get the correct single stack item to use."""
|
| 1298 |
+
|
| 1299 |
+
single = None
|
| 1300 |
+
while self.single_stack:
|
| 1301 |
+
single = self.single_stack.pop()
|
| 1302 |
+
return single
|
| 1303 |
+
|
| 1304 |
+
def handle_format_group(self, field: str, text: list[tuple[int, Any]]) -> None:
|
| 1305 |
+
"""Handle format group."""
|
| 1306 |
+
|
| 1307 |
+
# Handle auto incrementing group indexes
|
| 1308 |
+
if field == '':
|
| 1309 |
+
if self.auto:
|
| 1310 |
+
field = str(self.auto_index)
|
| 1311 |
+
text[0] = (_util.FMT_FIELD, field)
|
| 1312 |
+
self.auto_index += 1
|
| 1313 |
+
elif not self.manual and not self.auto:
|
| 1314 |
+
self.auto = True
|
| 1315 |
+
field = str(self.auto_index)
|
| 1316 |
+
text[0] = (_util.FMT_FIELD, field)
|
| 1317 |
+
self.auto_index += 1
|
| 1318 |
+
else:
|
| 1319 |
+
raise ValueError("Cannot switch to auto format during manual format!")
|
| 1320 |
+
elif not self.manual and not self.auto:
|
| 1321 |
+
self.manual = True
|
| 1322 |
+
elif not self.manual:
|
| 1323 |
+
raise ValueError("Cannot switch to manual format during auto format!")
|
| 1324 |
+
|
| 1325 |
+
self.handle_group(field, tuple(text), True)
|
| 1326 |
+
|
| 1327 |
+
def handle_group(
|
| 1328 |
+
self,
|
| 1329 |
+
text: str,
|
| 1330 |
+
capture: tuple[tuple[int, Any], ...] | None = None,
|
| 1331 |
+
is_format: bool = False
|
| 1332 |
+
) -> None:
|
| 1333 |
+
"""Handle groups."""
|
| 1334 |
+
|
| 1335 |
+
if len(self.result) > 1:
|
| 1336 |
+
self.literal_slots.append("".join(self.result))
|
| 1337 |
+
if is_format:
|
| 1338 |
+
self.literal_slots.extend(["\\g<", text, ">"])
|
| 1339 |
+
else:
|
| 1340 |
+
self.literal_slots.append(text)
|
| 1341 |
+
del self.result[:]
|
| 1342 |
+
self.result.append("")
|
| 1343 |
+
self.slot += 1
|
| 1344 |
+
elif is_format:
|
| 1345 |
+
self.literal_slots.extend(["\\g<", text, ">"])
|
| 1346 |
+
else:
|
| 1347 |
+
self.literal_slots.append(text)
|
| 1348 |
+
|
| 1349 |
+
self.group_slots.append(
|
| 1350 |
+
(
|
| 1351 |
+
self.slot,
|
| 1352 |
+
(
|
| 1353 |
+
(self.span_stack[-1] if self.span_stack else None),
|
| 1354 |
+
self.get_single_stack(),
|
| 1355 |
+
(() if self.is_bytes else '') if capture is None else capture
|
| 1356 |
+
)
|
| 1357 |
+
)
|
| 1358 |
+
)
|
| 1359 |
+
self.slot += 1
|
| 1360 |
+
|
| 1361 |
+
def get_base_template(self) -> AnyStr:
|
| 1362 |
+
"""Return the unmodified template before expansion."""
|
| 1363 |
+
|
| 1364 |
+
return self._original
|
| 1365 |
+
|
| 1366 |
+
def parse(self) -> ReplaceTemplate[AnyStr]:
|
| 1367 |
+
"""Parse template."""
|
| 1368 |
+
|
| 1369 |
+
if not isinstance(self.pattern.pattern, type(self._original)):
|
| 1370 |
+
raise TypeError('Pattern string type must match replace template string type!')
|
| 1371 |
+
|
| 1372 |
+
self.parse_template()
|
| 1373 |
+
|
| 1374 |
+
return ReplaceTemplate(
|
| 1375 |
+
tuple(self.groups),
|
| 1376 |
+
tuple(self.group_slots),
|
| 1377 |
+
tuple(self.literals),
|
| 1378 |
+
hash(self.pattern),
|
| 1379 |
+
self.use_format,
|
| 1380 |
+
self.is_bytes
|
| 1381 |
+
)
|
| 1382 |
+
|
| 1383 |
+
|
| 1384 |
+
class ReplaceTemplate(_util.Immutable, Generic[AnyStr]):
|
| 1385 |
+
"""Replacement template expander."""
|
| 1386 |
+
|
| 1387 |
+
__slots__ = ("groups", "group_slots", "literals", "pattern_hash", "use_format", "_hash", "_bytes")
|
| 1388 |
+
|
| 1389 |
+
groups: tuple[tuple[int, int], ...]
|
| 1390 |
+
group_slots: tuple[tuple[int, tuple[int | None, int | None, Any]], ...]
|
| 1391 |
+
literals: tuple[AnyStr | None, ...]
|
| 1392 |
+
pattern_hash: int
|
| 1393 |
+
use_format: bool
|
| 1394 |
+
_hash: int
|
| 1395 |
+
_bytes: bool
|
| 1396 |
+
|
| 1397 |
+
def __init__(
|
| 1398 |
+
self,
|
| 1399 |
+
groups: tuple[tuple[int, int], ...],
|
| 1400 |
+
group_slots: tuple[tuple[int, tuple[int | None, int | None, Any]], ...],
|
| 1401 |
+
literals: tuple[AnyStr | None, ...],
|
| 1402 |
+
pattern_hash: int,
|
| 1403 |
+
use_format: bool,
|
| 1404 |
+
is_bytes: bool
|
| 1405 |
+
) -> None:
|
| 1406 |
+
"""Initialize."""
|
| 1407 |
+
|
| 1408 |
+
super().__init__(
|
| 1409 |
+
use_format=use_format,
|
| 1410 |
+
groups=groups,
|
| 1411 |
+
group_slots=group_slots,
|
| 1412 |
+
literals=literals,
|
| 1413 |
+
pattern_hash=pattern_hash,
|
| 1414 |
+
_bytes=is_bytes,
|
| 1415 |
+
_hash=hash(
|
| 1416 |
+
(
|
| 1417 |
+
type(self),
|
| 1418 |
+
groups, group_slots, literals,
|
| 1419 |
+
pattern_hash, use_format, is_bytes
|
| 1420 |
+
)
|
| 1421 |
+
)
|
| 1422 |
+
)
|
| 1423 |
+
|
| 1424 |
+
def __call__(self, m: Match[AnyStr] | None) -> AnyStr:
|
| 1425 |
+
"""Call."""
|
| 1426 |
+
|
| 1427 |
+
return self.expand(m)
|
| 1428 |
+
|
| 1429 |
+
def __hash__(self) -> int:
|
| 1430 |
+
"""Hash."""
|
| 1431 |
+
|
| 1432 |
+
return self._hash
|
| 1433 |
+
|
| 1434 |
+
def __eq__(self, other: Any) -> bool:
|
| 1435 |
+
"""Equal."""
|
| 1436 |
+
|
| 1437 |
+
return (
|
| 1438 |
+
isinstance(other, ReplaceTemplate) and
|
| 1439 |
+
self.groups == other.groups and
|
| 1440 |
+
self.group_slots == other.group_slots and
|
| 1441 |
+
self.literals == other.literals and
|
| 1442 |
+
self.pattern_hash == other.pattern_hash and
|
| 1443 |
+
self.use_format == other.use_format and
|
| 1444 |
+
self._bytes == other._bytes
|
| 1445 |
+
)
|
| 1446 |
+
|
| 1447 |
+
def __ne__(self, other: Any) -> bool:
|
| 1448 |
+
"""Equal."""
|
| 1449 |
+
|
| 1450 |
+
return (
|
| 1451 |
+
not isinstance(other, ReplaceTemplate) or
|
| 1452 |
+
self.groups != other.groups or
|
| 1453 |
+
self.group_slots != other.group_slots or
|
| 1454 |
+
self.literals != other.literals or
|
| 1455 |
+
self.pattern_hash != other.pattern_hash or
|
| 1456 |
+
self.use_format != other.use_format or
|
| 1457 |
+
self._bytes != self._bytes
|
| 1458 |
+
)
|
| 1459 |
+
|
| 1460 |
+
def __repr__(self) -> str: # pragma: no cover
|
| 1461 |
+
"""Representation."""
|
| 1462 |
+
|
| 1463 |
+
return "{}.{}({!r}, {!r}, {!r}, {!r}, {!r})".format(
|
| 1464 |
+
self.__module__, self.__class__.__name__,
|
| 1465 |
+
self.groups, self.group_slots, self.literals,
|
| 1466 |
+
self.pattern_hash, self.use_format
|
| 1467 |
+
)
|
| 1468 |
+
|
| 1469 |
+
def _get_group_index(self, index: int) -> int:
|
| 1470 |
+
"""Find and return the appropriate group index."""
|
| 1471 |
+
|
| 1472 |
+
g_index = 0
|
| 1473 |
+
for group in self.groups:
|
| 1474 |
+
if group[0] == index:
|
| 1475 |
+
g_index = group[1]
|
| 1476 |
+
break
|
| 1477 |
+
return g_index
|
| 1478 |
+
|
| 1479 |
+
def _get_group_attributes(self, index: int) -> tuple[int | None, int | None, Any]:
|
| 1480 |
+
"""Find and return the appropriate group case."""
|
| 1481 |
+
|
| 1482 |
+
g_case = (None, None, -1) # type: tuple[int | None, int | None, Any]
|
| 1483 |
+
for group in self.group_slots:
|
| 1484 |
+
if group[0] == index:
|
| 1485 |
+
g_case = group[1]
|
| 1486 |
+
break
|
| 1487 |
+
return g_case
|
| 1488 |
+
|
| 1489 |
+
def expand(self, m: Match[AnyStr] | None) -> AnyStr:
|
| 1490 |
+
"""Using the template, expand the string."""
|
| 1491 |
+
|
| 1492 |
+
if m is None:
|
| 1493 |
+
raise ValueError("Match is None!")
|
| 1494 |
+
|
| 1495 |
+
sep = m.string[:0]
|
| 1496 |
+
if not isinstance(sep, bytes if self._bytes else str):
|
| 1497 |
+
raise TypeError('Match string type does not match expander string type!')
|
| 1498 |
+
text = []
|
| 1499 |
+
# Expand string
|
| 1500 |
+
for x in range(0, len(self.literals)):
|
| 1501 |
+
index = x
|
| 1502 |
+
l = self.literals[x]
|
| 1503 |
+
if l is None:
|
| 1504 |
+
g_index = self._get_group_index(index)
|
| 1505 |
+
span_case, single_case, capture = self._get_group_attributes(index)
|
| 1506 |
+
if not self.use_format:
|
| 1507 |
+
# Non format replace
|
| 1508 |
+
try:
|
| 1509 |
+
l = m.group(g_index)
|
| 1510 |
+
if l is None:
|
| 1511 |
+
l = sep
|
| 1512 |
+
except IndexError as e: # pragma: no cover
|
| 1513 |
+
raise IndexError(f"'{g_index}' is out of range!") from e
|
| 1514 |
+
else:
|
| 1515 |
+
# String format replace
|
| 1516 |
+
try:
|
| 1517 |
+
obj = m.group(g_index)
|
| 1518 |
+
except IndexError as e: # pragma: no cover
|
| 1519 |
+
raise IndexError(f"'{g_index}' is out of range!") from e
|
| 1520 |
+
l = _util.format_captures(
|
| 1521 |
+
[] if obj is None else [obj],
|
| 1522 |
+
capture,
|
| 1523 |
+
_util._to_bstr if isinstance(sep, bytes) else _util._to_str,
|
| 1524 |
+
sep
|
| 1525 |
+
)
|
| 1526 |
+
if span_case is not None:
|
| 1527 |
+
if span_case == _LOWER:
|
| 1528 |
+
l = l.lower()
|
| 1529 |
+
else:
|
| 1530 |
+
l = l.upper()
|
| 1531 |
+
if single_case is not None:
|
| 1532 |
+
if single_case == _LOWER:
|
| 1533 |
+
l = l[0:1].lower() + l[1:]
|
| 1534 |
+
else:
|
| 1535 |
+
l = l[0:1].upper() + l[1:]
|
| 1536 |
+
text.append(l)
|
| 1537 |
+
|
| 1538 |
+
return sep.join(text)
|
| 1539 |
+
|
| 1540 |
+
|
| 1541 |
+
def _pickle(r): # type: ignore[no-untyped-def]
|
| 1542 |
+
"""Pickle."""
|
| 1543 |
+
|
| 1544 |
+
return ReplaceTemplate, (r.groups, r.group_slots, r.literals, r.pattern_hash, r.use_format, r._bytes)
|
| 1545 |
+
|
| 1546 |
+
|
| 1547 |
+
_copyreg.pickle(ReplaceTemplate, _pickle)
|