Add class diagrams to existing hubs and spokes. I don't add these globally because they are waste of space in generated documentation if there are only few parents (also I didn't found where to setup that).
I lowered number of the documentation compilation errors and warnings.
Example: ![class_diagram](https://jkonecny.fedorapeople.org/redhat/class%20diagram%20example.png)
From: Jiri Konecny jkonecny@redhat.com
--- docs/conf.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/docs/conf.py b/docs/conf.py index e0598b0..3b90bd0 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -28,7 +28,7 @@
# Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. -extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage'] +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', 'sphinx.ext.coverage', 'sphinx.ext.inheritance_diagram']
# Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] @@ -102,6 +102,9 @@ def read_version():
autoclass_content = 'both'
+# Inheritence diagram graphviz settings +inheritance_graph_attrs = dict(rankdir="UD", fontsize=14, ratio='auto') +inheritance_node_attrs = dict(style='rounded', margin='"0.07, 0.07"')
# -- Options for HTML output ---------------------------------------------------
From: Jiri Konecny jkonecny@redhat.com
Don't add class diagrams everywhere because it is waste of space in a generated documentation for classes with only few parents. --- pyanaconda/ui/gui/hubs/__init__.py | 3 +++ pyanaconda/ui/gui/hubs/progress.py | 4 ++++ pyanaconda/ui/gui/hubs/summary.py | 4 ++++ pyanaconda/ui/gui/spokes/__init__.py | 8 ++++++++ pyanaconda/ui/gui/spokes/advstorage/dasd.py | 3 +++ pyanaconda/ui/gui/spokes/advstorage/fcoe.py | 4 ++++ pyanaconda/ui/gui/spokes/advstorage/iscsi.py | 4 ++++ pyanaconda/ui/gui/spokes/advstorage/zfcp.py | 3 +++ pyanaconda/ui/gui/spokes/custom.py | 4 ++++ pyanaconda/ui/gui/spokes/datetime_spoke.py | 4 ++++ pyanaconda/ui/gui/spokes/filter.py | 4 ++++ pyanaconda/ui/gui/spokes/keyboard.py | 4 ++++ pyanaconda/ui/gui/spokes/langsupport.py | 4 ++++ pyanaconda/ui/gui/spokes/network.py | 8 ++++++++ pyanaconda/ui/gui/spokes/password.py | 4 ++++ pyanaconda/ui/gui/spokes/software.py | 4 ++++ pyanaconda/ui/gui/spokes/source.py | 4 ++++ pyanaconda/ui/gui/spokes/storage.py | 4 ++++ pyanaconda/ui/gui/spokes/user.py | 8 ++++++++ pyanaconda/ui/gui/spokes/welcome.py | 4 ++++ pyanaconda/ui/tui/__init__.py | 6 +++++- pyanaconda/ui/tui/hubs/__init__.py | 2 ++ pyanaconda/ui/tui/hubs/summary.py | 4 ++++ pyanaconda/ui/tui/spokes/__init__.py | 20 +++++++++++++++++++- pyanaconda/ui/tui/spokes/askvnc.py | 8 ++++++++ pyanaconda/ui/tui/spokes/langsupport.py | 3 +++ pyanaconda/ui/tui/spokes/network.py | 6 +++++- pyanaconda/ui/tui/spokes/password.py | 4 ++++ pyanaconda/ui/tui/spokes/progress.py | 4 ++++ pyanaconda/ui/tui/spokes/shell_spoke.py | 4 ++++ pyanaconda/ui/tui/spokes/software.py | 6 +++++- pyanaconda/ui/tui/spokes/source.py | 6 +++++- pyanaconda/ui/tui/spokes/storage.py | 14 ++++++++++---- pyanaconda/ui/tui/spokes/time_spoke.py | 4 ++++ pyanaconda/ui/tui/spokes/user.py | 4 ++++ pyanaconda/ui/tui/spokes/warnings_spoke.py | 4 ++++ 36 files changed, 179 insertions(+), 9 deletions(-)
diff --git a/pyanaconda/ui/gui/hubs/__init__.py b/pyanaconda/ui/gui/hubs/__init__.py index f3f9531..9479d45 100644 --- a/pyanaconda/ui/gui/hubs/__init__.py +++ b/pyanaconda/ui/gui/hubs/__init__.py @@ -55,6 +55,9 @@ class Hub(GUIObject, common.Hub):
Installation may consist of multiple chained Hubs, or Hubs with additional standalone screens either before or after them. + + .. inheritance-diagram:: Hub + :parts: 3 """
def __init__(self, data, storage, payload, instclass): diff --git a/pyanaconda/ui/gui/hubs/progress.py b/pyanaconda/ui/gui/hubs/progress.py index 43603fd..47880e6 100644 --- a/pyanaconda/ui/gui/hubs/progress.py +++ b/pyanaconda/ui/gui/hubs/progress.py @@ -46,6 +46,10 @@ __all__ = ["ProgressHub"]
class ProgressHub(Hub): + """ + .. inheritance-diagram:: ProgressHub + :parts: 3 + """ builderObjects = ["progressWindow"] mainWidgetName = "progressWindow" uiFile = "hubs/progress.glade" diff --git a/pyanaconda/ui/gui/hubs/summary.py b/pyanaconda/ui/gui/hubs/summary.py index a967092..847f722 100644 --- a/pyanaconda/ui/gui/hubs/summary.py +++ b/pyanaconda/ui/gui/hubs/summary.py @@ -26,6 +26,10 @@ __all__ = ["SummaryHub"]
class SummaryHub(Hub): + """ + .. inheritance-diagram:: SummaryHub + :parts: 3 + """ builderObjects = ["summaryWindow"] mainWidgetName = "summaryWindow" uiFile = "hubs/summary.glade" diff --git a/pyanaconda/ui/gui/spokes/__init__.py b/pyanaconda/ui/gui/spokes/__init__.py index 1227d44..de5226d 100644 --- a/pyanaconda/ui/gui/spokes/__init__.py +++ b/pyanaconda/ui/gui/spokes/__init__.py @@ -28,6 +28,10 @@ # Inherit abstract methods from common.StandaloneSpoke # pylint: disable=abstract-method class StandaloneSpoke(GUIObject, common.StandaloneSpoke): + """ + .. inheritance-diagram:: StandaloneSpoke + :parts: 3 + """ def __init__(self, data, storage, payload, instclass): GUIObject.__init__(self, data) common.StandaloneSpoke.__init__(self, storage, payload, instclass) @@ -41,6 +45,10 @@ def _on_continue_clicked(self, win, user_data=None): # Inherit abstract methods from common.NormalSpoke # pylint: disable=abstract-method class NormalSpoke(GUIObject, common.NormalSpoke): + """ + .. inheritance-diagram:: NormalSpoke + :parts: 3 + """ def __init__(self, data, storage, payload, instclass): GUIObject.__init__(self, data) common.NormalSpoke.__init__(self, storage, payload, instclass) diff --git a/pyanaconda/ui/gui/spokes/advstorage/dasd.py b/pyanaconda/ui/gui/spokes/advstorage/dasd.py index de8277a..9b0e4ca 100644 --- a/pyanaconda/ui/gui/spokes/advstorage/dasd.py +++ b/pyanaconda/ui/gui/spokes/advstorage/dasd.py @@ -32,6 +32,9 @@ class DASDDialog(GUIObject): """ Gtk dialog which allows users to manually add DASD devices without having previously specified them in a parm file. + + .. inheritance-diagram:: DASDDialog + :parts: 3 """ builderObjects = ["dasdDialog"] mainWidgetName = "dasdDialog" diff --git a/pyanaconda/ui/gui/spokes/advstorage/fcoe.py b/pyanaconda/ui/gui/spokes/advstorage/fcoe.py index c624f5a..77e1a53 100644 --- a/pyanaconda/ui/gui/spokes/advstorage/fcoe.py +++ b/pyanaconda/ui/gui/spokes/advstorage/fcoe.py @@ -28,6 +28,10 @@ __all__ = ["FCoEDialog"]
class FCoEDialog(GUIObject): + """ + .. inheritance-diagram:: FCoEDialog + :parts: 3 + """ builderObjects = ["fcoeDialog"] mainWidgetName = "fcoeDialog" uiFile = "spokes/advstorage/fcoe.glade" diff --git a/pyanaconda/ui/gui/spokes/advstorage/iscsi.py b/pyanaconda/ui/gui/spokes/advstorage/iscsi.py index e3819f4..8e4be25 100644 --- a/pyanaconda/ui/gui/spokes/advstorage/iscsi.py +++ b/pyanaconda/ui/gui/spokes/advstorage/iscsi.py @@ -111,6 +111,10 @@ def credentials_valid(credentials): credentials.rUsername.strip() != "" and credentials.rPassword != ""
class ISCSIDialog(GUIObject): + """ + .. inheritance-diagram:: ISCSIDialog + :parts: 3 + """ builderObjects = ["iscsiDialog", "nodeStore", "nodeStoreFiltered"] mainWidgetName = "iscsiDialog" uiFile = "spokes/advstorage/iscsi.glade" diff --git a/pyanaconda/ui/gui/spokes/advstorage/zfcp.py b/pyanaconda/ui/gui/spokes/advstorage/zfcp.py index 6fe4c58..f0fc904 100644 --- a/pyanaconda/ui/gui/spokes/advstorage/zfcp.py +++ b/pyanaconda/ui/gui/spokes/advstorage/zfcp.py @@ -32,6 +32,9 @@ class ZFCPDialog(GUIObject): """ Gtk dialog which allows users to manually add zFCP devices without having previously specified them in a parm file. + + .. inheritance-diagram:: ZFCPDialog + :parts: 3 """ builderObjects = ["zfcpDialog"] mainWidgetName = "zfcpDialog" diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index aa7d6fb..c9a45df 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -137,6 +137,10 @@ def decorated(*args, **kwargs): return decorated
class CustomPartitioningSpoke(NormalSpoke, StorageChecker): + """ + .. inheritance-diagram:: CustomPartitioningSpoke + :parts: 3 + """ builderObjects = ["customStorageWindow", "containerStore", "deviceTypeStore", "partitionStore", "raidStoreFiltered", "raidLevelStore", "addImage", "removeImage", "settingsImage", diff --git a/pyanaconda/ui/gui/spokes/datetime_spoke.py b/pyanaconda/ui/gui/spokes/datetime_spoke.py index 12e75be..93039a0 100644 --- a/pyanaconda/ui/gui/spokes/datetime_spoke.py +++ b/pyanaconda/ui/gui/spokes/datetime_spoke.py @@ -396,6 +396,10 @@ def on_server_edited(self, renderer, path, new_text, *args): self._refresh_server_working(itr)
class DatetimeSpoke(FirstbootSpokeMixIn, NormalSpoke): + """ + .. inheritance-diagram:: DatetimeSpoke + :parts: 3 + """ builderObjects = ["datetimeWindow", "days", "months", "years", "regions", "cities", "upImage", "upImage1", "upImage2", "downImage", diff --git a/pyanaconda/ui/gui/spokes/filter.py b/pyanaconda/ui/gui/spokes/filter.py index eaf5116..dd56945 100644 --- a/pyanaconda/ui/gui/spokes/filter.py +++ b/pyanaconda/ui/gui/spokes/filter.py @@ -474,6 +474,10 @@ def visible_func(self, model, itr, *args): return self.ismember(device) and self._filter_func(device)
class FilterSpoke(NormalSpoke): + """ + .. inheritance-diagram:: FilterSpoke + :parts: 3 + """ builderObjects = ["diskStore", "filterWindow", "searchModel", "multipathModel", "otherModel", "zModel"] mainWidgetName = "filterWindow" diff --git a/pyanaconda/ui/gui/spokes/keyboard.py b/pyanaconda/ui/gui/spokes/keyboard.py index 49753d6..3fd1f93 100644 --- a/pyanaconda/ui/gui/spokes/keyboard.py +++ b/pyanaconda/ui/gui/spokes/keyboard.py @@ -260,6 +260,10 @@ def on_use_option_toggled(self, renderer, path, *args):
class KeyboardSpoke(NormalSpoke): + """ + .. inheritance-diagram:: KeyboardSpoke + :parts: 3 + """ builderObjects = ["addedLayoutStore", "keyboardWindow", "layoutTestBuffer"] mainWidgetName = "keyboardWindow" diff --git a/pyanaconda/ui/gui/spokes/langsupport.py b/pyanaconda/ui/gui/spokes/langsupport.py index fd62b20..e8c1740 100644 --- a/pyanaconda/ui/gui/spokes/langsupport.py +++ b/pyanaconda/ui/gui/spokes/langsupport.py @@ -47,6 +47,10 @@ _HIGHLIGHT_COLOR = Gdk.RGBA(red=0.992157, green=0.984314, blue=0.752941, alpha=1.0)
class LangsupportSpoke(LangLocaleHandler, NormalSpoke): + """ + .. inheritance-diagram:: LangsupportSpoke + :parts: 3 + """ builderObjects = ["languageStore", "languageStoreFilter", "localeStore", "langsupportWindow"] mainWidgetName = "langsupportWindow" focusWidgetName = "languageEntry" diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py index 3e0d770..4551e00 100644 --- a/pyanaconda/ui/gui/spokes/network.py +++ b/pyanaconda/ui/gui/spokes/network.py @@ -1405,6 +1405,10 @@ def register_secret_agent(spoke):
class NetworkSpoke(FirstbootSpokeMixIn, NormalSpoke): + """ + .. inheritance-diagram:: NetworkSpoke + :parts: 3 + """ builderObjects = ["networkWindow", "liststore_wireless_network", "liststore_devices", "add_device_dialog", "liststore_add_device"] mainWidgetName = "networkWindow" uiFile = "spokes/network.glade" @@ -1509,6 +1513,10 @@ def on_back_clicked(self, button):
class NetworkStandaloneSpoke(StandaloneSpoke): + """ + .. inheritance-diagram:: NetworkStandaloneSpoke + :parts: 3 + """ builderObjects = ["networkStandaloneWindow", "networkControlBox_vbox", "liststore_wireless_network", "liststore_devices", "add_device_dialog", "liststore_add_device"] mainWidgetName = "networkStandaloneWindow" uiFile = "spokes/network.glade" diff --git a/pyanaconda/ui/gui/spokes/password.py b/pyanaconda/ui/gui/spokes/password.py index b0b8265..895a0d3 100644 --- a/pyanaconda/ui/gui/spokes/password.py +++ b/pyanaconda/ui/gui/spokes/password.py @@ -39,6 +39,10 @@
class PasswordSpoke(FirstbootSpokeMixIn, NormalSpoke, GUISpokeInputCheckHandler): + """ + .. inheritance-diagram:: PasswordSpoke + :parts: 3 + """ builderObjects = ["passwordWindow"]
mainWidgetName = "passwordWindow" diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py index 31bed80..3ef6a4e 100644 --- a/pyanaconda/ui/gui/spokes/software.py +++ b/pyanaconda/ui/gui/spokes/software.py @@ -45,6 +45,10 @@ __all__ = ["SoftwareSelectionSpoke"]
class SoftwareSelectionSpoke(NormalSpoke): + """ + .. inheritance-diagram:: SoftwareSelectionSpoke + :parts: 3 + """ builderObjects = ["addonStore", "environmentStore", "softwareWindow"] mainWidgetName = "softwareWindow" uiFile = "spokes/software.glade" diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py index 6aec801..f6c8f66 100644 --- a/pyanaconda/ui/gui/spokes/source.py +++ b/pyanaconda/ui/gui/spokes/source.py @@ -375,6 +375,10 @@ def on_folder_changed(self, chooser): chooser.set_current_folder(constants.ISO_DIR)
class SourceSpoke(NormalSpoke, GUISpokeInputCheckHandler): + """ + .. inheritance-diagram:: SourceSpoke + :parts: 3 + """ builderObjects = ["isoChooser", "isoFilter", "partitionStore", "sourceWindow", "dirImage", "repoStore"] mainWidgetName = "sourceWindow" uiFile = "spokes/source.glade" diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py index 0f2b384..d820044 100644 --- a/pyanaconda/ui/gui/spokes/storage.py +++ b/pyanaconda/ui/gui/spokes/storage.py @@ -235,6 +235,10 @@ def refresh(self, required_space, auto_swap, disk_free, fs_free): self._add_modify_watcher(label)
class StorageSpoke(NormalSpoke, StorageChecker): + """ + .. inheritance-diagram:: StorageSpoke + :parts: 3 + """ builderObjects = ["storageWindow", "addSpecializedImage"] mainWidgetName = "storageWindow" uiFile = "spokes/storage.glade" diff --git a/pyanaconda/ui/gui/spokes/user.py b/pyanaconda/ui/gui/spokes/user.py index bd88b78..7065ce8 100644 --- a/pyanaconda/ui/gui/spokes/user.py +++ b/pyanaconda/ui/gui/spokes/user.py @@ -44,6 +44,10 @@ __all__ = ["UserSpoke", "AdvancedUserDialog"]
class AdvancedUserDialog(GUIObject, GUIDialogInputCheckHandler): + """ + .. inheritance-diagram:: AdvancedUserDialog + :parts: 3 + """ builderObjects = ["advancedUserDialog", "uid", "gid"] mainWidgetName = "advancedUserDialog" uiFile = "spokes/advanced_user.glade" @@ -222,6 +226,10 @@ def on_gid_mnemonic_activate(self, widget, group_cycling, user_data=None): return False
class UserSpoke(FirstbootSpokeMixIn, NormalSpoke, GUISpokeInputCheckHandler): + """ + .. inheritance-diagram:: UserSpoke + :parts: 3 + """ builderObjects = ["userCreationWindow"]
mainWidgetName = "userCreationWindow" diff --git a/pyanaconda/ui/gui/spokes/welcome.py b/pyanaconda/ui/gui/spokes/welcome.py index 1dbe527..2d4a01f 100644 --- a/pyanaconda/ui/gui/spokes/welcome.py +++ b/pyanaconda/ui/gui/spokes/welcome.py @@ -46,6 +46,10 @@ __all__ = ["WelcomeLanguageSpoke"]
class WelcomeLanguageSpoke(LangLocaleHandler, StandaloneSpoke): + """ + .. inheritance-diagram:: WelcomeLanguageSpoke + :parts: 3 + """ mainWidgetName = "welcomeWindow" focusWidgetName = "languageEntry" uiFile = "spokes/welcome.glade" diff --git a/pyanaconda/ui/tui/__init__.py b/pyanaconda/ui/tui/__init__.py index 585515e..18feafb 100644 --- a/pyanaconda/ui/tui/__init__.py +++ b/pyanaconda/ui/tui/__init__.py @@ -54,7 +54,11 @@ def exception_msg_handler(event, data): sys.excepthook(*msg_data[0])
class TextUserInterface(ui.UserInterface): - """This is the main class for Text user interface.""" + """This is the main class for Text user interface. + + .. inheritance-diagram:: SourceSpoke + :parts: 3 + """
ENVIRONMENT = "anaconda"
diff --git a/pyanaconda/ui/tui/hubs/__init__.py b/pyanaconda/ui/tui/hubs/__init__.py index 8c5f16a..1736876 100644 --- a/pyanaconda/ui/tui/hubs/__init__.py +++ b/pyanaconda/ui/tui/hubs/__init__.py @@ -35,6 +35,8 @@ class TUIHub(TUIObject, common.Hub): :param title: title for this Hub :type title: str
+ .. inheritance-diagram:: TUIHub + :parts: 3 """
categories = [] diff --git a/pyanaconda/ui/tui/hubs/summary.py b/pyanaconda/ui/tui/hubs/summary.py index 880275d..71e1bef 100644 --- a/pyanaconda/ui/tui/hubs/summary.py +++ b/pyanaconda/ui/tui/hubs/summary.py @@ -32,6 +32,10 @@ log = logging.getLogger("anaconda")
class SummaryHub(TUIHub): + """ + .. inheritance-diagram:: SummaryHub + :parts: 3 + """ title = N_("Installation")
def __init__(self, app, data, storage, payload, instclass): diff --git a/pyanaconda/ui/tui/spokes/__init__.py b/pyanaconda/ui/tui/spokes/__init__.py index 9bfd656..fbf9366 100644 --- a/pyanaconda/ui/tui/spokes/__init__.py +++ b/pyanaconda/ui/tui/spokes/__init__.py @@ -44,6 +44,9 @@ class TUISpoke(TUIObject, tui.Widget, Spoke):
:param category: category this spoke belongs to :type category: string + + .. inheritance-diagram:: TUISpoke + :parts: 3 """
title = N_("Default spoke title") @@ -91,6 +94,10 @@ def render(self, width): self.draw(c)
class NormalTUISpoke(TUISpoke, NormalSpoke): + """ + .. inheritance-diagram:: NormalTUISpoke + :parts: 3 + """ pass
EditTUISpokeEntry = namedtuple("EditTUISpokeEntry", ["title", "attribute", "aux", "visible"]) @@ -98,7 +105,11 @@ class NormalTUISpoke(TUISpoke, NormalSpoke): # Inherit abstract methods from NormalTUISpoke # pylint: disable=abstract-method class EditTUIDialog(NormalTUISpoke): - """Spoke/dialog used to read new value of textual or password data""" + """Spoke/dialog used to read new value of textual or password data + + .. inheritance-diagram:: EditTUIDialog + :parts: 3 + """
title = N_("New value") PASSWORD = re.compile(".*") @@ -213,6 +224,9 @@ class EditTUISpoke(NormalTUISpoke): a list of titles, attribute names and regexps that specify the fields of an object the user allowed to edit. + + .. inheritance-diagram:: EditTUISpoke + :parts: 3 """
# self.data's subattribute name @@ -338,4 +352,8 @@ def input(self, args, key): return NormalTUISpoke.input(self, args, key)
class StandaloneTUISpoke(TUISpoke, StandaloneSpoke): + """ + .. inheritance-diagram:: StandaloneTUISpoke + :parts: 3 + """ pass diff --git a/pyanaconda/ui/tui/spokes/askvnc.py b/pyanaconda/ui/tui/spokes/askvnc.py index 45dda66..bcdaa60 100644 --- a/pyanaconda/ui/tui/spokes/askvnc.py +++ b/pyanaconda/ui/tui/spokes/askvnc.py @@ -39,6 +39,10 @@ def exception_msg_handler_and_exit(event, data): sys.exit(1)
class AskVNCSpoke(NormalTUISpoke): + """ + .. inheritance-diagram:: AskVNCSpoke + :parts: 3 + """ title = N_("VNC")
# This spoke is kinda standalone, not meant to be used with a hub @@ -119,6 +123,10 @@ def apply(self): self.data.vnc.enabled = self._usevnc
class VNCPassSpoke(NormalTUISpoke): + """ + .. inheritance-diagram:: VNCPassSpoke + :parts: 3 + """ title = N_("VNC Password")
def __init__(self, app, data, storage, payload, instclass, message=None): diff --git a/pyanaconda/ui/tui/spokes/langsupport.py b/pyanaconda/ui/tui/spokes/langsupport.py index 0ae6bdd..3fbce17 100644 --- a/pyanaconda/ui/tui/spokes/langsupport.py +++ b/pyanaconda/ui/tui/spokes/langsupport.py @@ -34,6 +34,9 @@ class LangSpoke(FirstbootSpokeMixIn, NormalTUISpoke): in text-mode.
Also this doesn't allow for selection of multiple languages like in the GUI. + + .. inheritance-diagram:: LangSpoke + :parts: 3 """ title = N_("Language settings") category = LocalizationCategory diff --git a/pyanaconda/ui/tui/spokes/network.py b/pyanaconda/ui/tui/spokes/network.py index e02e9ba..df825ee 100644 --- a/pyanaconda/ui/tui/spokes/network.py +++ b/pyanaconda/ui/tui/spokes/network.py @@ -42,7 +42,11 @@
class NetworkSpoke(EditTUISpoke): - """ Spoke used to configure network settings. """ + """ Spoke used to configure network settings. + + .. inheritance-diagram:: NetworkSpoke + :parts: 3 + """ title = N_("Network configuration") category = SystemCategory
diff --git a/pyanaconda/ui/tui/spokes/password.py b/pyanaconda/ui/tui/spokes/password.py index 06ed6da..3a145ab 100644 --- a/pyanaconda/ui/tui/spokes/password.py +++ b/pyanaconda/ui/tui/spokes/password.py @@ -29,6 +29,10 @@ from pyanaconda.i18n import N_, _
class PasswordSpoke(FirstbootSpokeMixIn, EditTUIDialog): + """ + .. inheritance-diagram:: PasswordSpoke + :parts: 3 + """ title = N_("Root password") category = UserSettingsCategory
diff --git a/pyanaconda/ui/tui/spokes/progress.py b/pyanaconda/ui/tui/spokes/progress.py index 9e94122..a81b93e 100644 --- a/pyanaconda/ui/tui/spokes/progress.py +++ b/pyanaconda/ui/tui/spokes/progress.py @@ -34,6 +34,10 @@ __all__ = ["ProgressSpoke"]
class ProgressSpoke(StandaloneTUISpoke): + """ + .. inheritance-diagram:: ProgressSpoke + :parts: 3 + """ title = N_("Progress")
postForHub = SummaryHub diff --git a/pyanaconda/ui/tui/spokes/shell_spoke.py b/pyanaconda/ui/tui/spokes/shell_spoke.py index 0037188..d4b19e9 100644 --- a/pyanaconda/ui/tui/spokes/shell_spoke.py +++ b/pyanaconda/ui/tui/spokes/shell_spoke.py @@ -30,6 +30,10 @@ from blivet import arch
class ShellSpoke(NormalTUISpoke): + """ + .. inheritance-diagram:: ShellSpoke + :parts: 3 + """ title = N_("Shell") category = SystemCategory
diff --git a/pyanaconda/ui/tui/spokes/software.py b/pyanaconda/ui/tui/spokes/software.py index 490a911..b675045 100644 --- a/pyanaconda/ui/tui/spokes/software.py +++ b/pyanaconda/ui/tui/spokes/software.py @@ -36,7 +36,11 @@
class SoftwareSpoke(NormalTUISpoke): - """ Spoke used to read new value of text to represent source repo. """ + """ Spoke used to read new value of text to represent source repo. + + .. inheritance-diagram:: SoftwareSpoke + :parts: 3 + """ title = N_("Software selection") category = SoftwareCategory
diff --git a/pyanaconda/ui/tui/spokes/source.py b/pyanaconda/ui/tui/spokes/source.py index 733927a..17e7f88 100644 --- a/pyanaconda/ui/tui/spokes/source.py +++ b/pyanaconda/ui/tui/spokes/source.py @@ -51,7 +51,11 @@ __all__ = ["SourceSpoke"]
class SourceSpoke(EditTUISpoke, SourceSwitchHandler): - """ Spoke used to customize the install source repo. """ + """ Spoke used to customize the install source repo. + + .. inheritance-diagram:: SourceSpoke + :parts: 3 + """ title = N_("Installation source") category = SoftwareCategory
diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py index 29e6b53..4cf48fb 100644 --- a/pyanaconda/ui/tui/spokes/storage.py +++ b/pyanaconda/ui/tui/spokes/storage.py @@ -65,9 +65,11 @@ CLEARNONE: CLEARPART_TYPE_NONE}
class StorageSpoke(NormalTUISpoke): - """ - Storage spoke where users proceed to customize storage features such - as disk selection, partitioning, and fs type. + """Storage spoke where users proceed to customize storage features such + as disk selection, partitioning, and fs type. + + .. inheritance-diagram:: StorageSpoke + :parts: 3 """ title = N_("Installation Destination") category = SystemCategory @@ -445,7 +447,11 @@ def _initialize(self): self._ready = True
class AutoPartSpoke(NormalTUISpoke): - """ Autopartitioning options are presented here. """ + """ Autopartitioning options are presented here. + + .. inheritance-diagram:: AutoPartSpoke + :parts: 3 + """ title = N_("Autopartitioning Options") category = SystemCategory
diff --git a/pyanaconda/ui/tui/spokes/time_spoke.py b/pyanaconda/ui/tui/spokes/time_spoke.py index 3a49849..2221939 100644 --- a/pyanaconda/ui/tui/spokes/time_spoke.py +++ b/pyanaconda/ui/tui/spokes/time_spoke.py @@ -28,6 +28,10 @@ from pyanaconda.constants_text import INPUT_PROCESSED
class TimeZoneSpoke(FirstbootSpokeMixIn, NormalTUISpoke): + """ + .. inheritance-diagram:: TimeZoneSpoke + :parts: 3 + """ title = N_("Timezone settings") category = LocalizationCategory
diff --git a/pyanaconda/ui/tui/spokes/user.py b/pyanaconda/ui/tui/spokes/user.py index 81a49a5..007d507 100644 --- a/pyanaconda/ui/tui/spokes/user.py +++ b/pyanaconda/ui/tui/spokes/user.py @@ -34,6 +34,10 @@ __all__ = ["UserSpoke"]
class UserSpoke(FirstbootSpokeMixIn, EditTUISpoke): + """ + .. inheritance-diagram:: UserSpoke + :parts: 3 + """ title = N_("User creation") category = UserSettingsCategory
diff --git a/pyanaconda/ui/tui/spokes/warnings_spoke.py b/pyanaconda/ui/tui/spokes/warnings_spoke.py index c14b195..ecf5923 100644 --- a/pyanaconda/ui/tui/spokes/warnings_spoke.py +++ b/pyanaconda/ui/tui/spokes/warnings_spoke.py @@ -33,6 +33,10 @@ __all__ = ["WarningsSpoke"]
class WarningsSpoke(StandaloneTUISpoke): + """ + .. inheritance-diagram:: WarningsSpoke + :parts: 3 + """ title = N_("Warnings")
preForHub = SummaryHub
From: Jiri Konecny jkonecny@redhat.com
--- pyanaconda/bootloader.py | 30 +++-- pyanaconda/flags.py | 2 +- pyanaconda/geoloc.py | 227 ++++++++++++++++++++--------------- pyanaconda/ihelp.py | 12 +- pyanaconda/iutil.py | 8 +- pyanaconda/kickstart.py | 2 +- pyanaconda/nm.py | 72 ++++++----- pyanaconda/ui/common.py | 4 +- pyanaconda/ui/gui/utils.py | 5 +- pyanaconda/ui/tui/__init__.py | 2 +- pyanaconda/ui/tui/hubs/__init__.py | 12 +- pyanaconda/ui/tui/spokes/__init__.py | 12 +- 12 files changed, 217 insertions(+), 171 deletions(-)
diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py index 0f62d73..2bbce13 100644 --- a/pyanaconda/bootloader.py +++ b/pyanaconda/bootloader.py @@ -56,18 +56,24 @@ def __init__(self): self.flow = None
def parse_serial_opt(arg): - """Parse and split serial console options. - - Documentation/kernel-parameters.txt says: - ttyS<n>[,options] - Use the specified serial port. The options are of - the form "bbbbpnf", where "bbbb" is the baud rate, - "p" is parity ("n", "o", or "e"), "n" is number of - bits, and "f" is flow control ("r" for RTS or - omit it). Default is "9600n8". - but note that everything after the baud rate is optional, so these are - all valid: 9600, 19200n, 38400n8, 9600e7r. - Also note that the kernel assumes 1 stop bit; this can't be changed. + """ + Parse and split serial console options. + + .. NOTE:: + + Documentation/kernel-parameters.txt says: + + ttyS<n>[,options] + + Use the specified serial port. The options are of + the form "bbbbpnf", where "bbbb" is the baud rate, + "p" is parity ("n", "o", or "e"), "n" is number of + bits, and "f" is flow control ("r" for RTS or + omit it). Default is "9600n8". + + but note that everything after the baud rate is optional, so these are + all valid: 9600, 19200n, 38400n8, 9600e7r. + Also note that the kernel assumes 1 stop bit; this can't be changed. """ opts = serial_opts() m = re.match(r'\d+', arg) diff --git a/pyanaconda/flags.py b/pyanaconda/flags.py index ad3aaca..c6c451f 100644 --- a/pyanaconda/flags.py +++ b/pyanaconda/flags.py @@ -122,7 +122,7 @@ def read(self, filenames): Read and parse a filename (or a list of filenames). Files that can't be read are silently ignored. Returns a list of successfully read files. - filenames can contain *, ?, and character ranges expressed with [] + filenames can contain *, ?, and character ranges expressed with [] """
readfiles = [] diff --git a/pyanaconda/geoloc.py b/pyanaconda/geoloc.py index 5daf606..b53e39f 100644 --- a/pyanaconda/geoloc.py +++ b/pyanaconda/geoloc.py @@ -22,81 +22,86 @@ A GeoIP and WiFi location module - location detection based on IP address
How to use the geolocation module - -First call init_geolocation() - this creates the LocationInfo singleton and -you can also use it to set what geolocation provider should be used. -To actually look up current position, call refresh() - this will trigger -the actual online geolocation query, which runs in a thread. -After the look-up thread finishes, the results are stored in the singleton -and can be retrieved using the get_territory_code() and get_result() methods. -If you call these methods without calling refresh() first or if the look-up -is currently in progress, both return None. - + First call :func:`init_geolocation` - this creates the LocationInfo singleton and + you can also use it to set what geolocation provider should be used. + To actually look up current position, call :func:`refresh` - this will trigger + the actual online geolocation query, which runs in a thread. + After the look-up thread finishes, the results are stored in the singleton + and can be retrieved using the :func:`get_territory_code` and :func:`get_result` methods. + If you call these methods without calling :func:`refresh` first or if the look-up + is currently in progress, both return ``None``. + +==================== Geolocation backends +====================
This module currently supports three geolocation backends: -* Fedora GeoIP API -* Hostip GeoIP -* Google WiFi + * Fedora GeoIP API + * Hostip GeoIP + * Google WiFi
Fedora GeoIP backend -This is the default backend. It queries the Fedora GeoIP API for location -data based on current public IP address. The reply is JSON formated and -contains the following fields: -postal_code, latitude, longitude, region, city, country_code, country_name, -time_zone, country_code3, area_code, metro_code, region_name and dma_code -Anaconda currently uses just time_zone and country_code. + This is the default backend. It queries the Fedora GeoIP API for location + data based on current public IP address. The reply is JSON formated and + contains the following fields: + postal_code, latitude, longitude, region, city, country_code, country_name, + time_zone, country_code3, area_code, metro_code, region_name and dma_code + Anaconda currently uses just time_zone and country_code.
Hostip backend -A GeoIP look-up backend that can be used to determine current country code -from current public IP address. The public IP address is determined -automatically when calling the API. -GeoIP results from Hostip contain the current public IP and an approximate -address. To get this detail location info, use the get_result() method -to get an instance of the LocationResult class, used to wrap the result. + A GeoIP look-up backend that can be used to determine current country code + from current public IP address. The public IP address is determined + automatically when calling the API. + GeoIP results from Hostip contain the current public IP and an approximate + address. To get this detail location info, use the get_result() method + to get an instance of the LocationResult class, used to wrap the result.
Google WiFi backend -This backend is probably the most accurate one, at least as long as the -computer has a working WiFi hardware and there are some WiFi APs nearby. -It sends data about nearby APs (ssid, MAC address & signal strength) -acquired from Network Manager to a Google API to get approximate -geographic coordinates. If there are enough AP nearby (such as in a -normal city) it can be very accurate, even up to currently determining -which building is the computer currently in. -But this only returns current geographic coordinates, to get country code -the Nominatim reverse-geocoding API is called to convert the coordinates -to an address, which includes a country code. + This backend is probably the most accurate one, at least as long as the + computer has a working WiFi hardware and there are some WiFi APs nearby. + It sends data about nearby APs (ssid, MAC address & signal strength) + acquired from Network Manager to a Google API to get approximate + geographic coordinates. If there are enough AP nearby (such as in a + normal city) it can be very accurate, even up to currently determining + which building is the computer currently in. + But this only returns current geographic coordinates, to get country code + the Nominatim reverse-geocoding API is called to convert the coordinates + to an address, which includes a country code. + While having many advantages, this backend also has some severe disadvantages: -* needs working WiFi hardware -* tells your public IP address & possibly quite precise geographic coordinates - to two external entities (Google and Nominatim) + * needs working WiFi hardware + * tells your public IP address & possibly quite precise geographic coordinates + to two external entities (Google and Nominatim) + This could have severe privacy issues and should be carefully considered before -enabling it to be used by default. -* the Google WiFi geolocation API seems to lack official documentation +enabling it to be used by default. Also the Google WiFi geolocation API seems to +lack official documentation. + As a result its long-term stability might not be guarantied.
Possible issues with GeoIP - -"I'm in Switzerland connected to corporate VPN and anaconda tells me -I'm in Netherlands." -The public IP address is not directly mapped to the physical location -of a computer. So while your world visible IP address is registered to -an IP block assigned to an ISP in Netherlands, it is just the external -address of the Internet gateway of your corporate network. -As VPNs and proxies can connect two computers anywhere on Earth, -this issue is unfortunately probably unsolvable. + "I'm in Switzerland connected to corporate VPN and anaconda tells me + I'm in Netherlands." + The public IP address is not directly mapped to the physical location + of a computer. So while your world visible IP address is registered to + an IP block assigned to an ISP in Netherlands, it is just the external + address of the Internet gateway of your corporate network. + As VPNs and proxies can connect two computers anywhere on Earth, + this issue is unfortunately probably unsolvable.
Backends that could possibly be used in the future -* GPS geolocation -+ doesn't leak your coordinates to a third party -(not entirely true for assisted GPS) -- unassisted cold GPS startup can take tens of minutes to acquire a GPS fix -+ assisted GPS startup (as used in most smartphones) can acquire a fix -in a couple seconds -* cell tower geolocation + * GPS geolocation + + * (+) doesn't leak your coordinates to a third party + (not entirely true for assisted GPS) + * (-) unassisted cold GPS startup can take tens of minutes to acquire a GPS fix + * (+) assisted GPS startup (as used in most smartphones) can acquire a fix + in a couple seconds + + * cell tower geolocation
""" from pyanaconda.iutil import requests_session @@ -146,20 +151,25 @@ def refresh():
def get_territory_code(wait=False): - """This function returns the current country code - or None, if: - - no results were found - - the lookup is still in progress - - the geolocation module was not activated (init & refresh were not called) - - this is for example the case during image and directory installs + """ + This function returns the current country code or ``None``, if: + + * no results were found + * the lookup is still in progress + * the geolocation module was not activated + (:func:`init_geolocation` & :func:`refresh` were not called) + + * this is for example the case during image and directory installs
:param wait: wait for lookup in progress to finish - False - don't wait - True - wait for default period - number - wait for up to number seconds + + | ``False`` - don't wait + | ``True`` - wait for default period + | number - wait for up to number seconds + :type wait: bool or number - :return: current country code or None if not known - :rtype: string or None + :return: current country code or ``None`` if not known + :rtype: string or ``None`` """ if _get_location_info_instance(wait): return location_info_instance.get_territory_code() @@ -168,20 +178,25 @@ def get_territory_code(wait=False):
def get_timezone(wait=False): - """This function returns the current time zone - or None, if: - - no timezone was found - - the lookup is still in progress - - the geolocation module was not activated (init & refresh were not called) - - this is for example the case during image and directory installs + """ + This function returns the current time zone or ``None``, if: + + * no timezone was found + * the lookup is still in progress + * the geolocation module was not activated + (:func:`init_geolocation` & :func:`refresh` were not called) + + * this is for example the case during image and directory installs
:param wait: wait for lookup in progress to finish - False - don't wait - True - wait for default period - number - wait for up to number seconds + + | ``False`` - don't wait + | ``True`` - wait for default period + | number - wait for up to number seconds + :type wait: bool or number - :return: current timezone or None if not known - :rtype: string or None + :return: current timezone or ``None`` if not known + :rtype: string or ``None`` """ if _get_location_info_instance(wait): return location_info_instance.get_timezone() @@ -190,20 +205,25 @@ def get_timezone(wait=False):
def get_result(wait=False): - """Returns the current geolocation result wrapper - or None, if: - - no results were found - - the refresh is still in progress - - the geolocation module was not activated (init & refresh were not called) - - this is for example the case during image and directory installs + """ + Returns the current geolocation result wrapper or ``None``, if: + + * no results were found + * the refresh is still in progress + * the geolocation module was not activated + (:func:`init_geolocation` & :func:`refresh` were not called) + + * this is for example the case during image and directory installs
:param wait: wait for lookup in progress to finish - False - don't wait - True - wait for default period - number - wait for up to number seconds + + | ``False`` - don't wait + | ``True`` - wait for default period + | number - wait for up to number seconds + :type wait: bool or number - :return: LocationResult instance or None if location is unknown - :rtype: LocationResult or None + :return: :class:`LocationResult` instance or ``None`` if location is unknown + :rtype: :class:`LocationResult` or ``None`` """ if _get_location_info_instance(wait): return location_info_instance.get_result() @@ -212,7 +232,8 @@ def get_result(wait=False):
def get_provider_id_from_option(option_string): - """Get a valid provider id from a string + """ + Get a valid provider id from a string This function is used to parse command line arguments/boot options for the geolocation module.
@@ -253,7 +274,8 @@ def _get_provider(provider_id):
def _get_location_info_instance(wait=False): - """Return instance of the location info object + """ + Return instance of the location info object and optionally wait for the Geolocation thread to finish
If there is no lookup in progress (no Geolocation refresh thread @@ -304,7 +326,8 @@ class GeolocationError(Exception):
class LocationInfo(object): - """Determines current location based on IP address or + """ + Determines current location based on IP address or nearby WiFi access points (depending on what backend is used) """
@@ -314,7 +337,7 @@ def __init__(self, """ :param provider_id: GeoIP provider id specified by module constant :param refresh_now: if a GeoIP information refresh should be done - once the class is initialized + once the class is initialized :type refresh_now: bool """ self._provider = _get_provider(provider_id) @@ -341,18 +364,22 @@ def refresh(self): " - no connectivity")
def get_result(self): - """Get result from the provider + """ + Get result from the provider + + :return: the result object or return ``None`` if no results are available + :rtype: :class:`LocationResult` or ``None``
- :return: the result object or return None if no results are available - :rtype: LocationResult or None """ return self._provider.get_result()
def get_territory_code(self): - """A convenience function for getting the current territory code + """ + A convenience function for getting the current territory code + + :return: territory code or ``None`` if no results are available + :rtype: string or ``None``
- :return: territory code or None if no results are available - :rtype: string or None """ result = self._provider.get_result() if result: @@ -832,7 +859,7 @@ def scan(self): def get_results(self): """ :return: a list of WiFiAccessPoint objects or - an empty list if no APs were found or the scan failed + an empty list if no APs were found or the scan failed """ return self._scan_results
diff --git a/pyanaconda/ihelp.py b/pyanaconda/ihelp.py index 470f300..d437ab6 100644 --- a/pyanaconda/ihelp.py +++ b/pyanaconda/ihelp.py @@ -33,12 +33,13 @@ yelp_process = None
def _get_best_help_file(help_folder, help_file): - """Return the path to the best help file for the current language and available + """ + Return the path to the best help file for the current language and available help content
:param str help_folder: a path to folder where we should look for the help files :param str help_file: name of the requested help file - :return: path to the best help file or None is no match is found + :return: path to the best help file or ``None`` is no match is found :rtype: str or NoneType
""" @@ -73,9 +74,11 @@ def _get_best_help_file(help_folder, help_file): return None
def get_help_path(help_file, instclass): - """Return the full path for the given help file name, + """ + Return the full path for the given help file name, if the help file path does not exist a fallback path is returned. There are actually two possible fallback paths that might be returned: + * first we try to return path to the main page of the installation guide (if it exists) * if we can't find the main page of the installation page, path to a @@ -112,7 +115,8 @@ def get_help_path(help_file, instclass): return _get_best_help_file(instclass.help_folder, instclass.help_placeholder)
def start_yelp(help_path): - """Start a new yelp process and make sure to kill any existing ones + """ + Start a new yelp process and make sure to kill any existing ones
:param help_path: path to the help file yelp should load :type help_path: str or NoneType diff --git a/pyanaconda/iutil.py b/pyanaconda/iutil.py index 07fc4cb..63c7b42 100644 --- a/pyanaconda/iutil.py +++ b/pyanaconda/iutil.py @@ -1067,7 +1067,7 @@ def conditional_chown(path, uid, gid, from_uid=None, from_gid=None): def is_unsupported_hw(): """ Check to see if the hardware is supported or not.
- :returns: True if this is unsupported hardware, False otherwise + :returns: ``True`` if this is unsupported hardware, ``False`` otherwise :rtype: bool """ try: @@ -1082,14 +1082,14 @@ def is_unsupported_hw():
def ensure_str(str_or_bytes, keep_none=True): """ - Returns a str instance for given string or None if requested to keep it. + Returns a str instance for given string or ``None`` if requested to keep it.
:param str_or_bytes: string to be kept or converted to str type :type str_or_bytes: str or bytes :param bool keep_none: whether to keep None as it is or raise ValueError if - None is passed + ``None`` is passed :raises ValueError: if applied on an object not being of type bytes nor str - (nor NoneType if :param:`keep_none` is False) + (nor NoneType if ``keep_none`` is ``False``) """
if keep_none and str_or_bytes is None: diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py index f131e5a..52e8ef7 100644 --- a/pyanaconda/kickstart.py +++ b/pyanaconda/kickstart.py @@ -88,7 +88,7 @@ class AnacondaKSScript(KSScript): This will write the script to a file named /tmp/ks-script- before execution. Output is logged by the program logger, the path specified by --log - or to /tmp/ks-script-*.log + or to /tmp/ks-script-*.log """ def run(self, chroot): """ Run the kickstart script diff --git a/pyanaconda/nm.py b/pyanaconda/nm.py index de21b46..02b9a11 100644 --- a/pyanaconda/nm.py +++ b/pyanaconda/nm.py @@ -474,7 +474,7 @@ def nm_device_active_ssid(name):
:param name: name of device :type name: str - :return ssid of active access point, None if device has no active AP + :return: ssid of active access point, ``None`` if device has no active AP :rtype: str :raise UnknownDeviceError: if device is not found """ @@ -501,10 +501,12 @@ def nm_device_ip_config(name, version=4): :type version: int :return: IP configuration of device, empty list if device is not in ACTIVATED state - :rtype: [[[address1, prefix1, gateway1], [address2, prefix2, gateway2], ...], - [nameserver1, nameserver2]] - addressX, gatewayX: string - prefixX: int + :rtype: + | [[[address1, prefix1, gateway1], [address2, prefix2, gateway2], ...], + | [nameserver1, nameserver2]] + | addressX, gatewayX: string + | prefixX: int + :raise UnknownDeviceError: if device is not found :raise PropertyNotFoundError: if ip configuration is not found """ @@ -857,17 +859,19 @@ def nm_activate_device_connection(dev_name, con_uuid): def nm_add_connection(values): """Add new connection specified by values.
- :param values: list of settings with new values and its types - [[key1, key2, value, type_str], ...] - key1: first-level key of setting (eg "connection") - key2: second-level key of setting (eg "uuid") - value: new value - type_str: dbus type of new value (eg "ay") - :type values: [[key1, key2, value, type_str], ...] - key1: str - key2: str - value: object - type_str: str + :param values: + | list of settings with new values and its types + | [[key1, key2, value, type_str], ...] + | key1: first-level key of setting (eg "connection") + | key2: second-level key of setting (eg "uuid") + | value: new value + | type_str: dbus type of new value (eg "ay") + :type values: + | [[key1, key2, value, type_str], ...] + | key1: str + | key2: str + | value: object + | type_str: str """
settings = {} @@ -907,27 +911,31 @@ def nm_update_settings_of_device(name, new_values):
The type of value is determined from existing settings of device. If setting for key1, key2 does not exist, default_type_str is used or - if None, the type is inferred from the value supplied (string and bool only). + if ``None``, the type is inferred from the value supplied (string and bool only).
:param name: name of device :type name: str - :param new_values: list of settings with new values and its types - [[key1, key2, value, default_type_str]] - key1: first-level key of setting (eg "connection") - key2: second-level key of setting (eg "uuid") - value: new value - default_type_str: dbus type of new value to be used - if the setting does not already exist; - if None, the type is inferred from - value (string and bool only) - :type new_values: [[key1, key2, value, default_type_str], ...] - key1: str - key2: str - value: - default_type_str: str + :param new_values: + | list of settings with new values and its types + | [[key1, key2, value, default_type_str]] + | key1: first-level key of setting (eg "connection") + | key2: second-level key of setting (eg "uuid") + | value: new value + | default_type_str: + + dbus type of new value to be used + if the setting does not already exist; + if ``None``, the type is inferred from + value (string and bool only) + :type new_values: + | [[key1, key2, value, default_type_str], ...] + | key1: str + | key2: str + | value: + | default_type_str: str :raise UnknownDeviceError: if device is not found :raise SettingsNotFoundError: if settings were not found - (eg for "wlan0") + (eg for "wlan0") """ settings_paths = _device_settings(name) if not settings_paths: diff --git a/pyanaconda/ui/common.py b/pyanaconda/ui/common.py index 5c128d5..78f8fd0 100644 --- a/pyanaconda/ui/common.py +++ b/pyanaconda/ui/common.py @@ -709,10 +709,10 @@ def collect_categories(mask_paths, displaymode): return categories
def collectCategoriesAndSpokes(paths, klass, displaymode): - """collects categories and spokes to be displayed on this Hub + """Collects categories and spokes to be displayed on this Hub
:param paths: dictionary mapping categories, spokes, and hubs to their - their respective search path(s) + their respective search path(s) :return: dictionary mapping category class to list of spoke classes :rtype: dictionary[category class] -> [ list of spoke classes ] """ diff --git a/pyanaconda/ui/gui/utils.py b/pyanaconda/ui/gui/utils.py index 676416f..05737a9 100644 --- a/pyanaconda/ui/gui/utils.py +++ b/pyanaconda/ui/gui/utils.py @@ -146,11 +146,12 @@ def gtk_batch_map(action, items, args=(), pre_func=None, batch_size=1): time. If a pre-processing function is given it is mapped on the items first before the action happens in the main thread.
- MUST NOT BE CALLED NOR WAITED FOR FROM THE MAIN THREAD. + .. DANGER:: + MUST NOT BE CALLED NOR WAITED FOR FROM THE MAIN THREAD.
:param action: any action that has to be done on the items in the main thread - :type action: (action_item, *args) -> None + :type action: (action_item, *args) -> None :param items: an iterable of items that the action should be mapped on :type items: iterable :param args: additional arguments passed to the action function diff --git a/pyanaconda/ui/tui/__init__.py b/pyanaconda/ui/tui/__init__.py index 18feafb..bb435c9 100644 --- a/pyanaconda/ui/tui/__init__.py +++ b/pyanaconda/ui/tui/__init__.py @@ -56,7 +56,7 @@ def exception_msg_handler(event, data): class TextUserInterface(ui.UserInterface): """This is the main class for Text user interface.
- .. inheritance-diagram:: SourceSpoke + .. inheritance-diagram:: TextUserInterface :parts: 3 """
diff --git a/pyanaconda/ui/tui/hubs/__init__.py b/pyanaconda/ui/tui/hubs/__init__.py index 1736876..24eb385 100644 --- a/pyanaconda/ui/tui/hubs/__init__.py +++ b/pyanaconda/ui/tui/hubs/__init__.py @@ -26,14 +26,14 @@
class TUIHub(TUIObject, common.Hub): """Base Hub class implementing the pyanaconda.ui.common.Hub interface. - It uses text based categories to look for relevant Spokes and manages - all the spokes it finds to have the proper category. + It uses text based categories to look for relevant Spokes and manages + all the spokes it finds to have the proper category.
- :param categories: list all the spoke categories to be displayed in this Hub - :type categories: list of strings + :param categories: list all the spoke categories to be displayed in this Hub + :type categories: list of strings
- :param title: title for this Hub - :type title: str + :param title: title for this Hub + :type title: str
.. inheritance-diagram:: TUIHub :parts: 3 diff --git a/pyanaconda/ui/tui/spokes/__init__.py b/pyanaconda/ui/tui/spokes/__init__.py index fbf9366..06445a3 100644 --- a/pyanaconda/ui/tui/spokes/__init__.py +++ b/pyanaconda/ui/tui/spokes/__init__.py @@ -36,14 +36,14 @@ # pylint: disable=abstract-method class TUISpoke(TUIObject, tui.Widget, Spoke): """Base TUI Spoke class implementing the pyanaconda.ui.common.Spoke API. - It also acts as a Widget so we can easily add it to Hub, where is shows - as a summary box with title, description and completed checkbox. + It also acts as a Widget so we can easily add it to Hub, where is shows + as a summary box with title, description and completed checkbox.
- :param title: title of this spoke - :type title: str + :param title: title of this spoke + :type title: str
- :param category: category this spoke belongs to - :type category: string + :param category: category this spoke belongs to + :type category: string
.. inheritance-diagram:: TUISpoke :parts: 3
From: Jiri Konecny jkonecny@redhat.com
Without it the diagrams was not created. --- scripts/make-sphinx-docs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/make-sphinx-docs b/scripts/make-sphinx-docs index 54c3aaa..7d00926 100755 --- a/scripts/make-sphinx-docs +++ b/scripts/make-sphinx-docs @@ -28,7 +28,7 @@ if [ -z "$DISPLAY" ]; then fi # Pass the script anything to skip re-initializing the chroot [ -z "$1" ] && mock -r $MOCKCFG --init -mock -r $MOCKCFG -i anaconda-gui -i python3-sphinx -i python3-sphinx_rtd_theme -i ostree +mock -r $MOCKCFG -i anaconda-gui -i python3-sphinx -i python3-sphinx_rtd_theme -i ostree -i graphviz mock -r $MOCKCFG --copyin $PWD /builddir/anaconda/ # Note that DISPLAY is needed to make GTK happy, so this needs to be run from a system with a GUI mock -r $MOCKCFG --chroot "cd /builddir/anaconda/docs/; DISPLAY=$DISPLAY make -f Makefile.am html"
@bcl I found that the script needs graphviz package so I add it. Please look on it and give me ACK if it's ok.
I also found my error when one class have bad class for diagram. Fixed now.
Removed label: ACK.
Added label: ACK.
Closed.
Pushed
anaconda-patches@lists.fedorahosted.org