From ddb3ad861280f2a83057168db6c7a0812478689a Mon Sep 17 00:00:00 2001 From: karasu Date: Sun, 30 Sep 2018 20:14:37 +0200 Subject: [PATCH] Do not crash if self.settings cannot be loaded. Need to check why this happens, though. --- README.md | 2 +- src/info.py | 2 +- src/pages/slides.py | 47 ++++++++++++++++++++++++++------------------- update.info | 2 +- 4 files changed, 30 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index 4c8b70829..f0b253449 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ You are viewing the `0.16.x` branch (stable). |Development Stage|Branch|Version| Code Status| ----------------- | -------------- | -------------- | -------- | -|Cnchi Stable|0.16.x|![0.16.8](https://img.shields.io/github/release/antergos/cnchi.svg)|Frozen| +|Cnchi Stable|0.16.x|![0.16.9](https://img.shields.io/github/release/antergos/cnchi.svg)|Frozen| |Cnchi Development|0.17.x|![0.17.1](https://img.shields.io/github/release/antergos/cnchi/all.svg)|Development| |Cnchi Next (UI agnostic)|master|master|Development| diff --git a/src/info.py b/src/info.py index a252e545c..783bec522 100755 --- a/src/info.py +++ b/src/info.py @@ -29,7 +29,7 @@ """ Set some Cnchi global constants """ -CNCHI_VERSION = "0.16.8" +CNCHI_VERSION = "0.16.9" """ Cnchi version """ CNCHI_WEBSITE = "http://www.antergos.com" diff --git a/src/pages/slides.py b/src/pages/slides.py index 5e379f628..cc1ab56c0 100644 --- a/src/pages/slides.py +++ b/src/pages/slides.py @@ -134,6 +134,8 @@ def reveal_next_slide(self): # Reveal image self.revealer.set_reveal_child(True) except FileNotFoundError: + # FIXME: Installation process finishes before we can read these values ?¿ + logging.warning("Can't get configuration values.") self.stop_slideshow = True def image_revealed(self, revealer, _revealed): @@ -210,10 +212,8 @@ def manage_events_from_cb_queue(self): self.downloads_progress_bar.set_fraction(float(event[1])) elif event[0] == 'progress_bar_show_text': if event[1]: - # self.progress_bar.set_show_text(True) self.progress_bar.set_text(event[1]) else: - # self.progress_bar.set_show_text(False) self.progress_bar.set_text("") elif event[0] == 'progress_bar': if event[1] == 'hide': @@ -246,6 +246,8 @@ def manage_events_from_cb_queue(self): logging.debug( 'Adding %s to cache_pkgs_md5_check_failed list', event[1]) self.settings.set('cache_pkgs_md5_check_failed', event[1]) + else: + logging.warning("Event %s not recognised. Ignoring.", event[0]) self.callback_queue.task_done() @@ -279,24 +281,29 @@ def installation_finished(self): self.stop_slideshow = True - bootloader_install = self.settings.get('bootloader_install') - bootloader_install_ok = self.settings.get('bootloader_installation_successful') - - if bootloader_install and not bootloader_install_ok: - # Warn user about GRUB and ask if we should open wiki page. - boot_warn = _( - "IMPORTANT: There may have been a problem with the bootloader installation which " - "could prevent your system from booting properly. Before rebooting, you may want " - "to verify whether or not the bootloader is installed and configured.\n\n" - "The Arch Linux Wiki contains troubleshooting information:\n" - "\thttps://wiki.archlinux.org/index.php/GRUB\n\n" - "Would you like to view the wiki page now?") - response = show.question(self.get_main_window(), boot_warn) - if response == Gtk.ResponseType.YES: - import webbrowser - misc.drop_privileges() - wiki_url = 'https://wiki.archlinux.org/index.php/GRUB' - webbrowser.open(wiki_url) + try: + bootloader_install = self.settings.get('bootloader_install') + bootloader_install_ok = self.settings.get('bootloader_installation_successful') + + if bootloader_install and not bootloader_install_ok: + # Warn user about GRUB and ask if we should open wiki page. + boot_warn = _( + "IMPORTANT: There may have been a problem with the bootloader installation " + "which could prevent your system from booting properly. Before rebooting, " + "you may want to verify whether or not the bootloader is installed and " + "configured.\n\n" + "The Arch Linux Wiki contains troubleshooting information:\n" + "\thttps://wiki.archlinux.org/index.php/GRUB\n\n" + "Would you like to view the wiki page now?") + response = show.question(self.get_main_window(), boot_warn) + if response == Gtk.ResponseType.YES: + import webbrowser + misc.drop_privileges() + wiki_url = 'https://wiki.archlinux.org/index.php/GRUB' + webbrowser.open(wiki_url) + except FileNotFoundError: + # FIXME: Installation process finishes before we can read these values ?¿ + logging.warning("Can't get configuration values.") install_ok = _( "Installation Complete!\n" diff --git a/update.info b/update.info index 0eef6d0b1..6b6250f5d 100644 --- a/update.info +++ b/update.info @@ -1,2 +1,2 @@ -{"version":"0.16.8","files":[ +{"version":"0.16.9","files":[ ]}