Auto discover binding modules

This commit is contained in:
Siu Kwan Lam 2013-01-28 15:18:24 -06:00
commit 4b5cb100f7

View file

@ -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()