summarylogtreecommitdiffstats
path: root/amar.py
diff options
context:
space:
mode:
authorElrondo462019-03-27 07:27:48 +0100
committerElrondo462019-03-27 07:27:48 +0100
commitb46623d6c7e490cb770d24883546f3a63a46cb4b (patch)
treeb4f437d1000646d9e958234013c2752971347be7 /amar.py
parent7543671e9bdca5693790f0f6101539554b62c03c (diff)
downloadaur-amar-installer.tar.gz
Remove AMAR and goodbye
Diffstat (limited to 'amar.py')
-rw-r--r--amar.py93
1 files changed, 0 insertions, 93 deletions
diff --git a/amar.py b/amar.py
deleted file mode 100644
index a0d351b98829..000000000000
--- a/amar.py
+++ /dev/null
@@ -1,93 +0,0 @@
-#!/usr/bin/python
-# Created by Baba Orhum
-# NO MORE THIRD PARTS OF CODE SPECIAL THANKS FOR MORAL SUPPORT OF TUXNVAPE
-# AND MY DEVEL TEACHER WASCAR
-
-import os
-import gi
-from threading import Thread
-gi.require_version('Gtk', '3.0')
-from gi.repository import Gtk
-from gi.overrides import GLib
-
-class Handler:
- def onDestroy(self, *args):
- Gtk.main_quit()
-
- def onClickActive(self, button):
- buttonactive.set_sensitive(False) # Now the button is greyed, working :)
- buttonactive.set_label('ATTENDEZ SVP') # Sure the button text change to this
- thread = Thread(target=pressActive)
- thread.daemon = True
- thread.start()
-
-amarpath = "/usr/share/amar/amar.glade"
-builder = Gtk.Builder()
-builder.add_from_file(amarpath)
-builder.connect_signals(Handler())
-
-os.system("xrdb -load /dev/null")
-
-pacmanfichier = "/etc/pacman.conf"
-buttonactive = builder.get_object("buttonActive")
-
-def errorButtons():
- dialog = Gtk.MessageDialog(parent=Gtk.Window(), flags=0, message_type=Gtk.MessageType.ERROR,
- buttons=Gtk.ButtonsType.OK, text="FATAL")
- dialog.format_secondary_text("Erreur dans l'execution vérifiez les permissions")
- dialog.run()
- dialog.destroy()
- Gtk.main_quit()
-
-try:
- etatamar = 0
- searchfile = open(pacmanfichier, "r")
- for line in searchfile:
- if "amar.conf" in line:
- etatamar = 1
- searchfile.close()
-
-except OSError:
- errorButtons()
-
-buttonactive.set_label('DESACTIVER' if etatamar == 1 else 'ACTIVER')
-
-configamar = "\n#Do not disable AMAR manually if you use the app\nInclude = /etc/pacman.d/amar.conf\n"
-
-def success():
- buttonactive.set_sensitive(True)
- buttonactive.set_label('DESACTIVER' if etatamar == 1 else 'ACTIVER')
-
-def pressActive():
- global etatamar
- if etatamar == 0:
- try:
- with open(pacmanfichier, "a") as ecrire:
- ecrire.write(configamar)
- ecrire.close()
- os.system("pacman -Syy")
- etatamar = 1
- ecrire.close()
- GLib.idle_add(success)
- except OSError:
- GLib.idle_add(errorButtons)
- else:
- try:
- with open((pacmanfichier), "r") as f:
- lines = f.readlines()
- lines.remove("#Do not disable AMAR manually if you use the app\n")
- lines.remove("Include = /etc/pacman.d/amar.conf\n")
- with open((pacmanfichier), "w") as new_f:
- for line in lines:
- new_f.write(line)
- os.system ("pacman -Syy")
- etatamar = 0
- f.close()
- new_f.close()
- GLib.idle_add(success)
- except OSError:
- GLib.idle_add(errorButtons)
-
-window = builder.get_object("mainWindow")
-window.show_all()
-Gtk.main() \ No newline at end of file