Created
August 10, 2014 01:24
-
-
Save geekjam/2a6083115ecae79f871a 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