From e42090a8bd7dcc5f9e7c6e41b0f44698588e6586 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20=27Necoro=27=20Neumann?= Date: Thu, 3 Jul 2008 23:33:21 +0200 Subject: Ported etc-proposals plugin --- plugins/etc_proposals.py | 43 +++++++++++++++++++++++++++++++++++++++++++ plugins/etc_proposals.xml | 19 ------------------- 2 files changed, 43 insertions(+), 19 deletions(-) create mode 100644 plugins/etc_proposals.py delete mode 100644 plugins/etc_proposals.xml (limited to 'plugins') diff --git a/plugins/etc_proposals.py b/plugins/etc_proposals.py new file mode 100644 index 0000000..f02cef5 --- /dev/null +++ b/plugins/etc_proposals.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# +# File: plugins/etc_proposals.py +# This file is part of the Portato-Project, a graphical portage-frontend. +# +# Copyright (C) 2007-2008 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 + +from portato.helper import error + +import os +from subprocess import Popen + +class EtcProposals (Plugin): + __author__ = "René 'Necoro' Neumann" + __description__ = "Adds support for etc-proposals, a graphical etc-update replacement." + __dependency__ = "app-portage/etc-proposals" + + def __init__ (self): + Plugin.__init__(self) + + self.prog = ["/usr/sbin/etc-proposals"] + self.add_call("after_emerge", self.hook, type = "after") + self.add_menu("Et_c-Proposals", self.menu) + + def launch (self, options = []): + if os.getuid() == 0: + Popen(self.prog+options) + else: + error("ETC_PROPOSALS :: %s",_("Cannot start etc-proposals. Not root!")) + + def hook (self, *args, **kwargs): + """Entry point for this plugin.""" + self.launch(["--fastexit"]) + + def menu (self, *args): + self.launch() + +register(EtcProposals) diff --git a/plugins/etc_proposals.xml b/plugins/etc_proposals.xml deleted file mode 100644 index 2caf341..0000000 --- a/plugins/etc_proposals.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - René 'Necoro' Neumann - Etc-proposals - - portato.plugins.etc_proposals - - - - - - - - - Et_c-Proposals - - - -- cgit v1.2.3