Skip to content

Instantly share code, notes, and snippets.

@geekjam
Created August 10, 2014 01:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geekjam/b177135c5c043e5d5f90 to your computer and use it in GitHub Desktop.
Save geekjam/b177135c5c043e5d5f90 to your computer and use it in GitHub Desktop.
__init__.py
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