summarylogtreecommitdiffstats
path: root/amar.py
diff options
context:
space:
mode:
authorElrondo462018-12-14 18:30:32 +0100
committerElrondo462018-12-14 18:30:32 +0100
commit7543671e9bdca5693790f0f6101539554b62c03c (patch)
treeec034d48a27f4a246dd198f13b6900ffc43eeb76 /amar.py
parent3958935e6646078d3a2ce90f9b14db40d4ed7868 (diff)
downloadaur-7543671e9bdca5693790f0f6101539554b62c03c.tar.gz
Enhance code
Diffstat (limited to 'amar.py')
-rw-r--r--amar.py19
1 files changed, 6 insertions, 13 deletions
diff --git a/amar.py b/amar.py
index d4ef9ff0bf9d..a0d351b98829 100644
--- a/amar.py
+++ b/amar.py
@@ -50,20 +50,13 @@ try:
except OSError:
errorButtons()
-if etatamar == 1:
- buttonactive.set_label('DESACTIVER')
-else:
- buttonactive.set_label('ACTIVER')
+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 success1():
+def success():
buttonactive.set_sensitive(True)
- buttonactive.set_label('DESACTIVER')
-
-def success2():
- buttonactive.set_sensitive(True)
- buttonactive.set_label('ACTIVER')
+ buttonactive.set_label('DESACTIVER' if etatamar == 1 else 'ACTIVER')
def pressActive():
global etatamar
@@ -75,7 +68,7 @@ def pressActive():
os.system("pacman -Syy")
etatamar = 1
ecrire.close()
- GLib.idle_add(success1)
+ GLib.idle_add(success)
except OSError:
GLib.idle_add(errorButtons)
else:
@@ -91,10 +84,10 @@ def pressActive():
etatamar = 0
f.close()
new_f.close()
- GLib.idle_add(success2)
+ GLib.idle_add(success)
except OSError:
GLib.idle_add(errorButtons)
window = builder.get_object("mainWindow")
window.show_all()
-Gtk.main()
+Gtk.main() \ No newline at end of file