Kaydet (Commit) a53f30ba authored tarafından Guido van Rossum's avatar Guido van Rossum

nannified

üst 4e96ec6a
...@@ -45,15 +45,15 @@ def symbols(lib=PYTHONLIB,types=('T','C','D')): ...@@ -45,15 +45,15 @@ def symbols(lib=PYTHONLIB,types=('T','C','D')):
lines = map(string.strip,lines) lines = map(string.strip,lines)
symbols = {} symbols = {}
for line in lines: for line in lines:
if len(line) == 0 or ':' in line: if len(line) == 0 or ':' in line:
continue continue
items = string.split(line) items = string.split(line)
if len(items) != 3: if len(items) != 3:
continue continue
address, type, name = items address, type, name = items
if type not in types: if type not in types:
continue continue
symbols[name] = address,type symbols[name] = address,type
return symbols return symbols
def export_list(symbols): def export_list(symbols):
...@@ -61,10 +61,10 @@ def export_list(symbols): ...@@ -61,10 +61,10 @@ def export_list(symbols):
data = [] data = []
code = [] code = []
for name,(addr,type) in symbols.items(): for name,(addr,type) in symbols.items():
if type in ('C','D'): if type in ('C','D'):
data.append('\t'+name) data.append('\t'+name)
else: else:
code.append('\t'+name) code.append('\t'+name)
data.sort() data.sort()
data.append('') data.append('')
code.sort() code.sort()
...@@ -84,10 +84,10 @@ SPECIALS = ( ...@@ -84,10 +84,10 @@ SPECIALS = (
def filter_Python(symbols,specials=SPECIALS): def filter_Python(symbols,specials=SPECIALS):
for name in symbols.keys(): for name in symbols.keys():
if name[:2] == 'Py' or name[:3] == '_Py': if name[:2] == 'Py' or name[:3] == '_Py':
pass pass
elif name not in specials: elif name not in specials:
del symbols[name] del symbols[name]
def main(): def main():
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment