From c7001bf0faa2531c335976725e11234e4b9a817f Mon Sep 17 00:00:00 2001 From: Pierre-Antoine Rouby <pierre-antoine.rouby@inrae.fr> Date: Tue, 23 Apr 2024 14:10:55 +0200 Subject: [PATCH] Network: Fix pep8. --- src/View/Network/GraphWidget.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/View/Network/GraphWidget.py b/src/View/Network/GraphWidget.py index 319a4f9e..2eb77ced 100644 --- a/src/View/Network/GraphWidget.py +++ b/src/View/Network/GraphWidget.py @@ -157,7 +157,7 @@ class EdgeItem(QGraphicsItem): def boundingRect(self): # Rectangle of edge for display update pen_width = 2.0 - extra = 0 #(pen_width + 5) / 2.0 + extra = 0 # (pen_width + 5) / 2.0 return self._bound_rect.normalized().adjusted( -extra, -extra, extra, extra @@ -167,7 +167,7 @@ class EdgeItem(QGraphicsItem): return self._arc def paint(self, painter, option, widget): - #self.paint_line(painter, option, widget) + # self.paint_line(painter, option, widget) self.paint_arc(painter, option, widget) @timer @@ -289,7 +289,7 @@ class EdgeItem(QGraphicsItem): bisector_ab = QLineF(line_ab.pointAt(0.5), line_ab.p2()) bisector_ab.setAngle(line_ab.normalVector().angle()) - center = QPointF(0,0) + center = QPointF(0, 0) bisector_ab.intersect(bisector_bc, center) circle = QRectF( @@ -339,7 +339,7 @@ class EdgeItem(QGraphicsItem): return p3 def paint_arrow(self, painter, option, widget, - color, center, angle): + color, center, angle): brush = QBrush() brush.setColor(color) brush.setStyle(Qt.SolidPattern) @@ -360,6 +360,7 @@ class EdgeItem(QGraphicsItem): painter.drawPolygon(poly) painter.fillPath(path, brush) + class NodeText(QGraphicsTextItem): def __init__(self, node_item): super(NodeText, self).__init__() @@ -520,12 +521,12 @@ class GraphWidget(QGraphicsView): ) # Multiple edges counter - if (n1,n2) not in multiple_edges: + if (n1, n2) not in multiple_edges: ind = 1 else: - ind = multiple_edges[(n1,n2)] + 1 + ind = multiple_edges[(n1, n2)] + 1 - multiple_edges[(n1,n2)] = ind + multiple_edges[(n1, n2)] = ind iedge = EdgeItem(n1, n2, edge, self) iedge._ind = ind -- GitLab