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:
+18
-9
@@ -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 *
|
||||
|
||||
Reference in New Issue
Block a user