From 9b7fcb241fc908239c1a24020ac265a3077d1039 Mon Sep 17 00:00:00 2001 From: Necoro <> Date: Sun, 20 Jan 2008 14:22:36 +0000 Subject: r691@Devoty: necoro | 2008-01-20 15:19:45 +0100 Changed etc-proposals plugin so only root can launch it --- portato/plugins/etc_proposals.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'portato/plugins') diff --git a/portato/plugins/etc_proposals.py b/portato/plugins/etc_proposals.py index ad78d96..77b6be5 100644 --- a/portato/plugins/etc_proposals.py +++ b/portato/plugins/etc_proposals.py @@ -16,15 +16,17 @@ import os from subprocess import Popen from gettext import lgettext as _ -PROG="/usr/sbin/etc-proposals" +PROG=["/usr/sbin/etc-proposals"] + +def launch (options = []): + if os.getuid() == 0: + Popen(PROG+options) + else: + error(_("Cannot start etc-proposals. Not root!")) def etc_prop (*args, **kwargs): """Entry point for this plugin.""" - - Popen([PROG, "--fastexit"]) + launch(["--fastexit"]) def etc_prop_menu (*args, **kwargs): - if os.getuid() == 0: - Popen(PROG) - else: - error(_("Cannot start etc-proposals. Not root!")) + launch() -- cgit v1.2.3