blob: c6c5810d186d2e67433df984ae040516a3799870 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
#!/usr/bin/env python
# Copyright 2007 Nanorex, Inc. See LICENSE file for details.
"""
SymbolsInPackage.py
Reads a list of package names from stdin, and writes to stdout a
list of all of the symbols defined in that package in the same
format as FindPythonGlobals.py does.
"""
import sys
if (__name__ == '__main__'):
for line in sys.stdin:
package = line.strip()
try:
exec "import " + package
globalSymbols = eval("dir(%s)" % package)
for sym in globalSymbols:
if (not sym.startswith("_")):
print "%s: %s" % (sym, package)
except:
print >>sys.stderr, "Failed to process " + package
|