#!/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 = "mudpy.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()