Revision 9943e0ec
b/scripts/tracetool/backend/__init__.py | ||
---|---|---|
37 | 37 |
__email__ = "stefanha@linux.vnet.ibm.com" |
38 | 38 |
|
39 | 39 |
|
40 |
import pkgutil
|
|
40 |
import os
|
|
41 | 41 |
|
42 | 42 |
import tracetool |
43 | 43 |
|
... | ... | |
45 | 45 |
def get_list(): |
46 | 46 |
"""Get a list of (name, description) pairs.""" |
47 | 47 |
res = [("nop", "Tracing disabled.")] |
48 |
for _, modname, _ in pkgutil.iter_modules(tracetool.backend.__path__): |
|
48 |
modnames = [] |
|
49 |
for filename in os.listdir(tracetool.backend.__path__[0]): |
|
50 |
if filename.endswith('.py') and filename != '__init__.py': |
|
51 |
modnames.append(filename.rsplit('.', 1)[0]) |
|
52 |
for modname in modnames: |
|
49 | 53 |
module = tracetool.try_import("tracetool.backend." + modname) |
50 | 54 |
|
51 | 55 |
# just in case; should never fail unless non-module files are put there |
b/scripts/tracetool/format/__init__.py | ||
---|---|---|
41 | 41 |
__email__ = "stefanha@linux.vnet.ibm.com" |
42 | 42 |
|
43 | 43 |
|
44 |
import pkgutil
|
|
44 |
import os
|
|
45 | 45 |
|
46 | 46 |
import tracetool |
47 | 47 |
|
... | ... | |
49 | 49 |
def get_list(): |
50 | 50 |
"""Get a list of (name, description) pairs.""" |
51 | 51 |
res = [] |
52 |
for _, modname, _ in pkgutil.iter_modules(tracetool.format.__path__): |
|
52 |
modnames = [] |
|
53 |
for filename in os.listdir(tracetool.format.__path__[0]): |
|
54 |
if filename.endswith('.py') and filename != '__init__.py': |
|
55 |
modnames.append(filename.rsplit('.', 1)[0]) |
|
56 |
for modname in modnames: |
|
53 | 57 |
module = tracetool.try_import("tracetool.format." + modname) |
54 | 58 |
|
55 | 59 |
# just in case; should never fail unless non-module files are put there |
Also available in: Unified diff