def SaveRuleEdit(project_name, rule_name, add, vClsIn, vDefUnit, vPosUnit, pragVar, ruleType, ruleMech, wl_look_head, wl_look_stub, wl_look_super, wl_look_data): global currentWhiteList global currentBlackList rule_path = "Projects/" + project_name + "/" + vClsIn.get().replace( '\n', '') + "/" + rule_name FileManipulationHelper.CreateFoderIfNotExist(rule_path) vRuleType = StringVar() vLexSemRule = StringVar() vRuleType.set(ruleType) vLexSemRule.set(ruleMech) FileManipulationHelper.MakeRuleCFGFile(rule_path, vClsIn, vDefUnit, vPosUnit, pragVar, vRuleType, vLexSemRule, wl_look_head, wl_look_stub, wl_look_super, wl_look_data) add.withdraw()
def SaveRule(project_name, rule_name, add, vClsIn, vDefUnit, vPosUnit, pragVar, RulesListBox, vRuleType, vLexSemRule, wl_look_head, wl_look_stub, wl_look_super, wl_look_data): global currentWhiteList global currentBlackList rule_path = "Projects/" + project_name + "/" + vClsIn.get( ) + "/" + rule_name FileManipulationHelper.CreateFoderIfNotExist(rule_path) #FileManipulationHelper.SaveWhiteList(rule_path, currentWhiteList) #FileManipulationHelper.SaveBlackList(rule_path, currentBlackList) FileManipulationHelper.MakeRuleCFGFile(rule_path, vClsIn, vDefUnit, vPosUnit, pragVar, vRuleType, vLexSemRule, wl_look_head, wl_look_stub, wl_look_super, wl_look_data) RulesListBox.insert(vClsIn.get(), 'end', text=rule_name) add.withdraw() if (vLexSemRule.get() == "Lexical"): WhiteListWindow(project_name, rule_name, vClsIn) if (vLexSemRule.get() == "Semantic"): SemanticListWindow(project_name, rule_name, vClsIn)