mirror of
https://github.com/python/cpython.git
synced 2025-10-14 18:59:46 +00:00
nannified
This commit is contained in:
parent
4e96ec6a4e
commit
a53f30babc
1 changed files with 17 additions and 17 deletions
|
@ -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):
|
||||||
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 = (
|
||||||
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():
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue