summaryrefslogtreecommitdiff
path: root/portato/plugins/etc_proposals.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-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()