summaryrefslogtreecommitdiffstats
path: root/pyanaconda/ui
diff options
context:
space:
mode:
authorMartin Sivak <msivak@redhat.com>2013-02-12 11:12:38 +0100
committerVratislav Podzimek <vpodzime@redhat.com>2013-02-13 13:05:51 +0100
commit377e1e3e3c5a07a9e93e0691a5920695288ee7fa (patch)
tree2e69b9c8a553aa875f1a5c41082381f2f2aba23e /pyanaconda/ui
parent2b9a7579e64cd02e1a0defaf941d33a4bb5265f0 (diff)
downloadanaconda-377e1e3e3c5a07a9e93e0691a5920695288ee7fa.tar.gz
anaconda-377e1e3e3c5a07a9e93e0691a5920695288ee7fa.tar.xz
anaconda-377e1e3e3c5a07a9e93e0691a5920695288ee7fa.zip
Honor modules' __all__ when doing collect
Diffstat (limited to 'pyanaconda/ui')
-rw-r--r--pyanaconda/ui/common.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/pyanaconda/ui/common.py b/pyanaconda/ui/common.py
index b783f5eba..c94861ed0 100644
--- a/pyanaconda/ui/common.py
+++ b/pyanaconda/ui/common.py
@@ -541,7 +541,15 @@ def collect(module_pattern, path, pred):
p = lambda obj: inspect.isclass(obj) and pred(obj)
- for (name, val) in inspect.getmembers(module, p):
+ # if __all__ is defined in the module, use it
+ if not hasattr(module, "__all__"):
+ members = inspect.getmembers(module, p)
+ else:
+ members = [(name, getattr(module, name))
+ for name in module.__all__
+ if p(getattr(module, name))]
+
+ for (name, val) in members:
retval.append(val)
return retval