Exemplo n.º 1
0
    def getNodeItemForNode(self, node):
        """
        returns a pyqt NodeItem object, or None in case of error or invisible style
        """
        # let pydot imitate pygraphviz api
        attr = {}
        for name in node.get_attributes().keys():
            value = get_unquoted(node, name)
            attr[name] = value
        obj_dic = node.__getattribute__("obj_dict")
        for name in obj_dic:
            if name not in ['attributes', 'parent_graph'
                            ] and obj_dic[name] is not None:
                attr[name] = get_unquoted(obj_dic, name)
        node.attr = attr

        if node.attr.get('style') == 'invis':
            return None

        print(attr)

        return attr
 def test_unquoted(self):
     self.assertEqual('foo', get_unquoted({'bar': 'foo'}, 'bar'))
Exemplo n.º 3
0
 def test_unquoted(self):
     self.assertEqual("foo", get_unquoted({'bar': 'foo'}, 'bar'))