def initInterface(self, addon_paths=None): if self._intf: raise RuntimeError( "Second attempt to initialize the InstallInterface") if self.displayMode == 'g': from pyanaconda.ui.gui import GraphicalUserInterface # Run the GUI in non-fullscreen mode, so live installs can still # use the window manager self._intf = GraphicalUserInterface(self.storage, self.payload, self.instClass, gui_lock=self.gui_initialized, fullscreen=False) # needs to be refreshed now we know if gui or tui will take place addon_paths = addons.collect_addon_paths(constants.ADDON_PATHS, ui_subdir="gui") elif self.displayMode in ['t', 'c']: # text and command line are the same from pyanaconda.ui.tui import TextUserInterface self._intf = TextUserInterface(self.storage, self.payload, self.instClass) # needs to be refreshed now we know if gui or tui will take place addon_paths = addons.collect_addon_paths(constants.ADDON_PATHS, ui_subdir="tui") else: raise RuntimeError("Unsupported displayMode: %s" % self.displayMode) if addon_paths: self._intf.update_paths(addon_paths)
def initInterface(self): if self._intf: raise RuntimeError("Second attempt to initialize the InstallInterface") if self.gui_mode: from pyanaconda.ui.gui import GraphicalUserInterface # Run the GUI in non-fullscreen mode, so live installs can still # use the window manager self._intf = GraphicalUserInterface(None, self.payload, gui_lock=self.gui_initialized, fullscreen=False) # needs to be refreshed now we know if gui or tui will take place addon_paths = addons.collect_addon_paths(constants.ADDON_PATHS, ui_subdir="gui") elif self.tui_mode: # TUI and noninteractive TUI are the same in this regard from pyanaconda.ui.tui import TextUserInterface self._intf = TextUserInterface(None, self.payload) # needs to be refreshed now we know if gui or tui will take place addon_paths = addons.collect_addon_paths(constants.ADDON_PATHS, ui_subdir="tui") elif not self.display_mode: raise RuntimeError("Display mode not set.") else: # this should generally never happen, as display_mode now won't let # and invalid value to be set, but let's leave it here just in case # something ultra crazy happens raise RuntimeError("Unsupported display mode: %s" % self.display_mode) if addon_paths: self._intf.update_paths(addon_paths)
def tui_test(self, proxy_getter): # Create the interface. from pyanaconda.ui.tui import TextUserInterface self.interface = TextUserInterface(self.storage, self.payload) # Check the hubs from pyanaconda.ui.tui.hubs.summary import SummaryHub self.assertEqual(self.hubs, [SummaryHub]) # Check the actions classes. self.assertEqual(self._get_action_class_names(), [ "UnsupportedHardwareSpoke", "KernelWarningSpoke", "SummaryHub", "ProgressSpoke" ]) # Check the Summary hub. self.assertEqual( self._get_category_names(SummaryHub), { 'CustomizationCategory': [], 'LocalizationCategory': ['LangSpoke', 'TimeSpoke'], 'SoftwareCategory': ['SoftwareSpoke', 'SourceSpoke'], 'SystemCategory': ['NetworkSpoke', 'ShellSpoke', 'StorageSpoke'], 'UserSettingsCategory': ['PasswordSpoke', 'UserSpoke'] }) # Force us to always decide order of standalone spokes based on priority not by name. # This will ordering errors easier to spot. self._check_spokes_priority_uniqueness()
def initInterface(self): if self._intf: raise RuntimeError( "Second attempt to initialize the InstallInterface") # this boot option is meant to be temporary, so just check it directly # from kernel boot command line like this if "webui" in kernel_arguments: from pyanaconda.ui.webui import CockpitUserInterface self._intf = CockpitUserInterface( None, self.payload, "webui.remote" in kernel_arguments) # needs to be refreshed now we know if gui or tui will take place # FIXME - what about Cockpit based addons ? addon_paths = [] elif self.gui_mode: from pyanaconda.ui.gui import GraphicalUserInterface # Run the GUI in non-fullscreen mode, so live installs can still # use the window manager self._intf = GraphicalUserInterface(None, self.payload, gui_lock=self.gui_initialized, fullscreen=False) # needs to be refreshed now we know if gui or tui will take place addon_paths = collect_addon_ui_paths(ADDON_PATHS, "gui") elif self.tui_mode: # TUI and noninteractive TUI are the same in this regard from pyanaconda.ui.tui import TextUserInterface self._intf = TextUserInterface(None, self.payload) # needs to be refreshed now we know if gui or tui will take place addon_paths = collect_addon_ui_paths(ADDON_PATHS, "tui") elif not self.display_mode: raise RuntimeError("Display mode not set.") else: # this should generally never happen, as display_mode now won't let # and invalid value to be set, but let's leave it here just in case # something ultra crazy happens raise RuntimeError("Unsupported display mode: %s" % self.display_mode) if addon_paths: self._intf.update_paths(addon_paths)
def tui_test(self): # Create the interface. from pyanaconda.ui.tui import TextUserInterface self.interface = TextUserInterface(self.storage, self.payload) # Check the hubs from pyanaconda.ui.tui.hubs.summary import SummaryHub self.assertEqual(self.hubs, [SummaryHub]) # Check the actions classes. self.assertEqual(self._get_action_class_names(), [ "UnsupportedHardwareSpoke", "SummaryHub", "ProgressSpoke" ]) # Check the Summary hub. self.assertEqual(self._get_category_names(SummaryHub), { 'CustomizationCategory': [], 'LocalizationCategory': [ 'LangSpoke', 'TimeSpoke' ], 'SoftwareCategory': [ 'SoftwareSpoke', 'SourceSpoke' ], 'SystemCategory': [ 'NetworkSpoke', 'PartTypeSpoke', 'ShellSpoke', 'StorageSpoke' ], 'UserSettingsCategory': [ 'PasswordSpoke', 'UserSpoke' ] })
def test_tui(self, proxy_getter): # Create the interface. from pyanaconda.ui.tui import TextUserInterface self.interface = TextUserInterface(self.storage, self.payload) # Check the hubs from pyanaconda.ui.tui.hubs.summary import SummaryHub self._check_hubs([SummaryHub]) # Check the actions classes. self._check_actions([ "unsupported-hardware-warning", "kernel-warning", "installation-summary", "installation-progress", ]) # Check the Summary hub. self._check_categories( SummaryHub, { 'CustomizationCategory': [], 'LocalizationCategory': [ 'language-configuration', 'date-time-configuration', ], 'SoftwareCategory': [ 'software-selection', 'software-source-configuration', ], 'SystemCategory': [ 'network-configuration', 'storage-configuration', 'shell', ], 'UserSettingsCategory': [ 'root-configuration', 'user-configuration', ] }) # Check the screens. self._check_screens([ # Warnings "unsupported-hardware-warning", "kernel-warning", # Installation 'installation-summary', 'installation-progress', # Localization 'date-time-configuration', 'language-configuration', # Software 'software-selection', 'software-source-configuration', # System 'network-configuration', 'storage-configuration', 'shell', # User settings 'root-configuration', 'user-configuration', ]) # Run general checks on the user interface. self._check_interface()