summaryrefslogtreecommitdiff
path: root/portato
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--portato/gui/templates/ui/AboutDialog.ui3
-rw-r--r--portato/helper.py15
-rw-r--r--portato/plugin.py10
-rw-r--r--portato/plugins/etc_proposals.py10
-rw-r--r--portato/plugins/noroot.py15
5 files changed, 42 insertions, 11 deletions
diff --git a/portato/gui/templates/ui/AboutDialog.ui b/portato/gui/templates/ui/AboutDialog.ui
index 1424270..b4064dd 100644
--- a/portato/gui/templates/ui/AboutDialog.ui
+++ b/portato/gui/templates/ui/AboutDialog.ui
@@ -85,6 +85,9 @@
<property name="showDropIndicator" stdset="0" >
<bool>false</bool>
</property>
+ <property name="alternatingRowColors" >
+ <bool>true</bool>
+ </property>
<property name="rootIsDecorated" >
<bool>false</bool>
</property>
diff --git a/portato/helper.py b/portato/helper.py
index 537d631..40aff44 100644
--- a/portato/helper.py
+++ b/portato/helper.py
@@ -79,10 +79,17 @@ def debug(*args, **kwargs):
def am_i_root ():
"""Returns True if the current user is root, False otherwise.
@rtype: boolean"""
- if os.getuid() == 0:
- return True
- else:
- return False
+
+ from plugin import hook
+
+ @hook("am_i_root")
+ def __am_i_root():
+ if os.getuid() == 0:
+ return True
+ else:
+ return False
+
+ return __am_i_root()
def flatten (listOfLists):
"""Flattens the given list of lists.
diff --git a/portato/plugin.py b/portato/plugin.py
index 4c5070e..3d67f5b 100644
--- a/portato/plugin.py
+++ b/portato/plugin.py
@@ -299,7 +299,7 @@ class PluginQueue:
except AttributeError:
debug(cmd.hook.call,"cannot be imported", error = 1)
- f(*hargs, **hkwargs) # call function
+ return f(*hargs, **hkwargs) # call function
def hook_decorator (func):
"""This is the real decorator."""
@@ -310,6 +310,8 @@ class PluginQueue:
def wrapper (*args, **kwargs):
+ ret = None
+
# before
for cmd in list[0]:
debug("Accessing hook '%s' of plugin '%s' (before)" % (hook, cmd.hook.plugin.name))
@@ -317,15 +319,17 @@ class PluginQueue:
if list[1]: # override
debug("Overriding hook '%s' with plugin '%s'" % (hook, list[1][0].hook.plugin.name))
- call(list[1][0])
+ ret = call(list[1][0])
else: # normal
- func(*args, **kwargs)
+ ret = func(*args, **kwargs)
# after
for cmd in list[2]:
debug("Accessing hook '%s' of plugin '%s' (after)" % (hook, cmd.hook.plugin.name))
call(cmd)
+ return ret
+
return wrapper
return hook_decorator
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 <necoro@necoro.net>
+
+def i_am_root (*args):
+ """Pretend we are root."""
+ return True
>René 'Necoro' Neumann3-1/+15 2010-03-26add patched lighttpdRené 'Necoro' Neumann17-0/+1208 2010-03-19Bumped app-text/highlightRené 'Necoro' Neumann2-0/+53 2010-03-02Added newer PolyML version for IsabelleRené 'Necoro' Neumann2-0/+31 2010-01-05Removed bpythonRené 'Necoro' Neumann2-33/+0 2009-11-11stgit-0.15 in portage nowRené 'Necoro' Neumann2-59/+0 2009-11-10Add stgit-0.15René 'Necoro' Neumann2-0/+59 2009-11-09Emacs stuff now in PortageRené 'Necoro' Neumann8-2222/+0 2009-11-07Emacs with fixed gtk menusRené 'Necoro' Neumann8-0/+2222 2009-10-27Remove old hibernate-script version.René 'Necoro' Neumann2-72/+0 2009-10-25Rename .bzrignore to .gitignoreRené 'Necoro' Neumann1-0/+0 2009-10-25Rename repo from 'necoro_private' to 'necoro'René 'Necoro' Neumann1-1/+1 2009-10-25Remove own hplip versionRené 'Necoro' Neumann4-210/+0 2009-10-25Remove own ctags versionRené 'Necoro' Neumann7-402/+0 2009-10-02Do not create isabelle desktop entryRené 'Necoro' Neumann2-2/+1 2009-09-28Add isabelle ebuildRené 'Necoro' Neumann3-0/+115 2009-09-05Removed glade ebuild. Newer versions included in treeRené 'Necoro' Neumann2-47/+0