当前位置: 首页>>代码示例>>Python>>正文


Python RuleSet.get_rules_graph方法代码示例

本文整理汇总了Python中sequencer.dgm.model.RuleSet.get_rules_graph方法的典型用法代码示例。如果您正苦于以下问题:Python RuleSet.get_rules_graph方法的具体用法?Python RuleSet.get_rules_graph怎么用?Python RuleSet.get_rules_graph使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sequencer.dgm.model.RuleSet的用法示例。


在下文中一共展示了RuleSet.get_rules_graph方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_ruleset_field_empty

# 需要导入模块: from sequencer.dgm.model import RuleSet [as 别名]
# 或者: from sequencer.dgm.model.RuleSet import get_rules_graph [as 别名]
 def test_ruleset_field_empty(self):
     ruleset = RuleSet(set())
     self.assertTrue(ruleset.name is None)
     self.assertEquals(ruleset.rules, set())
     graph = ruleset.get_rules_graph()
     self.assertTrue(graph is not None)
     self.assertEquals(len(graph.edges()), 0)
     self.assertEquals(len(graph.nodes()), 0)
开发者ID:AdrienDebrie,项目名称:sequencer,代码行数:10,代码来源:testmodel_basic.py

示例2: test_ruleset_field_single

# 需要导入模块: from sequencer.dgm.model import RuleSet [as 别名]
# 或者: from sequencer.dgm.model.RuleSet import get_rules_graph [as 别名]
 def test_ruleset_field_single(self):
     rules = set()
     rules.add(tools.create_rule(self.__class__.__name__,
                                 "ruleset_field_single"))
     ruleset = RuleSet(rules)
     self.assertEquals(ruleset.name, self.__class__.__name__)
     self.assertEquals(ruleset.rules, rules)
     graph = ruleset.get_rules_graph()
     self.assertTrue(graph is not None)
     self.assertEquals(len(graph.edges()), 0)
     self.assertEquals(len(graph.nodes()), 1)
     self.assertTrue(graph.has_node("ruleset_field_single"))
开发者ID:AdrienDebrie,项目名称:sequencer,代码行数:14,代码来源:testmodel_basic.py

示例3: test_ruleset_dependencies

# 需要导入模块: from sequencer.dgm.model import RuleSet [as 别名]
# 或者: from sequencer.dgm.model.RuleSet import get_rules_graph [as 别名]
 def test_ruleset_dependencies(self):
     rules = set()
     rules.add(tools.create_rule(self.__class__.__name__,
                                 "ruleset_dependencies"))
     rules.add(tools.create_rule(self.__class__.__name__,
                                 "ruleset_dependencies2",
                                 dependson=["ruleset_dependencies"]))
     ruleset = RuleSet(rules)
     self.assertEquals(ruleset.name, self.__class__.__name__)
     self.assertEquals(ruleset.rules, rules)
     graph = ruleset.get_rules_graph()
     self.assertTrue(graph is not None)
     self.assertEquals(len(graph.edges()), 1)
     self.assertTrue(graph.has_edge(("ruleset_dependencies2",
                                     "ruleset_dependencies")))
开发者ID:AdrienDebrie,项目名称:sequencer,代码行数:17,代码来源:testmodel_basic.py

示例4: graphrules

# 需要导入模块: from sequencer.dgm.model import RuleSet [as 别名]
# 或者: from sequencer.dgm.model.RuleSet import get_rules_graph [as 别名]
def graphrules(db, config, args):
    """
    This action fetch the rules from the DB sequencer table and call
    the DGM stage for the computation of the related graph.
    This graph is then given to the user in the DOT format.
    """
    usage = "Usage: %prog [global_options] " + GRAPHRULES_ACTION_NAME + \
        " [action_options] ruleset"
    doc = GRAPHRULES_DOC + \
        " The graph is given in DOT format."
    parser = optparse.OptionParser(usage, description=doc)
    add_options_to(parser, ['--out'], config)
    (options, action_args) = parser.parse_args(args)
    if len(action_args) != 1:
        parser.error(GRAPHRULES_ACTION_NAME + ": ruleSet is missing.")

    req_ruleset = action_args[0]
    rules = db.get_rules_for(req_ruleset)
    ruleset = RuleSet(rules.values())
    write_graph_to(ruleset.get_rules_graph(), options.out)
开发者ID:af-bull,项目名称:sequencer,代码行数:22,代码来源:cli.py


注:本文中的sequencer.dgm.model.RuleSet.get_rules_graph方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。