dr.botzo/modules/__init__.py

22 lines
385 B
Python

import os
import sys
import glob
import re
files = glob.glob(os.path.dirname(__file__)+"/*.py")
__all__ = []
initre = re.compile('__init__')
for i in files:
if initre.search(i):
continue
i = os.path.basename(i)
lastDot = i.rfind(".")
i = i[0:lastDot]
__all__.append(i)
__import__(i, locals(), globals(), ["*"])
__all__ = list(set(__all__))