Update Python build scripts to use the print function

In Python 3, 'print' was changed from a statement to a function.  Using
the __future__ module allows scripts to use print function whether
running with Python 2.6+ or Python 3.x.  This commit changes as many
instances of print as I could find to use the print function and the
__future__ module.
This commit is contained in:
Alex Chan
2015-12-18 13:26:51 +00:00
parent faba6e56b7
commit ce7ce98a01
20 changed files with 135 additions and 93 deletions

View File

@@ -22,6 +22,8 @@
# && open /tmp/protocols.svg
#===----------------------------------------------------------------------===#
from __future__ import print_function
import re
import sys
import os
@@ -139,17 +141,17 @@ clusterEdges = set(
for s in elements
for t in graph[s] if t in elements)
print 'digraph ProtocolHierarchies {'
print ' mclimit = 100; ranksep=1.5; ' # ; packmode="array1"
print ' edge [dir="back"];'
print ' node [shape = box, fontname = Helvetica, fontsize = 10];'
print('digraph ProtocolHierarchies {')
print(' mclimit = 100; ranksep=1.5; ') # ; packmode="array1"
print(' edge [dir="back"];')
print(' node [shape = box, fontname = Helvetica, fontsize = 10];')
for c in sorted(clusters):
print ' subgraph "cluster_%s" {' % c
print(' subgraph "cluster_%s" {' % c)
for (s, t) in sorted(clusterEdges):
if s in clusters[c]:
print '%s -> %s [weight=100];' % (s, t)
print '}'
print('%s -> %s [weight=100];' % (s, t))
print('}')
for node in sorted(graph.keys()):
requirements = body.get(node, [])
@@ -164,12 +166,12 @@ for node in sorted(graph.keys()):
divider,
'\n'.join('<TR><TD>%s</TD></TR>' % g for g in generics)))
print interpolate(' %(node)s [style = %(style)s, label=<%(label)s>]')
print(interpolate(' %(node)s [style = %(style)s, label=<%(label)s>]'))
for (parent, children) in sorted(graph.items()):
print ' %s -> {' % parent,
print '; '.join(
sorted(child for child in children if not (parent, child) in clusterEdges)),
print '}'
print(' %s -> {' % parent, end=' ')
print('; '.join(
sorted(child for child in children if not (parent, child) in clusterEdges)), end=' ')
print('}')
print '}'
print('}')