summaryrefslogtreecommitdiffstats
path: root/pyanaconda/ui/__init__.py
diff options
context:
space:
mode:
authorMartin Sivak <msivak@redhat.com>2012-07-31 14:27:35 +0200
committerMartin Sivak <msivak@redhat.com>2012-08-06 13:32:21 +0200
commit1ddd40a0a01c5cffe519382cf5a9429bcedab7e0 (patch)
tree61cd353c623732e57e137734ca7323443c93105f /pyanaconda/ui/__init__.py
parentbd1979fb922bfeda015d0874065746c9e237fc6e (diff)
downloadanaconda-1ddd40a0a01c5cffe519382cf5a9429bcedab7e0.tar.gz
anaconda-1ddd40a0a01c5cffe519382cf5a9429bcedab7e0.tar.xz
anaconda-1ddd40a0a01c5cffe519382cf5a9429bcedab7e0.zip
Fix bits and pieces to make TUI hub and spoke model work + example Hub and Password spoke
Diffstat (limited to 'pyanaconda/ui/__init__.py')
-rw-r--r--pyanaconda/ui/__init__.py25
1 files changed, 1 insertions, 24 deletions
diff --git a/pyanaconda/ui/__init__.py b/pyanaconda/ui/__init__.py
index fcc66289f..91252c1b5 100644
--- a/pyanaconda/ui/__init__.py
+++ b/pyanaconda/ui/__init__.py
@@ -22,8 +22,7 @@
__all__ = ["UserInterface", "collect"]
import os
-import importlib
-import inspect
+from common import collect
class UserInterface(object):
"""This is the base class for all kinds of install UIs. It primarily
@@ -112,25 +111,3 @@ class UserInterface(object):
key=lambda obj: obj.priority))
return actionClasses
-
-def collect(module_pattern, path, pred):
- """Traverse the directory (given by path) and find all classes that match
- the given predicate. This is then returned as a list of classes.
-
- It is suggested you use collect_categories or collect_spokes instead of
- this lower-level method.
- """
- retval = []
- for module_file in os.listdir(path):
- if not module_file.endswith(".py") or module_file == "__init__.py":
- continue
-
- mod_name = module_file[:-3]
- module = importlib.import_module(module_pattern % mod_name)
-
- p = lambda obj: inspect.isclass(obj) and pred(obj)
-
- for (name, val) in inspect.getmembers(module, p):
- retval.append(val)
-
- return retval