Esempio n. 1
0
    def rule_subgraph_visualization(self, root_subject_type, product_type):
        root_type_id = TypeId(self._to_id(root_subject_type))

        product_type_id = TypeConstraint(
            self._to_key(constraint_for(product_type)))
        with temporary_file_path() as path:
            self._native.lib.rule_subgraph_visualize(self._scheduler,
                                                     root_type_id,
                                                     product_type_id,
                                                     bytes(path))
            with open(path) as fd:
                for line in fd.readlines():
                    yield line.rstrip()
Esempio n. 2
0
 def _to_constraint(self, type_or_constraint):
     return TypeConstraint(self._to_key(constraint_for(type_or_constraint)))