# pyanaconda.ui.gui package — Anaconda 25.14 documentation

# pyanaconda.ui.gui package

## Subpackages

- pyanaconda.ui.gui.hubs package
  - Submodules
  - pyanaconda.ui.gui.hubs.progress module
  - pyanaconda.ui.gui.hubs.summary module
  - Module contents
- pyanaconda.ui.gui.spokes package
  - Subpackages
    - pyanaconda.ui.gui.spokes.advstorage package
      - Submodules
      - pyanaconda.ui.gui.spokes.advstorage.dasd module
      - pyanaconda.ui.gui.spokes.advstorage.fcoe module
      - pyanaconda.ui.gui.spokes.advstorage.iscsi module
      - pyanaconda.ui.gui.spokes.advstorage.zfcp module
      - Module contents
    - pyanaconda.ui.gui.spokes.lib package
      - Submodules
      - pyanaconda.ui.gui.spokes.lib.accordion module
      - pyanaconda.ui.gui.spokes.lib.cart module
      - pyanaconda.ui.gui.spokes.lib.custom_storage_helpers module
      - pyanaconda.ui.gui.spokes.lib.dasdfmt module
      - pyanaconda.ui.gui.spokes.lib.detailederror module
      - pyanaconda.ui.gui.spokes.lib.entropy_dialog module
      - pyanaconda.ui.gui.spokes.lib.lang_locale_handler module
      - pyanaconda.ui.gui.spokes.lib.passphrase module
      - pyanaconda.ui.gui.spokes.lib.refresh module
      - pyanaconda.ui.gui.spokes.lib.resize module
      - pyanaconda.ui.gui.spokes.lib.summary module
      - Module contents
  - Submodules
  - pyanaconda.ui.gui.spokes.custom module
  - pyanaconda.ui.gui.spokes.datetime_spoke module
  - pyanaconda.ui.gui.spokes.filter module
  - pyanaconda.ui.gui.spokes.keyboard module
  - pyanaconda.ui.gui.spokes.langsupport module
  - pyanaconda.ui.gui.spokes.network module
  - pyanaconda.ui.gui.spokes.password module
  - pyanaconda.ui.gui.spokes.software module
  - pyanaconda.ui.gui.spokes.source module
  - pyanaconda.ui.gui.spokes.storage module
  - pyanaconda.ui.gui.spokes.user module
  - pyanaconda.ui.gui.spokes.welcome module
  - Module contents

## Submodules

## pyanaconda.ui.gui.helpers module

class `pyanaconda.ui.gui.helpers.``GUIDialogInputCheckHandler`(ok_button=None)

  Bases: `pyanaconda.ui.gui.helpers.GUIInputCheckHandler`

  Provide InputCheckHandler functionality for Gtk dialogs.

  If an OK button is provided in the constructor, this class will handle setting the sensitivity of the button to match the input check result. A method on_ok_clicked is provided to determine whether the dialog can be exited, similar to on_back_clicked for spokes.

  It’s not possible (or at least not easy) to prent a GtkDialog from returning a response, so the caller of gtk_dialog_run needs to check whether the input is valid and decide based on that whether to destroy the dialog or call gtk_dialog_run again.

  `on_ok_clicked`()

    Return whether the input validation checks allow the dialog to be exited.

    Unlike GUISpokeInputCheckHandler.on_back_clicked, it is not expected that subclasses will implement this method.

  `set_status`(inputcheck)

class `pyanaconda.ui.gui.helpers.``GUIInputCheck`(parent, input_obj, run_check, data=None)

  Bases: `pyanaconda.ui.helpers.InputCheck`

  Add timer awareness to an InputCheck.

  Add a delay before running the validation function so that the function is not run for every keystroke. Run any pending actions before returning a status.

  `check_status`

class `pyanaconda.ui.gui.helpers.``GUIInputCheckHandler`

  Bases: `pyanaconda.ui.helpers.InputCheckHandler`

  Provide InputCheckHandler functionality for Gtk input screens.

  This class assumes that all input objects are of type GtkEditable and attaches InputCheck.update_check_status to the changed signal.

  `add_check`(input_obj, run_check, data=None)
  `get_input`(input_obj)

class `pyanaconda.ui.gui.helpers.``GUISpokeInputCheckHandler`

  Bases: `pyanaconda.ui.gui.helpers.GUIInputCheckHandler`

  Provide InputCheckHandler functionality for graphical spokes.

  This class implements set_status to set a message in the warning area of the spoke window and provides an implementation of on_back_clicked to prevent the user from exiting a spoke with bad input.

  `clear_info`()
  `on_back_clicked`(window)

    Check whether the input validation checks allow the spoke to be exited.

    Unlike NormalSpoke.on_back_clicked, this function returns a boolean value. Classes implementing this class should run GUISpokeInputCheckHandler.on_back_clicked, and if it succeeded, run NormalSpoke.on_back_clicked.

  `set_status`(inputcheck)

    Update the warning with the input validation error from the first error message.

  `set_warning`(msg)
  `window`

## pyanaconda.ui.gui.utils module

class `pyanaconda.ui.gui.utils.``GtkActionList`

  Bases: `object`

  Class for scheduling Gtk actions to be all run at once.

  `add_action`(func, *args)

    Add Gtk action to be run later.

  `fire`()

    Run all scheduled Gtk actions.

`pyanaconda.ui.gui.utils.``blockedHandler`(obj, func)

  Prevent a GLib signal handling function from being called during some block of code.

`pyanaconda.ui.gui.utils.``busyCursor`()

`pyanaconda.ui.gui.utils.``escape_markup`(value)

  Escape strings for use within Pango markup.

  This function converts the value to a string before passing markup_escape_text().

`pyanaconda.ui.gui.utils.``fancy_set_sensitive`(widget, value)

  Set the sensitivity of a widget, and then set the sensitivity of all widgets it is a mnemonic widget for. This has the effect of marking both an entry and its label as sensitive/insensitive, for instance.

`pyanaconda.ui.gui.utils.``find_first_child`(parent, match_func)

  Find the first child widget of a container matching the given function.

  This method performs a breadth-first search for the widget. match_func takes the widget as a paramter, and the return value will be evaulated as a bool.

  Parameters:

  - parent (GtkContainer) – the container to search
  - match_func (function) – The function defining the condition to match

  Returns: | The first matching widget
  Return type: | GtkWidget or None

`pyanaconda.ui.gui.utils.``fire_gtk_action`(func, *args)

  Run some Gtk action in the main thread and wait for it.

`pyanaconda.ui.gui.utils.``gtk_action_nowait`(func)

  Decorator method which ensures every call of the decorated function to be executed in the context of Gtk main loop even if called from a non-main thread. The new method does not wait for the callback to finish.

`pyanaconda.ui.gui.utils.``gtk_action_wait`(func)

  Decorator method which ensures every call of the decorated function to be executed in the context of Gtk main loop even if called from a non-main thread and returns the ret value after the decorated method finishes.

`pyanaconda.ui.gui.utils.``gtk_batch_map`(action, items, args=(), pre_func=None, batch_size=1)

  Function that maps an action on items in a way that makes the action run in the main thread, but without blocking the main thread for a noticeable time. If a pre-processing function is given it is mapped on the items first before the action happens in the main thread.

  Danger

  MUST NOT BE CALLED NOR WAITED FOR FROM THE MAIN THREAD.

  Parameters:

  - action ((action_item, *args) -> None) – any action that has to be done on the items in the main thread
  - items (iterable) – an iterable of items that the action should be mapped on
  - args (tuple) – additional arguments passed to the action function
  - pre_func (item -> action_item) – a function that is mapped on the items before they are passed to the action function
  - batch_size – how many items should be processed in one run in the main loop

  Raises AssertionError:
  | if called from the main thread
  Returns: | None

`pyanaconda.ui.gui.utils.``gtk_call_once`(func, *args)

  Wrapper for GLib.idle_add call that ensures the func is called only once.

`pyanaconda.ui.gui.utils.``ignoreEscape`(dlg)

  Prevent a dialog from accepting the escape keybinding, which emits a close signal and will cause the dialog to close with some return value we are likely not expecting. Instead, this method will cause the escape key to do nothing for the given GtkDialog.

`pyanaconda.ui.gui.utils.``override_cell_property`(tree_column, cell_renderer, propname, property_func, data=None)

  Override a single property of a cell renderer.

  property_func takes the same arguments as GtkTreeCellDataFunc: (TreeViewColumn, CellRenderer, TreeModel, TreeIter, data). Instead of being expected to manipulate the CellRenderer itself, this method should instead return the value to which the property should be set.

  This method calls set_cell_data_func on the column and renderer.

  Parameters:

  - column (GtkTreeViewColumn) – the column to override
  - cell_renderer (GtkCellRenderer) – the cell renderer to override
  - propname (str) – the property to set on the renderer
  - property_func (function) – a function that returns the value of the property to set
  - data – Optional data to pass to property_func

`pyanaconda.ui.gui.utils.``really_hide`(widget)

  Some widgets need to be both hidden, and have no_show_all set on them to prevent them from being shown later when the screen is redrawn. This method takes care of that.

`pyanaconda.ui.gui.utils.``really_show`(widget)

  Some widgets need to have no_show_all unset before they can also be shown, so they are displayed later when the screen is redrawn. This method takes care of that.

`pyanaconda.ui.gui.utils.``setViewportBackground`(vp, color='@theme_bg_color')

  Set the background color of the GtkViewport vp to be the same as the overall UI background. This should not be called for every viewport, as that will affect things like TreeViews as well.

`pyanaconda.ui.gui.utils.``set_treeview_selection`(treeview, item, col=0)

  Select the given item in the given treeview and scroll to it.

  Parameters:

  - treeview (GtkTreeView) – treeview to select and item in
  - item (str) – item to be selected
  - col (int) – column to search for the item in

  Returns: | selected iterator or None if item was not found
  Return type: | GtkTreeIter or None

`pyanaconda.ui.gui.utils.``setup_gtk_direction`()

  Set the right direction (RTL/LTR) of the Gtk widget’s and their layout based on the current language configuration.

`pyanaconda.ui.gui.utils.``timed_action`(delay=300, threshold=750, busy_cursor=True)

  Function returning decorator for decorating often repeated actions that need to happen in the main loop (entry/slider change callbacks, typically), but that may take a long time causing the GUI freeze for a noticeable time.

  The return value of the decorator function returned by this function–i.e., the value of timed_action()(function_to_be_decorated)–is an instance of the TimedAction class, which besides being callable provides a run_now method to shortcut the timer and run the action immediately. run_now will also be run in the main loop.

  If timed_action is used to decorate a method of a class, the decorated method will actually be a functools.partial instance. In this case, the TimedAction instance is accessible as the “func” property of the decorated method. Note that the func property will not have self applied.

  Parameters:

  - delay (int) – number of milliseconds to wait for another invocation of the decorated function before it is actually called
  - threshold (int) – upper bound (in milliseconds) to wait for the decorated function to be called from the first/last time
  - busy_cursor (bool) – whether the cursor should be made busy or not in the meantime of the decorated function being invocated from outside and it actually being called

`pyanaconda.ui.gui.utils.``unbusyCursor`()

`pyanaconda.ui.gui.utils.``unwatch_children`(widget, callback, user_data=None)

  Unregister a callback previously added with watch_children.

  Parameters:

  - widget (GtkWidget) – the widget to unwatch
  - callback (function) – the callback that was previously added to the widget
  - user_data – the user_data that was previously added to the widget

`pyanaconda.ui.gui.utils.``watch_children`(widget, callback, user_data=None)

  Call callback on widget and all children of widget as they are added.

  Callback is a function that takes widget and user_data as arguments. No return value is expected.

  Callback will be called immediately for widget, and, if widget is a GtkContainer, for all children of widget. If widget is a container it will be then be watched for new widgets added to the container, and callback will be called on the new children as they are added.

  Parameters:

  - widget (GtkWidget) – the widget to watch
  - callback (function) – the callback function
  - user_data – optional user_data to pass to callback

## pyanaconda.ui.gui.xkl_wrapper module

This module include functions and classes for dealing with multiple layouts in Anaconda. It wraps the libxklavier functionality to protect Anaconda from dealing with its “nice” API that looks like a Lisp-influenced “good old C” and also systemd-localed functionality.

It provides a XklWrapper class with several methods that can be used for listing and various modifications of keyboard layouts settings.

class `pyanaconda.ui.gui.xkl_wrapper.``LayoutInfo`(lang, desc)

  Bases: `tuple`

  `desc`

    Alias for field number 1

  `lang`

    Alias for field number 0

`pyanaconda.ui.gui.xkl_wrapper.``Xkb_`(x)

class `pyanaconda.ui.gui.xkl_wrapper.``XklWrapper`

  Bases: `object`

  Class wrapping the libxklavier functionality

  Use this class as a singleton class because it provides read-only data and initialization (that takes quite a lot of time) reads always the same data. It doesn’t have sense to make multiple instances

  `activate_default_layout`(*args, **kwargs)

    The new body for the decorated method. If needed, it uses closure bound queue_instance variable which is valid until the reference to this method is destroyed.

  `add_layout`(*args, **kwargs)

    The new body for the decorated method. If needed, it uses closure bound queue_instance variable which is valid until the reference to this method is destroyed.

  `get_available_layouts`()

    A list of layouts

  `get_current_layout`()

    Get current activated X layout and variant

    Returns: | current activated X layout and variant (e.g. “cz (qwerty)”)

  static `get_instance`()
  `get_layout_variant_description`(layout_variant, with_lang=True, xlated=True)

    Get description of the given layout-variant.

    Parameters:

    - layout_variant (str) – layout-variant specification (e.g. ‘cz (qwerty)’)
    - with_lang (bool) – whether to include language of the layout-variant (if defined) in the description or not
    - xlated (bool) – whethe to return translated or english version of the description

    Returns: | description of the layout-variant specification (e.g. ‘Czech (qwerty)’)
    Return type: | str

  `get_switch_opt_description`(switch_opt)

    Get description of the given layout switching option.

    Parameters: | switch_opt (str) – switching option name/ID (e.g. ‘grp:alt_shift_toggle’)
    Returns: | description of the layout switching option (e.g. ‘Alt + Shift’)
    Return type: | str

  `get_switching_options`()

    Method returning list of available layout switching options

  `is_valid_layout`(layout)

    Return if given layout is valid layout or not

  `remove_layout`(*args, **kwargs)

    The new body for the decorated method. If needed, it uses closure bound queue_instance variable which is valid until the reference to this method is destroyed.

  `replace_layouts`(*args, **kwargs)

    The new body for the decorated method. If needed, it uses closure bound queue_instance variable which is valid until the reference to this method is destroyed.

  `set_switching_options`(*args, **kwargs)

    The new body for the decorated method. If needed, it uses closure bound queue_instance variable which is valid until the reference to this method is destroyed.

exception `pyanaconda.ui.gui.xkl_wrapper.``XklWrapperError`

  Bases: `pyanaconda.keyboard.KeyboardConfigError`

  Exception class for reporting libxklavier-related problems

`pyanaconda.ui.gui.xkl_wrapper.``iso_`(x)

## Module contents

class `pyanaconda.ui.gui.``GraphicalUserInterface`(storage, payload, instclass, distributionText=<function distributionText>, isFinal=False, quitDialog=<class 'pyanaconda.ui.gui.QuitDialog'>, gui_lock=None, fullscreen=False)

  Bases: `pyanaconda.ui.UserInterface`

  This is the standard GTK+ interface we try to steer everything to using. It is suitable for use both directly and via VNC.

  `basemask` = 'pyanaconda.ui'
  `basepath` = '/builddir/anaconda/pyanaconda/ui'
  `getActionClasses`(hubs)

    Grab all relevant standalone spokes, add them to the passed list of hubs and order the list according to the relationships between hubs and standalones.

  `meh_interface`
  `path` = '/tmp/updates/pyanaconda/ui'
  `pathlist` = {'/builddir/anaconda/pyanaconda/ui', '/usr/lib64/python3.5/site-packages/pyanaconda/ui', '/usr/lib/python3.5/site-packages/pyanaconda/ui', '/tmp/updates/pyanaconda/ui'}
  `paths` = {'hubs': [('pyanaconda.ui.gui.hubs.%s', '/builddir/anaconda/pyanaconda/ui/gui/hubs'), ('pyanaconda.ui.gui.hubs.%s', '/usr/lib64/python3.5/site-packages/pyanaconda/ui/gui/hubs'), ('pyanaconda.ui.gui.hubs.%s', '/usr/lib/python3.5/site-packages/pyanaconda/ui/gui/hubs'), ('pyanaconda.ui.gui.hubs.%s', '/tmp/updates/pyanaconda/ui/gui/hubs')], 'categories': [('pyanaconda.ui.categories.%s', '/builddir/anaconda/pyanaconda/ui/categories'), ('pyanaconda.ui.categories.%s', '/usr/lib64/python3.5/site-packages/pyanaconda/ui/categories'), ('pyanaconda.ui.categories.%s', '/usr/lib/python3.5/site-packages/pyanaconda/ui/categories'), ('pyanaconda.ui.categories.%s', '/tmp/updates/pyanaconda/ui/categories')], 'spokes': [('pyanaconda.ui.gui.spokes.%s', '/builddir/anaconda/pyanaconda/ui/gui/spokes'), ('pyanaconda.ui.gui.spokes.%s', '/usr/lib64/python3.5/site-packages/pyanaconda/ui/gui/spokes'), ('pyanaconda.ui.gui.spokes.%s', '/usr/lib/python3.5/site-packages/pyanaconda/ui/gui/spokes'), ('pyanaconda.ui.gui.spokes.%s', '/tmp/updates/pyanaconda/ui/gui/spokes')]}
  `run`()
  `setup`(data)
  `showDetailedError`(*args, **kwargs)

    The new body for the decorated method. If needed, it uses closure bound queue_instance variable which is valid until the reference to this method is destroyed.

  `showError`(*args, **kwargs)

    The new body for the decorated method. If needed, it uses closure bound queue_instance variable which is valid until the reference to this method is destroyed.

  `showYesNoQuestion`(*args, **kwargs)

    The new body for the decorated method. If needed, it uses closure bound queue_instance variable which is valid until the reference to this method is destroyed.

  `sitepackages` = ['/usr/lib64/python3.5/site-packages/pyanaconda/ui', '/usr/lib/python3.5/site-packages/pyanaconda/ui']
  `tty_num`
  `updatepath` = '/tmp/updates/pyanaconda/ui'

class `pyanaconda.ui.gui.``QuitDialog`(data)

  Bases: `pyanaconda.ui.gui.GUIObject`

  Create a new UIObject instance, including loading its uiFile and all UI-related objects.

  Instance attributes:

  data – An instance of a pykickstart Handler object. The Hub
    never directly uses this instance. Instead, it passes it down into Spokes when they are created and applied. The Hub simply stores this instance so it doesn’t need to be passed by the user.
  skipTo – If this attribute is set to something other than None,

    it must be the name of a class (as a string). Then, the interface will skip to the first instance of that class in the action list instead of going on to whatever the next action is normally.

    Note that actions may only skip ahead, never backwards. Also, standalone spokes may not skip to an individual spoke off a hub. They can only skip to the hub itself.

  `MESSAGE` = ''
  `builderObjects` = ['quitDialog']
  `mainWidgetName` = 'quitDialog'
  `run`()
  `uiFile` = 'main.glade'