summaryrefslogtreecommitdiff
path: root/portato/plugins/etc_proposals.py
diff options
context:
space:
mode:
authorNecoro <>2008-01-20 14:22:36 +0000
committerNecoro <>2008-01-20 14:22:36 +0000
commit9b7fcb241fc908239c1a24020ac265a3077d1039 (patch)
tree6936346dbb76e0da47e5dc32015ce4420fd1c4dc /portato/plugins/etc_proposals.py
parent730c2c3d96a13e394f8024945783264abbc74b2c (diff)
downloadportato-9b7fcb241fc908239c1a24020ac265a3077d1039.tar.gz
portato-9b7fcb241fc908239c1a24020ac265a3077d1039.tar.bz2
portato-9b7fcb241fc908239c1a24020ac265a3077d1039.zip
r691@Devoty: necoro | 2008-01-20 15:19:45 +0100
Changed etc-proposals plugin so only root can launch it
Diffstat (limited to 'portato/plugins/etc_proposals.py')
-rw-r--r--portato/plugins/etc_proposals.py16
1 files changed, 9 insertions, 7 deletions
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()