def loadMod(name): """Load the given mod from its XML file using a custom parser.""" path = SP.modDir + "\Assets\Config\%s.xml" % name if SP.isFile(path): print "BugInit - loading mod %s..." % name parser = BugConfig.ConfigParser() parser.parse(path) else: print "[ERR] BugInit.loadMod\n\tCannot find XML file:\n\t" + path
def loadMod(name): """Load the given mod from its XML file using a custom parser.""" path = BugPath.findAssetFile(name + ".xml", "Config") if path: BugUtil.debug("BugInit - loading mod %s...", name) parser = BugConfig.ConfigParser() timer = BugUtil.Timer("load mod") try: parser.parse(path) finally: timer.log(name) else: BugUtil.error("BugInit - cannot find XML file for mod %s", name)
def loadMod(name): """Load the given mod from its XML file using a custom parser.""" path = BugPath.findAssetFile(name + ".xml", "Config") if path: BugUtil.debug("BugInit - loading module %s...", name) parser = BugConfig.ConfigParser() timer = BugUtil.Timer("load mod") try: parser.parse(path) # <advc.009b> Say which module failed except Exception, e: BugUtil.error("BugInit - failed to parse module %s", name) timer.log(name) raise e # </advc.009b> timer.log(name)