diff options
author | Chris Lumens <clumens@redhat.com> | 2011-11-17 14:27:45 -0500 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2011-11-21 13:35:55 -0500 |
commit | e6a44e122589c8dfc2ad816cb9ec14c1a21f7540 (patch) | |
tree | 18d376a6baf4b6e8ba86fdac220f47337fa2a256 /pyanaconda/ui/__init__.py | |
parent | 281f19135748181065168868526212dded1ab81b (diff) | |
download | anaconda-e6a44e122589c8dfc2ad816cb9ec14c1a21f7540.tar.gz anaconda-e6a44e122589c8dfc2ad816cb9ec14c1a21f7540.tar.xz anaconda-e6a44e122589c8dfc2ad816cb9ec14c1a21f7540.zip |
Define exactly which arguments Spokes, Hubs, andand UserInterfaces may count on.
For now, I'm just letting them get ksdata, devicetree, and instclass. More
may need to be defined later (packaging backend and networking, perhaps) but
the idea is to keep this list small and to have them be explicit in what they
need. Also, the anaconda object will never be a parameter. Don't even ask.
Diffstat (limited to 'pyanaconda/ui/__init__.py')
-rw-r--r-- | pyanaconda/ui/__init__.py | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/pyanaconda/ui/__init__.py b/pyanaconda/ui/__init__.py index 3d46efdb4..4e0244f29 100644 --- a/pyanaconda/ui/__init__.py +++ b/pyanaconda/ui/__init__.py @@ -24,11 +24,28 @@ class UserInterface(object): defines what kinds of dialogs and entry widgets every interface must provide that the rest of anaconda may rely upon. """ - def __init__(self): - """Create a new UserInterface instance.""" + def __init__(self, devicetree, instclass): + """Create a new UserInterface instance. + + The arguments this base class accepts defines the API that interfaces + have to work with. A UserInterface does not get free reign over + everything in the anaconda class, as that would be a big mess. + Instead, a UserInterface may count on the following: + + devicetree -- An instance of storage.devicetree.DeviceTree. This + is useful for determining what storage devices are + present and how they are configured. + instclass -- An instance of a BaseInstallClass subclass. This + is useful for determining distribution-specific + installation information like default package + selections and default partitioning. + """ if self.__class__ is UserInterface: raise TypeError("UserInterface is an abstract class.") + self.devicetree = devicetree + self.instclass = instclass + def setup(self, data): """Construct all the objects required to implement this interface. This method must be provided by all subclasses. |