示例#1
0
def fromfile(fp, fname):
	actrules = ActRules()
	readcf.readcf(fp, fname, parseline, actrules.addact, BadAction)
	try:
		actrules.checkconsist()
	except BadAction, e:
		raise BadAction, "error loading %s: %s" % (fname, str(e))
示例#2
0
def fromfile(fp, fname):
	rules = RulesList()
	try:
		readcf.readcf(fp, fname, parseline, rules.addrule, BadInput)
	except BadInput:
		matchers.discardmemos()
		raise
	matchers.agememos()
	return rules
示例#3
0
def fromfile(fp, fname):
	cf = NannyConfig()
	readcf.readcf(fp, fname, cf.parseline, None, BadInput)
	cf.insurecomplete()
	return cf