X-Git-Url: https://mudpy.org/gitweb?a=blobdiff_plain;f=muff;fp=muff;h=57874d46cc58ab9a0a76f197856973b4677876f5;hb=0f39af78818acbbee0b99145ff5ff303553027c6;hp=0000000000000000000000000000000000000000;hpb=d49d19d943672b3cea1b2e43802f4b5eca6c81b5;p=mudpy.git diff --git a/muff b/muff new file mode 100755 index 0000000..57874d4 --- /dev/null +++ b/muff @@ -0,0 +1,36 @@ +#!/usr/bin/python +"""Skeletal executable for the MUFF Engine""" + +# Copyright (c) 2005 mudpy, Jeremy Stanley , all rights reserved. +# Licensed per terms in the LICENSE file distributed with this software. + +# muff uses the ini-style configs supported by the ConfigParser module +import ConfigParser + +# need the sys module to alter the import path appropriately +import sys + +def get_main_loop(): + """Find and return the main loop function""" + + # figure out where to find our main configuration file + config_data = ConfigParser.SafeConfigParser() + config_dirs = [".", "./etc", "/usr/local/muff", "/usr/local/muff/etc", "/etc/muff", "/etc" ] + config_name = "muff.conf" + config_files = [] + for each_dir in config_dirs: + config_files.append(each_dir + "/" + config_name) + + # load the config file, get the module path and add it to sys.path + config_data.read(config_files) + module_path = config_data.get("files", "modules") + sys.path.append(module_path) + + # import the main loop function + from muff.muffmain import main + return main + +# load the main loop and run it +main = get_main_loop() +main() +