diff options
author | Elrondo46 | 2018-12-13 22:26:32 +0100 |
---|---|---|
committer | Elrondo46 | 2018-12-13 22:26:32 +0100 |
commit | d70b42810ab847e9e03717fc92c2512a40ab363d (patch) | |
tree | df2f81f7596b02e4487716f7fa0bc92a45283e69 | |
parent | b94276f0150b53c035bdcd2e72ee77fa6dc9fce1 (diff) | |
download | aur-d70b42810ab847e9e03717fc92c2512a40ab363d.tar.gz |
now final beta
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 7 | ||||
-rw-r--r-- | amar.glade | 38 | ||||
-rw-r--r-- | amar.py | 105 |
4 files changed, 63 insertions, 91 deletions
@@ -15,11 +15,11 @@ pkgbase = amar-installer source = amar.glade source = amarban.png source = org.tnv.amar.policy - sha256sums = 64c4230895e40e12c268e6a5a02723e166ebe193a6d46786db82889a0d7de782 + sha256sums = 0408fb3f25f792917eef5d57ff2f44819f624ba43963a2d905acbe3793fc80b4 sha256sums = 874700067f446dff59f8e4e6c3b14519ca8afdf31742af629343c80002c71376 sha256sums = c5dbfca766050bdbfd36866c1f479ca8039aae80fa8b2847b376c05087d1364c sha256sums = d8fafeb25a8b2368803565ed62ba147aa38adfe57089fe44125f5e07eea3d21b - sha256sums = ce1ef2d94876564ab1c5cdfc8bf95f102fe03c04f545c7e6bbb191cf825c0c66 + sha256sums = a46c4d4a5b2c8c41f2273d3d6c33d4f36f160e9dc820b929db082ed2414ed02b sha256sums = 2edefaa6f3143bc2ac3f6a11d069d2a72fc968e492f8e96a2a7e2c9423a4237a sha256sums = dcf05a9d8c5cfe2cc23523eaab9bbd30932b3d2c68ad8d38edbdcad372053920 @@ -1,7 +1,7 @@ # Maintainer: Elrondo46 TuxnVape <elrond94@hotmail.com> pkgname=amar-installer -pkgver=1.9.9.b2 +pkgver=1.9.10.fb pkgrel=1 pkgdesc="Install AMAR repository" arch=('x86_64') @@ -17,14 +17,13 @@ source=("amar.py" "amarban.png" "org.tnv.amar.policy") -sha256sums=('64c4230895e40e12c268e6a5a02723e166ebe193a6d46786db82889a0d7de782' +sha256sums=('0408fb3f25f792917eef5d57ff2f44819f624ba43963a2d905acbe3793fc80b4' '874700067f446dff59f8e4e6c3b14519ca8afdf31742af629343c80002c71376' 'c5dbfca766050bdbfd36866c1f479ca8039aae80fa8b2847b376c05087d1364c' 'd8fafeb25a8b2368803565ed62ba147aa38adfe57089fe44125f5e07eea3d21b' - 'ce1ef2d94876564ab1c5cdfc8bf95f102fe03c04f545c7e6bbb191cf825c0c66' + 'a46c4d4a5b2c8c41f2273d3d6c33d4f36f160e9dc820b929db082ed2414ed02b' '2edefaa6f3143bc2ac3f6a11d069d2a72fc968e492f8e96a2a7e2c9423a4237a' 'dcf05a9d8c5cfe2cc23523eaab9bbd30932b3d2c68ad8d38edbdcad372053920') - package() { install -Dm644 "amar.desktop" "${pkgdir}/usr/share/applications/amar.desktop" install -Dm644 "amar.py" "${pkgdir}/usr/bin/amar.py" diff --git a/amar.glade b/amar.glade index 64d306904312..6c3c86a3128f 100644 --- a/amar.glade +++ b/amar.glade @@ -19,22 +19,6 @@ <property name="orientation">vertical</property> <property name="row_spacing">5</property> <child> - <object class="GtkButton" id="buttonDesactive"> - <property name="label" translatable="yes">DESACTIVER</property> - <property name="width_request">250</property> - <property name="height_request">40</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <property name="halign">center</property> - <signal name="clicked" handler="onClickDesactive" swapped="no"/> - </object> - <packing> - <property name="left_attach">5</property> - <property name="top_attach">6</property> - </packing> - </child> - <child> <object class="GtkButton" id="buttonActive"> <property name="label" translatable="yes">ACTIVER</property> <property name="width_request">250</property> @@ -45,6 +29,7 @@ <property name="halign">center</property> <property name="valign">end</property> <property name="margin_top">9</property> + <property name="margin_bottom">9</property> <signal name="clicked" handler="onClickActive" swapped="no"/> </object> <packing> @@ -54,21 +39,6 @@ </packing> </child> <child> - <object class="GtkLabel" id="amarfinalstate"> - <property name="width_request">300</property> - <property name="height_request">40</property> - <property name="visible">True</property> - <property name="can_focus">False</property> - <property name="halign">center</property> - <property name="valign">start</property> - <property name="label" translatable="yes">label</property> - </object> - <packing> - <property name="left_attach">5</property> - <property name="top_attach">7</property> - </packing> - </child> - <child> <object class="GtkLabel"> <property name="visible">True</property> <property name="can_focus">False</property> @@ -239,6 +209,12 @@ des logiciels dont l'installation via AUR est problématique ou des logiciels qu <child> <placeholder/> </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> </child> </object> @@ -5,19 +5,22 @@ import sys 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): - pressActive() - Gtk.main() - def onClickDesactive(self, button): - pressDesactive() - Gtk.main() + 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() @@ -27,9 +30,7 @@ builder.connect_signals(Handler()) os.system("xrdb -load /dev/null") pacmanfichier = "/etc/pacman.conf" -amarfinalstate = builder.get_object("amarfinalstate") buttonactive = builder.get_object("buttonActive") -buttondesactive = builder.get_object("buttonDesactive") try: etatamar = 0 @@ -43,64 +44,60 @@ except OSError: print("pacman.conf non acessible, donnez le chemin vers votre fichier") sys.exit(1) +if etatamar == 1: + buttonactive.set_label('DESACTIVER') +else: + buttonactive.set_label('ACTIVER') + + configamar = "\n#Do not disable AMAR manually if you use the app\nInclude = /etc/pacman.d/amar.conf\n" def errorButtons(): - dialog = Gtk.MessageDialog(None, 0, Gtk.MessageType.ERROR, Gtk.ButtonsType.OK, "ERREUR") - dialog.format_secondary_text("Fichier pacman.conf non accessible en écriture\nVérifiez vos droit et relancer" - " le script\nVérifier aussi que vous ne faite une mise à jours en même temps") - dialog.run() - dialog.destroy() + print("bad") -def pressActive(): - buttonactive.set_sensitive(False) - buttondesactive.set_sensitive(True) - try: - with open(pacmanfichier, "a") as ecrire: - ecrire.write(configamar) - ecrire.close() - os.system("pacman -Syy") - amarfinalstate.set_markup('<span foreground="blue" face="sans">ACTIF</span>') - etatamar = 1 - ecrire.close() - except OSError: - errorButtons() +def success1(): + buttonactive.set_sensitive(True) + buttonactive.set_label('DESACTIVER') -def pressDesactive(): +def success2(): buttonactive.set_sensitive(True) - buttondesactive.set_sensitive(False) - 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") - amarfinalstate.set_markup('<span foreground="red" face="sans">INACTIF</span>') - etatamar = 0 - f.close() - new_f.close() - except OSError: - errorButtons() + buttonactive.set_label('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(success1) + except OSError: + 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(success2) + except OSError: + errorButtons() -print(etatamar) -if etatamar == 0: - buttonactive.set_sensitive(True) - buttondesactive.set_sensitive(False) -else: - buttondesactive.set_sensitive(True) - buttonactive.set_sensitive(False) -if etatamar == 0: - amarfinalstate.set_markup('<span foreground="red" face="sans">INACTIF</span>') # on active le depot AMAR, donc on ecrit sur le fichier. -else: - amarfinalstate.set_markup('<span foreground="blue" face="sans">ACTIF</span>') # on active le depot AMAR, donc on ecrit sur le fichier. +print(etatamar) window = builder.get_object("mainWindow") window.show_all() -Gtk.main()
\ No newline at end of file +Gtk.main() |