From 5f6547ab492753a7187669989524aecb0e5a8a75 Mon Sep 17 00:00:00 2001 From: Thomas Castleman Date: Wed, 22 Sep 2021 23:01:21 -0400 Subject: [PATCH 1/4] further fixes to cpu info grabber --- usr/share/system-installer/UI/report.py | 29 +++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/usr/share/system-installer/UI/report.py b/usr/share/system-installer/UI/report.py index a133e405..811804ce 100755 --- a/usr/share/system-installer/UI/report.py +++ b/usr/share/system-installer/UI/report.py @@ -671,6 +671,7 @@ def cpu_info(): sentenal = 0 output = [] backup_speed = None + count = 0 while sentenal < 7: for each in info: if sentenal == 0: @@ -689,18 +690,46 @@ def cpu_info(): if "CPU max MHz:" in each: output.append(each) sentenal += 1 + count = 0 + elif count == len(info): + count = 0 + sentenal += 1 + output.append("CPU max MHz:\t\t\tUnknown") + else: + count += 1 elif sentenal == 4: if "L2 cache:" in each: output.append(each) sentenal += 1 + count = 0 + elif count == len(info): + count = 0 + sentenal += 1 + output.append("L2 cache:\t\t\tUnknown") + else: + count += 1 elif sentenal == 5: if "L3 cache:" in each: output.append(each) sentenal += 1 + count = 0 + elif count == len(info): + count = 0 + sentenal += 1 + output.append("L3 cache:\t\t\tUnknown") + else: + count += 1 elif sentenal == 6: if "CPU MHz:" in each: backup_speed = each sentenal += 1 + count = 0 + elif count == len(info): + count = 0 + sentenal += 1 + backup_speed = "Unknown" + else: + count += 1 speed_dir = "/sys/devices/system/cpu/cpu0/cpufreq/" if path.exists(speed_dir): if path.exists(speed_dir + "bios_limit"): From 7b517fb2b9cc72d6e2a8f87b1f101d044460f2fe Mon Sep 17 00:00:00 2001 From: Thomas Castleman Date: Wed, 22 Sep 2021 23:21:39 -0400 Subject: [PATCH 2/4] minor bug fix clear the text buffer when aborting and restarting an installation report --- usr/share/system-installer/UI/error.py | 3 +++ usr/share/system-installer/UI/report.py | 19 ++++++++----------- usr/share/system-installer/UI/success.py | 3 +++ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/usr/share/system-installer/UI/error.py b/usr/share/system-installer/UI/error.py index 12f33f75..979f3664 100755 --- a/usr/share/system-installer/UI/error.py +++ b/usr/share/system-installer/UI/error.py @@ -42,6 +42,9 @@ def main_menu(self, widget): """Main Menu""" self.clear_window() + if hasattr(self, 'text_buffer'): + self.text_buffer.set_text("", len=0) + self.label = Gtk.Label() self.label.set_markup("" + self.display + "") self.label.set_justify(Gtk.Justification.CENTER) diff --git a/usr/share/system-installer/UI/report.py b/usr/share/system-installer/UI/report.py index 811804ce..d9973107 100755 --- a/usr/share/system-installer/UI/report.py +++ b/usr/share/system-installer/UI/report.py @@ -543,17 +543,14 @@ def message_accept(self, widget): """Accept Message Input in GUI""" if self.custom.get_active(): self.custom_setting = True - if hasattr(self, 'text_buffer'): - self.grid.attach(self.custom_message, 1, 8, 8, 4) - else: - self.text_buffer = Gtk.TextBuffer() - self.text_buffer.set_text(self.default_message, - len(self.default_message)) - self.custom_message = Gtk.TextView.new_with_buffer(self.text_buffer) - self.custom_message.set_editable(True) - self.custom_message.set_accepts_tab(True) - self.custom_message = self._set_default_margins(self.custom_message) - self.grid.attach(self.custom_message, 1, 8, 8, 4) + self.text_buffer = Gtk.TextBuffer() + self.text_buffer.set_text(self.default_message, + len(self.default_message)) + self.custom_message = Gtk.TextView.new_with_buffer(self.text_buffer) + self.custom_message.set_editable(True) + self.custom_message.set_accepts_tab(True) + self.custom_message = self._set_default_margins(self.custom_message) + self.grid.attach(self.custom_message, 1, 8, 8, 4) else: self.grid.remove(self.custom_message) diff --git a/usr/share/system-installer/UI/success.py b/usr/share/system-installer/UI/success.py index e1242c52..79d50b4c 100755 --- a/usr/share/system-installer/UI/success.py +++ b/usr/share/system-installer/UI/success.py @@ -65,6 +65,9 @@ def main_menu(self, widget): """Main Success Window""" self.clear_window() + if hasattr(self, 'text_buffer'): + self.text_buffer.set_text("", len=0) + text = """ \t%s has been successfully installed on your computer!\t """ % (self.distro) From c01011af1cbf6abb4f6711165c4b0c3f476a81bb Mon Sep 17 00:00:00 2001 From: Thomas Castleman Date: Wed, 22 Sep 2021 23:30:34 -0400 Subject: [PATCH 3/4] bug fixes to fix the bug when i tried to fix the bug when ... --- usr/share/system-installer/UI/error.py | 2 +- usr/share/system-installer/UI/success.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/usr/share/system-installer/UI/error.py b/usr/share/system-installer/UI/error.py index 979f3664..fb1ef61d 100755 --- a/usr/share/system-installer/UI/error.py +++ b/usr/share/system-installer/UI/error.py @@ -43,7 +43,7 @@ def main_menu(self, widget): self.clear_window() if hasattr(self, 'text_buffer'): - self.text_buffer.set_text("", len=0) + self.text_buffer.set_text("", length=0) self.label = Gtk.Label() self.label.set_markup("" + self.display + "") diff --git a/usr/share/system-installer/UI/success.py b/usr/share/system-installer/UI/success.py index 79d50b4c..25391409 100755 --- a/usr/share/system-installer/UI/success.py +++ b/usr/share/system-installer/UI/success.py @@ -66,7 +66,7 @@ def main_menu(self, widget): self.clear_window() if hasattr(self, 'text_buffer'): - self.text_buffer.set_text("", len=0) + self.text_buffer.set_text("", length=0) text = """ \t%s has been successfully installed on your computer!\t From 0b00a7b9fdfb7918b1ee84758362ab08d887ed9f Mon Sep 17 00:00:00 2001 From: Thomas Castleman Date: Wed, 22 Sep 2021 23:41:03 -0400 Subject: [PATCH 4/4] version bump to appease the apt gods --- DEBIAN/control | 2 +- usr/bin/system-installer | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DEBIAN/control b/DEBIAN/control index f8036631..aeee855c 100644 --- a/DEBIAN/control +++ b/DEBIAN/control @@ -1,5 +1,5 @@ Package: system-installer -Version: 2.0.9 +Version: 2.1.0 Maintainer: Thomas Castleman Homepage: https://github.com/drauger-os-development/system-installer Section: admin diff --git a/usr/bin/system-installer b/usr/bin/system-installer index 8c944ec7..d64272a2 100755 --- a/usr/bin/system-installer +++ b/usr/bin/system-installer @@ -28,7 +28,7 @@ import de_control.disable as de_disable import de_control.enable as de_enable from os import path ARGC = len(argv) -VERSION = "2.0.9" +VERSION = "2.1.0" HELP = """ system-installer, Version %s