]> granicus.if.org Git - graphviz/commitdiff
indicate "gv.ok(obj)" can be replaced by "obj" in languages that accept pointers...
authorellson <devnull@localhost>
Fri, 2 Nov 2007 17:11:20 +0000 (17:11 +0000)
committerellson <devnull@localhost>
Fri, 2 Nov 2007 17:11:20 +0000 (17:11 +0000)
tclpkg/gv/examples/layout.py

index 9c6a21ae3f018b560249e743a77e1546f253d4e2..8f836acd9dd36d27026a270047db410b541fd214 100755 (executable)
@@ -21,10 +21,11 @@ gv.render(G)
 
 # do something with the layout
 n = gv.firstnode(G)
-while gv.ok(n) :
+# while gv.ok(n) : << gv.ok() is not needed as python accepts pointers as boolean 
+while n :
     print 'node '+gv.nameof(n)+' is at '+gv.getv(n,'pos')
     e = gv.firstout(n)
-    while gv.ok(e) :
+    while e :
        print '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)