langtable 0.0.63__py3-none-any.whl → 0.0.65__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
langtable/__init__.py CHANGED
@@ -10,5 +10,5 @@ from .langtable import _write_files
10
10
  # Deleting a module prevents one from import <pack>.somemodule1
11
11
  # directly. You can only import from <pack> objects defined or
12
12
  # imported in its __init__.py, and non-deleted submodules.
13
- del langtable
13
+ del langtable # type: ignore
14
14
 
Binary file
Binary file
Binary file
langtable/langtable.py CHANGED
@@ -34,6 +34,14 @@
34
34
  # languageId()
35
35
  # territoryId()
36
36
  # supports_ascii()
37
+ # list_all_languages()
38
+ # list_all_locales()
39
+ # list_all_keyboards()
40
+ # list_all_territories()
41
+ # list_all_timezones()
42
+ # list_all_scripts()
43
+ # list_all_input_methods()
44
+ # list_all_console_fonts()
37
45
  #
38
46
  # These are the functions which do not start with an “_” in their name.
39
47
  # All global functions and global variables whose name starts with an
@@ -97,6 +105,8 @@
97
105
  #
98
106
  ######################################################################
99
107
 
108
+ from typing import List
109
+ from typing import Dict
100
110
  import os
101
111
  import re
102
112
  import logging
@@ -110,7 +120,7 @@ Locale = collections.namedtuple(
110
120
  'Locale',
111
121
  ['language', 'script', 'territory', 'variant', 'encoding'])
112
122
 
113
- _INFO = {'data_files_read': []}
123
+ _INFO: Dict[str, List[str]] = {'data_files_read': []}
114
124
 
115
125
  # will be replaced by “make install”:
116
126
  _DATADIR = '/usr/share/langtable'
@@ -2528,6 +2538,80 @@ def list_timezones(concise=True, show_weights=False, languageId = None, scriptId
2528
2538
  else:
2529
2539
  return _ranked_list_to_list(ranked_list)
2530
2540
 
2541
+ def list_all_languages() -> List[str]:
2542
+ '''
2543
+ List all language ids langtable knows something about
2544
+ '''
2545
+ return sorted(_languages_db.keys())
2546
+
2547
+ def list_all_locales() -> List[str]:
2548
+ '''
2549
+ List all (glibc style) locales langtable knows something about
2550
+ '''
2551
+ all_locales = set()
2552
+ for (_key, item) in _languages_db.items():
2553
+ all_locales.update(item.locales)
2554
+ for (_key, item) in _territories_db.items():
2555
+ all_locales.update(item.locales)
2556
+ return sorted(all_locales)
2557
+
2558
+ def list_all_keyboards() -> List[str]:
2559
+ '''
2560
+ List all keyboards langtable knows something about
2561
+ '''
2562
+ return sorted(_keyboards_db.keys())
2563
+
2564
+ def list_all_territories() -> List[str]:
2565
+ '''
2566
+ List all territory ids langtable knows something about
2567
+ '''
2568
+ return sorted(_territories_db.keys())
2569
+
2570
+ def list_all_timezones() -> List[str]:
2571
+ '''
2572
+ List all timezone ids langtable knows something about
2573
+ '''
2574
+ all_timezones = set()
2575
+ all_timezones.update(list(_timezones_db.keys()))
2576
+ for (_key, item) in _languages_db.items():
2577
+ all_timezones.update(item.timezones)
2578
+ for (_key, item) in _territories_db.items():
2579
+ all_timezones.update(item.timezones)
2580
+ return sorted(all_timezones)
2581
+
2582
+ def list_all_scripts() -> List[str]:
2583
+ '''
2584
+ List all script ids langtable knows something about
2585
+ '''
2586
+ all_scripts = set()
2587
+ for (_key, item) in _languages_db.items():
2588
+ all_scripts.update(item.scripts)
2589
+ for (_key, item) in _territories_db.items():
2590
+ all_scripts.update(item.scripts)
2591
+ return sorted(all_scripts)
2592
+
2593
+ def list_all_input_methods() -> List[str]:
2594
+ '''
2595
+ List all input methods langtable knows something about
2596
+ '''
2597
+ all_inputmethods = set()
2598
+ for (_key, item) in _languages_db.items():
2599
+ all_inputmethods.update(item.inputmethods)
2600
+ for (_key, item) in _territories_db.items():
2601
+ all_inputmethods.update(item.inputmethods)
2602
+ return sorted(all_inputmethods)
2603
+
2604
+ def list_all_console_fonts() -> List[str]:
2605
+ '''
2606
+ List all console fonts langtable knows something about
2607
+ '''
2608
+ all_consolefonts = set()
2609
+ for (_key, item) in _languages_db.items():
2610
+ all_consolefonts.update(item.consolefonts)
2611
+ for (_key, item) in _territories_db.items():
2612
+ all_consolefonts.update(item.consolefonts)
2613
+ return sorted(all_consolefonts)
2614
+
2531
2615
  def supports_ascii(keyboardId=None):
2532
2616
  '''Check whether a keyboard layout supports ASCII
2533
2617
 
@@ -2555,7 +2639,8 @@ def version():
2555
2639
  '''
2556
2640
  Return version of langtable
2557
2641
  '''
2558
- import pkg_resources # part of setuptools
2642
+ # pkg_resources is part of setuptools
2643
+ import pkg_resources # type: ignore
2559
2644
  return pkg_resources.require("langtable")[0].version
2560
2645
 
2561
2646
  def info():
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: langtable
3
- Version: 0.0.63
3
+ Version: 0.0.65
4
4
  Summary: guess reasonable defaults for locale, keyboard, territory, ...
5
5
  Home-page: https://github.com/mike-fabian/langtable
6
6
  Author: Mike FABIAN
@@ -53,12 +53,7 @@ To create a distribution tarball run
53
53
 
54
54
  To run the test cases in the source directory:
55
55
 
56
- make test-local
57
-
58
- To run the test cases using the installed files:
59
-
60
- make install DESTDIR=/usr
61
- make test DESTDIR=/usr
56
+ make test
62
57
 
63
58
  How to use it
64
59
  =============
@@ -71,6 +66,7 @@ Functions in the public API:
71
66
  list_locales()
72
67
  list_keyboards()
73
68
  list_common_languages()
69
+ list_common_locales()
74
70
  list_common_keyboards()
75
71
  list_consolefonts()
76
72
  list_inputmethods()
@@ -82,6 +78,14 @@ Functions in the public API:
82
78
  languageId()
83
79
  territoryId()
84
80
  supports_ascii()
81
+ list_all_languages()
82
+ list_all_locales()
83
+ list_all_keyboards()
84
+ list_all_territories()
85
+ list_all_timezones()
86
+ list_all_scripts()
87
+ list_all_input_methods()
88
+ list_all_console_fonts()
85
89
 
86
90
  Some examples to show the usage are found in the documentation
87
91
  of the public functions in langtable.py.
@@ -0,0 +1,17 @@
1
+ langtable/__init__.py,sha256=09oRQxG7NrxWL_v5bKHHCt-DFuK-WIIKmyLp0RtS84M,526
2
+ langtable/langtable.py,sha256=ECBuskzJUBF2_qlbfkXqIAjCJ0mFqpbrcQt-x3mgPxU,107347
3
+ langtable/data/keyboards.xml.gz,sha256=SiBNgt_lJ6qiXM_Ni1fElNRSqnaCRBhqhKSn2FEAoWg,5888
4
+ langtable/data/languages.xml.gz,sha256=qjj4ArRWk47xV7_sbJa8s36XZ3pfiYpndxAFrVCBw48,407980
5
+ langtable/data/territories.xml.gz,sha256=6VH5LP8weFF4LZilHeQeWHBMgUsdJBO03Jrv0JLVRPs,494333
6
+ langtable/data/timezoneidparts.xml.gz,sha256=1bH7G-Twn4StA4J-fCDutqX_LPEJlUvQDxI0UY8ccfk,378548
7
+ langtable/data/timezones.xml.gz,sha256=UJ6YNPOKG5yp2hEgbEK_4yWsnmrbDhHZAr6ZL-Wr0Fw,3542
8
+ langtable/schemas/keyboards.rng,sha256=Gy8zXngR6VZ6QXGrsp4u7Aolpk-VkWTJ_8kTlT-a9ss,1301
9
+ langtable/schemas/languages.rng,sha256=rDTnJ-yPK7CgwQCjVMhLMCf0xzGpG2cnx0iIn85f0Po,4153
10
+ langtable/schemas/territories.rng,sha256=KnDf45rlNpmsDTmzND0WDDXGNy08N1fx0reRjKUS_SQ,3482
11
+ langtable/schemas/timezoneidparts.rng,sha256=--LNbran9DrHSDQSZMqxYjermlPRo39GZwLtR-zF_Ug,683
12
+ langtable/schemas/timezones.rng,sha256=l2sVJPyo48ESnNaTr1QHgv5fV26cIJZ_XxElumAc3F0,665
13
+ langtable-0.0.65.dist-info/COPYING,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
14
+ langtable-0.0.65.dist-info/METADATA,sha256=y4mSMXIgYvR_vVrygRdrl2jb5boZvgxu2a7kRTMGKWM,2549
15
+ langtable-0.0.65.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
16
+ langtable-0.0.65.dist-info/top_level.txt,sha256=vFuD4S3tAk7ZEIOqrR5tqqm-ThvhpwXxYUMxZdXY1-0,10
17
+ langtable-0.0.65.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.38.4)
2
+ Generator: bdist_wheel (0.40.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,17 +0,0 @@
1
- langtable/__init__.py,sha256=ORQmZNJGRmZlogMbW6mVsIwRejh8OBtnvshKJXJpQgg,511
2
- langtable/langtable.py,sha256=C8hCKSktmc5ycI1h-K26_yk03M-Pw2DfCRtBYEvY8Og,104682
3
- langtable/data/keyboards.xml.gz,sha256=SiBNgt_lJ6qiXM_Ni1fElNRSqnaCRBhqhKSn2FEAoWg,5888
4
- langtable/data/languages.xml.gz,sha256=lMGbXhoV7jYW9Muwe8zkXwoEkDVZhfTb1tsEiWhP2rE,404447
5
- langtable/data/territories.xml.gz,sha256=3-95Zj0QQUU3Fu0xn6TCFm_cGzXVYEmPEu-9afJ2XDU,488094
6
- langtable/data/timezoneidparts.xml.gz,sha256=T2iWSxt4ikLjL0dPEIH4jzkcCcQ8MYHMdl_abu9OsRA,377867
7
- langtable/data/timezones.xml.gz,sha256=UJ6YNPOKG5yp2hEgbEK_4yWsnmrbDhHZAr6ZL-Wr0Fw,3542
8
- langtable/schemas/keyboards.rng,sha256=Gy8zXngR6VZ6QXGrsp4u7Aolpk-VkWTJ_8kTlT-a9ss,1301
9
- langtable/schemas/languages.rng,sha256=rDTnJ-yPK7CgwQCjVMhLMCf0xzGpG2cnx0iIn85f0Po,4153
10
- langtable/schemas/territories.rng,sha256=KnDf45rlNpmsDTmzND0WDDXGNy08N1fx0reRjKUS_SQ,3482
11
- langtable/schemas/timezoneidparts.rng,sha256=--LNbran9DrHSDQSZMqxYjermlPRo39GZwLtR-zF_Ug,683
12
- langtable/schemas/timezones.rng,sha256=l2sVJPyo48ESnNaTr1QHgv5fV26cIJZ_XxElumAc3F0,665
13
- langtable-0.0.63.dist-info/COPYING,sha256=jOtLnuWt7d5Hsx6XXB2QxzrSe2sWWh3NgMfFRetluQM,35147
14
- langtable-0.0.63.dist-info/METADATA,sha256=p1zj0BKvDBPraxQztcbZgX9Zfr64o6BRCwqcfE4teuI,2424
15
- langtable-0.0.63.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
16
- langtable-0.0.63.dist-info/top_level.txt,sha256=vFuD4S3tAk7ZEIOqrR5tqqm-ThvhpwXxYUMxZdXY1-0,10
17
- langtable-0.0.63.dist-info/RECORD,,