Created
August 10, 2014 01:21
-
-
Save geekjam/b177135c5c043e5d5f90 to your computer and use it in GitHub Desktop.
__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import sys | |
import time | |
from Core import * | |
s = os.sep | |
def ModInit(): | |
global Core | |
Core.Modules = [] | |
for f in os.listdir('Mod'): | |
if os.path.isfile('Mod' + s + f): | |
fname = os.path.splitext(f) | |
if fname[1] == '.py' and fname[0] != '__init__' and fname[0] != 'Core': | |
__import__('Mod.'+fname[0]) | |
#print '[-]Load Mod.' + fname[0] | |
if fname[0] != "Controller": | |
Core.Modules.append(fname[0]) | |
exec 'Core.' + fname[0] + "=" + fname[0] | |
Core.Modules.append("Controller") | |
for m in Core.Modules: | |
exec 'Core.' + m + '.Init()' | |
ModInit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment