# -*- coding: utf-8 -*- import csv import os import gettext gettext.install("mageiawelcome") install = _("Install") launch = _("Launch") def get_desktop_name(x): return { '01plasma':'KDE', '02GNOME':'Gnome', 'gnome': 'Gnome Wayland', 'gnome-xorg': 'Gnome X.org', 'LXDE':'LXDE', 'MATE':'Mate', 'Cinnamon':'Cinnamon', '23E17':'Enlightenment', '07IceWM':'IceWM', '26Openbox':'Openbox', '03WindowMaker':'WindowMaker', '09Fvwm2':'Fvwm2', }.get(x,'Other') def get_desktop_name2(x): return { 'KDE':'KDE', 'XFCE':'Xfce', 'LXQt':'LXQt', 'MATE':'Mate', 'GNOME':'Gnome' 'X-Cinnamon':'Cinnamon', }.get(x,'unknown') def is_installed(name): return os.WEXITSTATUS(os.system('rpm -q --quiet ' + name)) def get_listapp(): listapp = '' with open("apps.csv", 'rt') as f: mycsv = csv.reader(f,delimiter='|') next(mycsv) for r in mycsv: if (r[5] == 'false'): start_btn = "" else: start_btn = "" if (r[6] != ''): label = "" + r[6] + "" else: label = "" if ( is_installed(r[1]) != 0):# NOT INSTALLED listapp += "
  • \
    " + r[2] + "

    " + r[4] + "

    " + label + "
  • " else: # INSTALLED listapp += "
  • \
    " + r[2] + "

    " + r[4] + "

    " + start_btn + label + "
  • " return listapp