From 989a5eafd5595a873c62c3230c4a935b39afc060 Mon Sep 17 00:00:00 2001 From: Huluti Date: Sun, 4 Dec 2016 19:17:48 +0100 Subject: [PATCH] Make get_infos out of class --- src/manjaro-hello.py | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/manjaro-hello.py b/src/manjaro-hello.py index d36f6fd..d408560 100644 --- a/src/manjaro-hello.py +++ b/src/manjaro-hello.py @@ -25,7 +25,7 @@ class ManjaroHello(Gtk.Window): self.preferences = {"autostart": os.path.exists(self.autostart_path)} self.save_preferences() - self.infos = self.get_infos() + self.infos = get_infos() # Init language locale.setlocale(locale.LC_ALL, "") @@ -58,16 +58,6 @@ class ManjaroHello(Gtk.Window): self.window.show() - def get_infos(self): - lsb = get_lsb_information() - infos = {} - infos["codename"] = lsb.get("CODENAME", 0) - infos["release"] = lsb.get("RELEASE", 0) - infos["arch"] = "64-bit" if os.uname()[4] else "32-bit" - infos["live"] = os.path.exists("/bootmnt/manjaro") or os.path.exists("/run/miso/bootmnt/manjaro") - - return infos - def change_autostart(self, state): if state and not os.path.exists(self.autostart_path): try: @@ -134,6 +124,16 @@ class ManjaroHello(Gtk.Window): def on_delete_window(self, *args): Gtk.main_quit(*args) +def get_infos(): + lsb = get_lsb_information() + infos = {} + infos["codename"] = lsb.get("CODENAME", 0) + infos["release"] = lsb.get("RELEASE", 0) + infos["arch"] = "64-bit" if os.uname()[4] else "32-bit" + infos["live"] = os.path.exists("/bootmnt/manjaro") or os.path.exists("/run/miso/bootmnt/manjaro") + + return infos + def get_lsb_information(): lsb = {} try: