diff options
author | necoro <> | 2007-04-25 16:05:46 +0000 |
---|---|---|
committer | necoro <> | 2007-04-25 16:05:46 +0000 |
commit | 28c524e8243f9eb41f2ecb7197e33711727526d9 (patch) | |
tree | 1ac2ddf2cd27411c0e9d634283873a9642ccb131 /portato/helper.py | |
parent | 86490cd2c9f7523835ecedf472398845c56b5c0c (diff) | |
download | portato-28c524e8243f9eb41f2ecb7197e33711727526d9.tar.gz portato-28c524e8243f9eb41f2ecb7197e33711727526d9.tar.bz2 portato-28c524e8243f9eb41f2ecb7197e33711727526d9.zip |
added noroot-option
Diffstat (limited to '')
-rw-r--r-- | portato/helper.py | 15 |
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. |