summaryrefslogtreecommitdiffstats
path: root/usr/share/mageiawelcome/mageiawelcome.py
diff options
context:
space:
mode:
Diffstat (limited to 'usr/share/mageiawelcome/mageiawelcome.py')
-rw-r--r--usr/share/mageiawelcome/mageiawelcome.py102
1 files changed, 51 insertions, 51 deletions
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)()