Re-introduce 'subiquity' package for installer specific things.

Only move the Application object for now.
This commit is contained in:
Michael Hudson-Doyle 2016-07-25 12:51:39 +12:00
parent 173fdcb77f
commit e95daf25ba
6 changed files with 72 additions and 24 deletions

View File

@ -18,13 +18,15 @@ import argparse
import sys
import logging
import signal
from subiquitycore.log import setup_logger, LOGFILE
from subiquitycore import __version__ as VERSION
from subiquitycore.core import Application as Subiquity
from subiquitycore.core import ApplicationError
from subiquitycore.ui.frame import SubiquityUI
from subiquitycore.utils import environment_check
from subiquity.core import Subiquity
def parse_options(argv):
parser = argparse.ArgumentParser(

View File

@ -1 +1,2 @@
bin/subiquity-tui usr/share/subiquity
usr/share/subiquity/subiquity

View File

@ -0,0 +1,22 @@
# Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from subiquitycore.controllers.welcome import WelcomeController # NOQA
from subiquitycore.controllers.installpath import InstallpathController # NOQA
from subiquitycore.controllers.network import NetworkController # NOQA
from subiquitycore.controllers.filesystem import FilesystemController # NOQA
from subiquitycore.controllers.installprogress import InstallProgressController # NOQA
from subiquitycore.controllers.identity import IdentityController # NOQA
from subiquitycore.controllers.login import LoginController # NOQA

34
subiquity/core.py Normal file
View File

@ -0,0 +1,34 @@
# Copyright 2015 Canonical, Ltd.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import logging
from subiquitycore.core import Application
log = logging.getLogger('console_conf.core')
class Subiquity(Application):
project = "subiquity"
controllers = {
"Welcome": None,
"Installpath": None,
"Network": None,
"Filesystem": None,
"Identity": None,
"InstallProgress": None,
"Login": None,
}

View File

@ -12,11 +12,3 @@
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from .welcome import WelcomeController # NOQA
from .installpath import InstallpathController # NOQA
from .network import NetworkController # NOQA
from .filesystem import FilesystemController # NOQA
from .installprogress import InstallProgressController # NOQA
from .identity import IdentityController # NOQA
from .login import LoginController # NOQA

View File

@ -31,21 +31,18 @@ class ApplicationError(Exception):
class Application:
# TODO(mwhudson): This should be an abstract base class with one
# subclass for each of the installer and console-conf. Currently,
# this instance is the installer application and console-conf
# subclasses it.
project = "subiquitycore"
controllers = {
"Welcome": None,
"Installpath": None,
"Network": None,
"Filesystem": None,
"Identity": None,
"InstallProgress": None,
"Login": None,
}
# A concrete subclass must set project and controllers attributes, e.g.:
#
# project = "subiquity"
# controllers = {
# "Welcome": None,
# "Installpath": None,
# "Network": None,
# "Filesystem": None,
# "Identity": None,
# "InstallProgress": None,
# "Login": None,
# }
def __init__(self, ui, opts):
try: