From 28c524e8243f9eb41f2ecb7197e33711727526d9 Mon Sep 17 00:00:00 2001 From: necoro <> Date: Wed, 25 Apr 2007 16:05:46 +0000 Subject: added noroot-option --- portato/plugins/etc_proposals.py | 10 ++++++---- portato/plugins/noroot.py | 15 +++++++++++++++ 2 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 portato/plugins/noroot.py (limited to 'portato/plugins') diff --git a/portato/plugins/etc_proposals.py b/portato/plugins/etc_proposals.py index a064fff..6cf53ad 100644 --- a/portato/plugins/etc_proposals.py +++ b/portato/plugins/etc_proposals.py @@ -16,6 +16,8 @@ from portato.backend import system from subprocess import Popen from etcproposals.etcproposals_lib import EtcProposals, __version__ +PROG="/usr/sbin/etc-proposals" + class PortatoEtcProposals(EtcProposals): """Subclassed EtcProposals using portato.backend.system during __init__.""" @@ -34,15 +36,15 @@ def etc_prop (*args, **kwargs): debug(l,"files to update") if l > 0: - Popen("etc-proposals") + Popen(PROG) else: - Popen(["etc-proposals", "--frontend", "gtk", "--fastexit"]) + Popen([PROG, "--frontend", "gtk", "--fastexit"]) def etc_prop_menu (*args, **kwargs): if am_i_root(): if float(__version__) < 1.1: - Popen("etc-proposals") + Popen(PROG) else: - Popen(["etc-proposals", "--frontend", "gtk"]) + Popen([PROG, "--frontend", "gtk"]) else: debug("Cannot start etc-proposals. Not root!", error = 1) diff --git a/portato/plugins/noroot.py b/portato/plugins/noroot.py new file mode 100644 index 0000000..a28ef85 --- /dev/null +++ b/portato/plugins/noroot.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# +# File: portato/plugins/noroot.py +# This file is part of the Portato-Project, a graphical portage-frontend. +# +# Copyright (C) 2007 René 'Necoro' Neumann +# This is free software. You may redistribute copies of it under the terms of +# the GNU General Public License version 2. +# There is NO WARRANTY, to the extent permitted by law. +# +# Written by René 'Necoro' Neumann + +def i_am_root (*args): + """Pretend we are root.""" + return True -- cgit v1.2.3-54-g00ecf