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))
def fromfile(fp, fname): rules = RulesList() try: readcf.readcf(fp, fname, parseline, rules.addrule, BadInput) except BadInput: matchers.discardmemos() raise matchers.agememos() return rules
def fromfile(fp, fname): cf = NannyConfig() readcf.readcf(fp, fname, cf.parseline, None, BadInput) cf.insurecomplete() return cf