1
0
mirror of https://github.com/chubin/cheat.sh.git synced 2026-06-20 21:26:44 +02:00

lib/adapter/__init__.py: load adapter modules dynamically

This commit is contained in:
Igor Chubin
2019-05-01 09:30:56 +02:00
parent cb7507686c
commit 22dfb74f72
+18 -9
View File
@@ -1,9 +1,18 @@
from . import cheat_sheets
from . import cmd
from . import internal
from . import latenz
from . import learnxiny
from . import question
from . import rosetta
from . import cheat_cheat
from . import tldr
"""
Import all adapters from the current directory
and make them available for import as
adapter_module.AdapterName
"""
# pylint: disable=wildcard-import,relative-import
from os.path import dirname, basename, isfile, join
import glob
__all__ = [
basename(f)[:-3]
for f in glob.glob(join(dirname(__file__), "*.py"))
if isfile(f) and not f.endswith('__init__.py')]
from adapter import all_adapters
from . import *