]> granicus.if.org Git - python/commitdiff
nannified
authorGuido van Rossum <guido@python.org>
Mon, 14 Sep 1998 15:57:09 +0000 (15:57 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 14 Sep 1998 15:57:09 +0000 (15:57 +0000)
Tools/scripts/nm2def.py

index 120c106224c6109294d8ca01d8cf645aac7a4a51..188ab2e6edc6e22de8e6a9027d2551bcdc62c6c7 100755 (executable)
@@ -45,15 +45,15 @@ def symbols(lib=PYTHONLIB,types=('T','C','D')):
     lines = map(string.strip,lines)
     symbols = {}
     for line in lines:
-       if len(line) == 0 or ':' in line:
-           continue
-       items = string.split(line)
-       if len(items) != 3:
-           continue
-       address, type, name = items
-       if type not in types:
-           continue
-       symbols[name] = address,type
+        if len(line) == 0 or ':' in line:
+            continue
+        items = string.split(line)
+        if len(items) != 3:
+            continue
+        address, type, name = items
+        if type not in types:
+            continue
+        symbols[name] = address,type
     return symbols
 
 def export_list(symbols):
@@ -61,10 +61,10 @@ def export_list(symbols):
     data = []
     code = []
     for name,(addr,type) in symbols.items():
-       if type in ('C','D'):
-           data.append('\t'+name)
-       else:
-           code.append('\t'+name)
+        if type in ('C','D'):
+            data.append('\t'+name)
+        else:
+            code.append('\t'+name)
     data.sort()
     data.append('')
     code.sort()
@@ -84,10 +84,10 @@ SPECIALS = (
 def filter_Python(symbols,specials=SPECIALS):
 
     for name in symbols.keys():
-       if name[:2] == 'Py' or name[:3] == '_Py':
-           pass
-       elif name not in specials:
-           del symbols[name]
+        if name[:2] == 'Py' or name[:3] == '_Py':
+            pass
+        elif name not in specials:
+            del symbols[name]
 
 def main():