Make get_infos out of class

merge-requests/64/head
Huluti 2016-12-04 19:17:48 +01:00
parent b3afcd13ce
commit 989a5eafd5
1 changed files with 11 additions and 11 deletions

View File

@ -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: