You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
709 B
30 lines
709 B
# MicroPython uasyncio module
|
|
# MIT license; Copyright (c) 2019 Damien P. George
|
|
|
|
from .core import *
|
|
|
|
__version__ = (3, 0, 0)
|
|
|
|
_attrs = {
|
|
"wait_for": "funcs",
|
|
"wait_for_ms": "funcs",
|
|
"gather": "funcs",
|
|
"Event": "event",
|
|
"ThreadSafeFlag": "event",
|
|
"Lock": "lock",
|
|
"open_connection": "stream",
|
|
"start_server": "stream",
|
|
"StreamReader": "stream",
|
|
"StreamWriter": "stream",
|
|
}
|
|
|
|
# Lazy loader, effectively does:
|
|
# global attr
|
|
# from .mod import attr
|
|
def __getattr__(attr):
|
|
mod = _attrs.get(attr, None)
|
|
if mod is None:
|
|
raise AttributeError(attr)
|
|
value = getattr(__import__(mod, None, None, True, 1), attr)
|
|
globals()[attr] = value
|
|
return value
|
|
|