summaryrefslogtreecommitdiff
path: root/portato/helper.py
diff options
context:
space:
mode:
authornecoro <>2007-04-25 16:05:46 +0000
committernecoro <>2007-04-25 16:05:46 +0000
commit28c524e8243f9eb41f2ecb7197e33711727526d9 (patch)
tree1ac2ddf2cd27411c0e9d634283873a9642ccb131 /portato/helper.py
parent86490cd2c9f7523835ecedf472398845c56b5c0c (diff)
downloadportato-28c524e8243f9eb41f2ecb7197e33711727526d9.tar.gz
portato-28c524e8243f9eb41f2ecb7197e33711727526d9.tar.bz2
portato-28c524e8243f9eb41f2ecb7197e33711727526d9.zip
added noroot-option
Diffstat (limited to 'portato/helper.py')
-rw-r--r--portato/helper.py15
1 files changed, 11 insertions, 4 deletions
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.