]> granicus.if.org Git - graphviz/commitdiff
remove legacy use of addition to construct Python strings
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Sat, 3 Jul 2021 02:17:54 +0000 (19:17 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 9 Jul 2021 04:46:51 +0000 (21:46 -0700)
tclpkg/gv/examples/layout.py

index c6db1c6c762bf588522a9631974ef8fb9013a6b1..f5dd218051671b1a8abf96388b8cfd991c456808 100755 (executable)
@@ -15,10 +15,10 @@ def main():
   # do something with the layout
   n = gv.firstnode(G)
   while n:
-    print("node "+gv.nameof(n)+" is at "+gv.getv(n,"pos"))
+    print(f"node {gv.nameof(n)} is at {gv.getv(n, 'pos')}")
     e = gv.firstout(n)
     while e:
-      print("edge "+gv.nameof(gv.tailof(e))+"->"+gv.nameof(gv.headof(e))+" is at "+gv.getv(e,"pos"))
+      print(f"edge {gv.nameof(gv.tailof(e))}->{gv.nameof(gv.headof(e))} is at {gv.getv(e, 'pos')}")
       e = gv.nextout(n, e)
     n = gv.nextnode(G, n)