-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path__init__.py
More file actions
74 lines (67 loc) · 2 KB
/
__init__.py
File metadata and controls
74 lines (67 loc) · 2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
from importlib import import_module
from typing import Any, Dict
__version__ = "0.4.0"
__all__ = [
"ActivityIndicatorView",
"Button",
"DatePicker",
"ImageView",
"Label",
"ListView",
"MaterialActivityIndicatorView",
"MaterialButton",
"MaterialDatePicker",
"MaterialProgressView",
"MaterialSearchBar",
"MaterialSwitch",
"MaterialTimePicker",
"MaterialBottomNavigationView",
"MaterialToolbar",
"Page",
"PickerView",
"ProgressView",
"ScrollView",
"SearchBar",
"StackView",
"Switch",
"TextField",
"TextView",
"TimePicker",
"WebView",
]
_NAME_TO_MODULE: Dict[str, str] = {
"ActivityIndicatorView": ".activity_indicator_view",
"Button": ".button",
"DatePicker": ".date_picker",
"ImageView": ".image_view",
"Label": ".label",
"ListView": ".list_view",
"MaterialActivityIndicatorView": ".material_activity_indicator_view",
"MaterialButton": ".material_button",
"MaterialDatePicker": ".material_date_picker",
"MaterialProgressView": ".material_progress_view",
"MaterialSearchBar": ".material_search_bar",
"MaterialSwitch": ".material_switch",
"MaterialTimePicker": ".material_time_picker",
"MaterialBottomNavigationView": ".material_bottom_navigation_view",
"MaterialToolbar": ".material_toolbar",
"Page": ".page",
"PickerView": ".picker_view",
"ProgressView": ".progress_view",
"ScrollView": ".scroll_view",
"SearchBar": ".search_bar",
"StackView": ".stack_view",
"Switch": ".switch",
"TextField": ".text_field",
"TextView": ".text_view",
"TimePicker": ".time_picker",
"WebView": ".web_view",
}
def __getattr__(name: str) -> Any:
module_path = _NAME_TO_MODULE.get(name)
if not module_path:
raise AttributeError(f"module 'pythonnative' has no attribute {name!r}")
module = import_module(module_path, package=__name__)
return getattr(module, name)
def __dir__() -> Any:
return sorted(list(globals().keys()) + __all__)