__init__.py
1 # SPDX-FileCopyrightText: 2019 Damien P. George 2 # 3 # SPDX-License-Identifier: MIT 4 # 5 # MicroPython uasyncio module 6 # MIT license; Copyright (c) 2019 Damien P. George 7 # 8 # This code comes from MicroPython, and has not been run through black or pylint there. 9 # Altering these files significantly would make merging difficult, so we will not use 10 # pylint or black. 11 # pylint: skip-file 12 # fmt: off 13 14 from .core import * 15 16 __version__ = "0.0.0-auto.0" 17 __repo__ = "https://github.com/Adafruit/Adafruit_CircuitPython_asyncio.git" 18 19 _attrs = { 20 "wait_for": "funcs", 21 "wait_for_ms": "funcs", 22 "gather": "funcs", 23 "Event": "event", 24 "ThreadSafeFlag": "event", 25 "Lock": "lock", 26 "open_connection": "stream", 27 "start_server": "stream", 28 "StreamReader": "stream", 29 "StreamWriter": "stream", 30 } 31 32 # Lazy loader, effectively does: 33 # global attr 34 # from .mod import attr 35 def __getattr__(attr): 36 mod = _attrs.get(attr, None) 37 if mod is None: 38 raise AttributeError(attr) 39 value = getattr(__import__(mod, None, None, True, 1), attr) 40 globals()[attr] = value 41 return value