[master 3/3] Display the name of the addon while executing it
by dashea
From: "Brian C. Lane" <bcl(a)redhat.com>
This will display 'Executing com_redhat_kdump addon' when the addon's
execute method is called.
---
pyanaconda/addons.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/pyanaconda/addons.py b/pyanaconda/addons.py
index 1f2d01f..b61002e 100644
--- a/pyanaconda/addons.py
+++ b/pyanaconda/addons.py
@@ -25,6 +25,9 @@
import functools
from pykickstart.sections import Section
+from pyanaconda.progress import progress_message
+from pyanaconda.i18n import N_
+
def collect_addon_paths(toplevel_addon_paths, ui_subdir="gui"):
"""This method looks into the directories present
in toplevel_addon_paths and registers each subdirectory
@@ -81,6 +84,7 @@ def execute(self, storage, ksdata, instClass, users):
"""This method calls execute on all the registered addons."""
for v in self.__dict__.values():
if hasattr(v, "execute"):
+ progress_message(N_("Executing %s addon") % v.name)
v.execute(storage, ksdata, instClass, users)
def setup(self, storage, ksdata, instClass):
--
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/8f5ef7a1aabf6175dda485c97a...
8 years, 3 months
[master 2/3] Add a finished method to spokes (#1300499)
by dashea
From: "Brian C. Lane" <bcl(a)redhat.com>
This method can be used to clean up a spoke before starting the
installation. The method is called when continue is clicked on the
summary hub. It is completely optional and if it doesn't exist on the
spoke it will be skipped.
Add finished method to the Network spoke to handle killing nmce and
disconnecting callbacks so that they don't cause problems if the
installation triggers network changes.
---
pyanaconda/ui/common.py | 8 ++++++++
pyanaconda/ui/gui/hubs/summary.py | 9 +++++++++
pyanaconda/ui/gui/spokes/network.py | 7 +++++++
3 files changed, 24 insertions(+)
diff --git a/pyanaconda/ui/common.py b/pyanaconda/ui/common.py
index 4596045..1a392ea 100644
--- a/pyanaconda/ui/common.py
+++ b/pyanaconda/ui/common.py
@@ -348,6 +348,14 @@ def exit_logger(self):
"""
log.debug("Left spoke: %s", self.__class__.__name__)
+ def finished(self):
+ """Called when exiting the Summary Hub
+
+ This can be used to cleanup the spoke before continuing the
+ installation. This method is optional.
+ """
+ pass
+
# Inherit abstract methods from Spoke
# pylint: disable=abstract-method
class NormalSpoke(Spoke):
diff --git a/pyanaconda/ui/gui/hubs/summary.py b/pyanaconda/ui/gui/hubs/summary.py
index 847f722..160133f 100644
--- a/pyanaconda/ui/gui/hubs/summary.py
+++ b/pyanaconda/ui/gui/hubs/summary.py
@@ -64,3 +64,12 @@ def __init__(self, data, storage, payload, instclass):
else:
self._checker = DirInstallSpaceChecker(storage, payload)
+ # Add a continue-clicked handler
+ self.window.connect("continue-clicked", self._on_continue_clicked)
+
+ def _on_continue_clicked(self, win, user_data=None):
+ """Call finished method of spokes when leaving the hub.
+ """
+ for spoke in sorted(self._spokes.values(), key=lambda x: x.__class__.__name__):
+ if hasattr(spoke, "finished"):
+ spoke.finished()
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index e38cef8..7460fc3 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -1495,6 +1495,13 @@ def on_back_clicked(self, button):
self.clear_info()
NormalSpoke.on_back_clicked(self, button)
+ def finished(self):
+ """Disconnect callbacks
+
+ Called when leaving summary hub
+ """
+ self.network_control_box.kill_nmce(msg="finished with network spoke")
+ self.network_control_box.disconnect_client_callbacks()
class NetworkStandaloneSpoke(StandaloneSpoke):
"""
--
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/1381eb8acb8559a6014c5b80f1...
8 years, 3 months
[master 1/3] Handle DeviceConfiguration with con = None (#1300499)
by dashea
From: "Brian C. Lane" <bcl(a)redhat.com>
In some cases self.con can be None, check for this and don't crash.
---
pyanaconda/ui/gui/spokes/network.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/network.py b/pyanaconda/ui/gui/spokes/network.py
index 3a92084..e38cef8 100644
--- a/pyanaconda/ui/gui/spokes/network.py
+++ b/pyanaconda/ui/gui/spokes/network.py
@@ -217,14 +217,16 @@ def __init__(self, device=None, con=None):
def get_device_type(self):
if self.device:
return self.device.get_device_type()
- else:
+ elif self.con:
return self.setting_types.get(self.con.get_connection_type(), None)
+ else:
+ return None
def get_iface(self):
iface = None
if self.device:
iface = self.device.get_iface()
- else:
+ elif self.con:
iface = self.con.get_setting_connection().get_interface_name()
if not iface:
mac = self.con.get_setting_wired().get_mac_address()
--
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/eec538956bd3b11fc14712db9e...
8 years, 3 months