Auto discover binding modules
This commit is contained in:
parent
c76096bbcb
commit
4b5cb100f7
1 changed files with 10 additions and 1 deletions
|
|
@ -1,2 +1,11 @@
|
|||
from . import Module
|
||||
import os.path, importlib
|
||||
|
||||
def _init():
|
||||
for fname in os.listdir(os.path.dirname(__file__)):
|
||||
if ((fname.endswith('.py') or fname.endswith('.pyc')) and
|
||||
not fname.startswith('__init__')):
|
||||
modname = os.path.basename(fname).rsplit('.', 1)[0]
|
||||
topname = __name__.rsplit('.', 1)[0]
|
||||
importlib.import_module('.' + modname, topname)
|
||||
|
||||
_init()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue