Ported unused_functions to Python 3
This commit is contained in:
parent
ffc5edd3fe
commit
636f29b0b9
2 changed files with 11 additions and 13 deletions
|
@ -55,7 +55,7 @@
|
|||
### Miscellaneous and bug fixes
|
||||
* Fixed :droid's arguments not all being optional (Issue#4308)
|
||||
* Ported the "expand-terrain-macros", "wmlflip", "wmlparser", "umc-dev/build/update_version",
|
||||
"wiki_grabber" and "ai_test" tools to Python 3
|
||||
"wiki_grabber", "ai_test" and "unused_functions" tools to Python 3
|
||||
* It's now possible to chat with oneself in SP campaigns. Chat is shown in replays. (Issue#1111)
|
||||
* Removed unused "scoutDefault", "journeylifter", "wescamp_import" and "wmlvalidator" Python tools
|
||||
* Fixed wmlscope not correctly performing expansion of square braces in filenames in some conditions
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python3
|
||||
|
||||
"""
|
||||
This script is used to detect functions in the source code which are no longer
|
||||
|
@ -19,16 +19,13 @@ def nm(filename):
|
|||
return os.popen("nm -C %s" % filename).read()
|
||||
|
||||
output1 = []
|
||||
for o in glob.glob("src/*.o") + glob.glob("src/*/*.o") + \
|
||||
glob.glob("src/*/*/*.o") + glob.glob("src/*/*/*/*.o"):
|
||||
for o in glob.glob("build/release/*.o") + glob.glob("build/release/*/*.o") + \
|
||||
glob.glob("build/release/*/*/*.o") + glob.glob("build/release/*/*/*/*.o"):
|
||||
output1.append((o, nm(o)))
|
||||
|
||||
output2 = nm("src/wesnoth")
|
||||
output2 += nm("src/campaignd")
|
||||
output2 += nm("src/exploder")
|
||||
output2 += nm("src/cutter")
|
||||
output2 += nm("src/wesnothd")
|
||||
output2 += nm("src/test")
|
||||
output2 = nm("wesnoth")
|
||||
output2 += nm("campaignd")
|
||||
output2 += nm("wesnothd")
|
||||
|
||||
def extract(line):
|
||||
return line[line.find(" T ") + 3:]
|
||||
|
@ -47,6 +44,7 @@ for o in output1:
|
|||
found += [symbol]
|
||||
|
||||
if found:
|
||||
print "%s:" % o[0]
|
||||
print "\n".join(found)
|
||||
print
|
||||
print("%s:" % o[0])
|
||||
print("\n".join(found))
|
||||
print()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue