diff options
author | Chris Lumens <clumens@redhat.com> | 2011-11-10 13:43:34 -0500 |
---|---|---|
committer | Chris Lumens <clumens@redhat.com> | 2011-11-10 15:50:46 -0500 |
commit | b8bbc02aa5f0d866245d17522712b142456c6a26 (patch) | |
tree | 4c80a32fd4657ef9557a946723f534c75a2a7b7e /pyanaconda/ui/__init__.py | |
parent | add0aeee51989fbe0b5d3e6c46ac645a3bd734ef (diff) | |
download | anaconda-b8bbc02aa5f0d866245d17522712b142456c6a26.tar.gz anaconda-b8bbc02aa5f0d866245d17522712b142456c6a26.tar.xz anaconda-b8bbc02aa5f0d866245d17522712b142456c6a26.zip |
Add the python portion of the new UI under pyanaconda/ui/.
Eventually, this will grow to contain a text UI and will ultimately replace
the old iw/ and textw/ directories. We're a long, long way from that though.
Diffstat (limited to 'pyanaconda/ui/__init__.py')
-rw-r--r-- | pyanaconda/ui/__init__.py | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/pyanaconda/ui/__init__.py b/pyanaconda/ui/__init__.py new file mode 100644 index 000000000..3d46efdb4 --- /dev/null +++ b/pyanaconda/ui/__init__.py @@ -0,0 +1,43 @@ +# Base classes for all user interfaces. +# +# Copyright (C) 2011 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, +# modify, copy, or redistribute it subject to the terms and conditions of +# the GNU General Public License v.2, or (at your option) any later version. +# This program is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY expressed or implied, including the implied warranties of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. You should have received a copy of the +# GNU General Public License along with this program; if not, write to the +# Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. Any Red Hat trademarks that are incorporated in the +# source code or documentation are not subject to the GNU General Public +# License and may only be used or replicated with the express permission of +# Red Hat, Inc. +# +# Red Hat Author(s): Chris Lumens <clumens@redhat.com> +# + +class UserInterface(object): + """This is the base class for all kinds of install UIs. It primarily + 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.""" + if self.__class__ is UserInterface: + raise TypeError("UserInterface is an abstract class.") + + def setup(self, data): + """Construct all the objects required to implement this interface. + This method must be provided by all subclasses. + """ + raise NotImplementedError + + def run(self): + """Run the interface. This should do little more than just pass + through to something else's run method, but is provided here in + case more is needed. This method must be provided by all subclasses. + """ + raise NotImplementedError |