diff Tools/scripts/objgraph.py @ 29107:93c92f20b6bf legacy-trunk

Fix use of 'file' as a variable name. (I've tested the fixes, but please proofread anyway.)
author Andrew M. Kuchling <amk@amk.ca>
date Tue, 13 May 2003 18:14:25 +0000
parents 8a7a2f1f88f0
children 981fff7363b9
line wrap: on
line diff
--- a/Tools/scripts/objgraph.py	Tue May 13 18:01:19 2003 +0000
+++ b/Tools/scripts/objgraph.py	Tue May 13 18:14:25 2003 +0000
@@ -63,9 +63,9 @@
 # Read one input file and merge the data into the tables.
 # Argument is an open file.
 #
-def readinput(file):
+def readinput(fp):
     while 1:
-        s = file.readline()
+        s = fp.readline()
         if not s:
             break
         # If you get any output from this line,
@@ -88,9 +88,9 @@
 def printcallee():
     flist = file2undef.keys()
     flist.sort()
-    for file in flist:
-        print file + ':'
-        elist = file2undef[file]
+    for filename in flist:
+        print filename + ':'
+        elist = file2undef[filename]
         elist.sort()
         for ext in elist:
             if len(ext) >= 8:
@@ -107,38 +107,38 @@
 def printcaller():
     files = file2def.keys()
     files.sort()
-    for file in files:
+    for filename in files:
         callers = []
-        for label in file2def[file]:
+        for label in file2def[filename]:
             if undef2file.has_key(label):
                 callers = callers + undef2file[label]
         if callers:
             callers.sort()
-            print file + ':'
+            print filename + ':'
             lastfn = ''
             for fn in callers:
                 if fn <> lastfn:
                     print '\t' + fn
                 lastfn = fn
         else:
-            print file + ': unused'
+            print filename + ': unused'
 
-# Print undefine names and where they are used.
+# Print undefined names and where they are used.
 #
 def printundef():
     undefs = {}
-    for file in file2undef.keys():
-        for ext in file2undef[file]:
+    for filename in file2undef.keys():
+        for ext in file2undef[filename]:
             if not def2file.has_key(ext):
-                store(undefs, ext, file)
+                store(undefs, ext, filename)
     elist = undefs.keys()
     elist.sort()
     for ext in elist:
         print ext + ':'
         flist = undefs[ext]
         flist.sort()
-        for file in flist:
-            print '\t' + file
+        for filename in flist:
+            print '\t' + filename
 
 # Print warning messages about names defined in more than one file.
 #
@@ -181,11 +181,11 @@
         optu = optc = optd = 1
     if not args:
         args = ['-']
-    for file in args:
-        if file == '-':
+    for filename in args:
+        if filename == '-':
             readinput(sys.stdin)
         else:
-            readinput(open(file, 'r'))
+            readinput(open(filename, 'r'))
     #
     warndups()
     #