summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--usr/share/mageiawelcome/helpers.py26
-rw-r--r--usr/share/mageiawelcome/mageiawelcome.py102
2 files changed, 64 insertions, 64 deletions
diff --git a/usr/share/mageiawelcome/helpers.py b/usr/share/mageiawelcome/helpers.py
index 7fc43e3..c13fb3e 100644
--- a/usr/share/mageiawelcome/helpers.py
+++ b/usr/share/mageiawelcome/helpers.py
@@ -53,19 +53,19 @@ def get_listapp():
mycsv = csv.reader(f,delimiter='|')
next(mycsv)
for r in mycsv:
- if (r[5] == 'false'):
- start_btn = ""
- else:
- start_btn = "<button class='cmd small green' data-run='"+ r[5] + "'><i class='icon-ok-sign'> </i>" + launch +"</button>"
- if (r[6] != ''):
- label = "<span class='label red'>" + r[6] + "</span>"
- else:
- label = ""
- if ( is_installed(r[1]) != 0):# NOT INSTALLED
- listapp += "<li class='" + r[3] +"' id='" + r[0] + "'><img class=icon src=img/" + r[0] + ".png /><div class='chkbox'><input type='checkbox' datasrc='" + r[1] +"'></div> \
+ if (r[5] == 'false'):
+ start_btn = ""
+ else:
+ start_btn = "<button class='cmd small green' data-run='"+ r[5] + "'><i class='icon-ok-sign'> </i>" + launch +"</button>"
+ if (r[6] != ''):
+ label = "<span class='label red'>" + r[6] + "</span>"
+ else:
+ label = ""
+ if ( is_installed(r[1]) != 0):# NOT INSTALLED
+ listapp += "<li class='" + r[3] +"' id='" + r[0] + "'><img class=icon src=img/" + r[0] + ".png /><div class='chkbox'><input type='checkbox' datasrc='" + r[1] +"'></div> \
<h6>" + r[2] + "</h6><p class='description'>" + r[4] + "</p>" + label + "<button class='inst small' data-rpm='" + r[1] + "'><i class='icon-circle-arrow-down'> </i>" + install +"</button></li>"
- else: # INSTALLED
- listapp += "<li class='urpme " + r[3] +"' id='" + r[0] + "'><img class=icon src=img/" + r[0] + ".png /><div class='chkbox'></div> \
+ else: # INSTALLED
+ listapp += "<li class='urpme " + r[3] +"' id='" + r[0] + "'><img class=icon src=img/" + r[0] + ".png /><div class='chkbox'></div> \
<h6>" + r[2] + "</h6><p class='description'>" + r[4] + "</p>" + start_btn + label + "</li>"
return listapp
- \ No newline at end of file
+
diff --git a/usr/share/mageiawelcome/mageiawelcome.py b/usr/share/mageiawelcome/mageiawelcome.py
index 072738a..8c5f526 100644
--- a/usr/share/mageiawelcome/mageiawelcome.py
+++ b/usr/share/mageiawelcome/mageiawelcome.py
@@ -180,56 +180,56 @@ def main():
msg = json.loads(msg)
again = True
if msg == "close":
- my_quit_wrapper()
- elif msg == "checkbox checked":
- if os.path.exists(home + "/.mageiawelcome/norun.flag"):
- os.system("rm -rf " + home + "/.mageiawelcome/norun.flag")
- elif msg == "checkbox unchecked":
- os.system("mkdir -p " + home + "/.mageiawelcome")
- os.system("touch " + home + "/.mageiawelcome/norun.flag")
- elif msg.startswith("http"):
- os.system("xdg-open " + msg)
- elif msg == "irc":
- irc_client = get_irc_client()
- if irc_client == "none":
- if desktop == "KDE":
- subprocess.Popen("gurpmi konversation", shell=True)
- else:
- subprocess.Popen("gurpmi hexchat", shell=True)
- else: os.system(irc_client)
- elif msg.startswith("run"):
- args = shlex.split(msg)
- args.pop(0)
- print(args)
- if args[0] == "xvt":
- os.chdir(home)
- subprocess.Popen(args)
-
- elif msg.startswith("gurpmi"):
- print(msg)
- args = shlex.split(msg)
- cat = args.pop(1)
- print(args)
- proc = subprocess.Popen(args, stdout=subprocess.PIPE)
- proc.wait()
- print(proc.returncode)
- if (proc.returncode == 0):
- listapp = get_listapp()
- web_send('$("ul#lista_applikacji").html("'+listapp+'");$("li#'+cat+'").trigger("click");')
- else: pass
- elif msg.startswith("install_selected"):
- print(msg)
- msg2 = msg.replace('install_selected','gurpmi')
- args = shlex.split(msg2)
- cat = args.pop(1)
- print(args)
- proc = subprocess.Popen(args, stdout=subprocess.PIPE)
- proc.wait()
- print(proc.returncode)
- if (proc.returncode == 0):
- listapp = get_listapp()
- web_send('$("ul#lista_applikacji").html("'+listapp+'");$("li#'+cat+'").trigger("click");')
- else: pass
+ my_quit_wrapper()
+ elif msg == "checkbox checked":
+ if os.path.exists(home + "/.mageiawelcome/norun.flag"):
+ os.system("rm -rf " + home + "/.mageiawelcome/norun.flag")
+ elif msg == "checkbox unchecked":
+ os.system("mkdir -p " + home + "/.mageiawelcome")
+ os.system("touch " + home + "/.mageiawelcome/norun.flag")
+ elif msg.startswith("http"):
+ os.system("xdg-open " + msg)
+ elif msg == "irc":
+ irc_client = get_irc_client()
+ if irc_client == "none":
+ if desktop == "KDE":
+ subprocess.Popen("gurpmi konversation", shell=True)
+ else:
+ subprocess.Popen("gurpmi hexchat", shell=True)
+ else: os.system(irc_client)
+ elif msg.startswith("run"):
+ args = shlex.split(msg)
+ args.pop(0)
+ print(args)
+ if args[0] == "xvt":
+ os.chdir(home)
+ subprocess.Popen(args)
+
+ elif msg.startswith("gurpmi"):
+ print(msg)
+ args = shlex.split(msg)
+ cat = args.pop(1)
+ print(args)
+ proc = subprocess.Popen(args, stdout=subprocess.PIPE)
+ proc.wait()
+ print(proc.returncode)
+ if (proc.returncode == 0):
+ listapp = get_listapp()
+ web_send('$("ul#lista_applikacji").html("'+listapp+'");$("li#'+cat+'").trigger("click");')
+ else: pass
+ elif msg.startswith("install_selected"):
+ print(msg)
+ msg2 = msg.replace('install_selected','gurpmi')
+ args = shlex.split(msg2)
+ cat = args.pop(1)
+ print(args)
+ proc = subprocess.Popen(args, stdout=subprocess.PIPE)
+ proc.wait()
+ print(proc.returncode)
+ if (proc.returncode == 0):
+ listapp = get_listapp()
+ web_send('$("ul#lista_applikacji").html("'+listapp+'");$("li#'+cat+'").trigger("click");')
+ else: pass
if again: pass
else: time.sleep(0.1)
@@ -244,7 +244,7 @@ def my_quit_wrapper(fun):
Global.set_quit()
return x
return fun2
-
+
if __name__ == '__main__': # <-- this line is optional
my_quit_wrapper(main)()