edge.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:python_gray_8_9_11_12 作者: 3xp10it 项目源码 文件源码
def render_edge_graphviz (self, graph):
        '''
        Render an edge suitable for use in a Pydot graph using the set internal attributes.

        @type  graph: pgraph.graph
        @param graph: Top level graph object containing the current edge

        @rtype:  pydot.Edge()
        @return: Pydot object representing edge
        '''

        import pydot

        # no need to validate if nodes exist for src/dst. graphviz takes care of that for us transparently.

        dot_edge = pydot.Edge(self.src, self.dst)

        if self.label:
            dot_edge.label = self.label

        dot_edge.color = "#%06x" % self.color

        return dot_edge


    ####################################################################################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号