2015-06-22 13:09:34 +00:00
|
|
|
# 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/>.
|
|
|
|
|
2015-06-23 17:09:26 +00:00
|
|
|
import logging
|
2016-07-26 02:20:10 +00:00
|
|
|
from subiquitycore.model import BaseModel
|
2015-06-22 13:09:34 +00:00
|
|
|
|
2015-08-10 13:42:19 +00:00
|
|
|
|
2016-06-30 18:17:01 +00:00
|
|
|
log = logging.getLogger("subiquitycore.models.installpath")
|
2015-06-23 17:09:26 +00:00
|
|
|
|
|
|
|
|
2016-07-26 02:20:10 +00:00
|
|
|
class InstallpathModel(BaseModel):
|
2015-07-21 15:55:02 +00:00
|
|
|
""" Model representing install options
|
2015-07-21 20:34:46 +00:00
|
|
|
|
|
|
|
List of install paths in the form of:
|
|
|
|
('UI Text seen by user', <signal name>, <callback function string>)
|
2015-07-21 15:55:02 +00:00
|
|
|
"""
|
2015-07-22 01:34:46 +00:00
|
|
|
signals = [
|
|
|
|
('Install Path View',
|
2015-10-29 20:58:51 +00:00
|
|
|
'menu:installpath:main',
|
2015-07-22 01:34:46 +00:00
|
|
|
'installpath')
|
|
|
|
]
|
2015-07-21 15:55:02 +00:00
|
|
|
|
2015-09-24 12:53:15 +00:00
|
|
|
# TODO: Re-enable once available
|
|
|
|
install_paths = [
|
|
|
|
('Install Ubuntu',
|
2015-10-29 20:58:51 +00:00
|
|
|
'installpath:install-ubuntu',
|
2015-09-24 12:53:15 +00:00
|
|
|
'install_ubuntu'),
|
|
|
|
# ('Install MAAS Region Server',
|
|
|
|
# 'installpath:maas-region-server',
|
|
|
|
# 'install_maas_region_server'),
|
|
|
|
# ('Install MAAS Cluster Server',
|
|
|
|
# 'installpath:maas-cluster-server',
|
|
|
|
# 'install_maas_cluster_server'),
|
|
|
|
# ('Test installation media',
|
|
|
|
# 'installpath:test-media',
|
|
|
|
# 'test_media'),
|
|
|
|
# ('Test machine memory',
|
|
|
|
# 'installpath:test-memory',
|
|
|
|
# 'test_memory')
|
|
|
|
]
|
2015-07-21 20:34:46 +00:00
|
|
|
|
|
|
|
def get_signal_by_name(self, selection):
|
2015-07-22 01:34:46 +00:00
|
|
|
for x, y, z in self.get_signals():
|
2015-07-21 20:34:46 +00:00
|
|
|
if x == selection:
|
|
|
|
return y
|
2015-07-21 15:55:02 +00:00
|
|
|
|
2015-07-22 01:34:46 +00:00
|
|
|
def get_signals(self):
|
|
|
|
return self.signals + self.install_paths
|
|
|
|
|
|
|
|
def get_menu(self):
|
|
|
|
return self.install_paths
|