Show
Ignore:
Timestamp:
05/03/08 18:58:06 (16 years ago)
Author:
jerome
Message:

Moved new method around.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/tool.py

    r3327 r3367  
    171171        sys.stderr.flush() 
    172172         
     173    def adminOnly(self, restricted=True) : 
     174        """Raises an exception if the user is not a PyKota administrator.""" 
     175        if restricted and not self.config.isAdmin : 
     176            raise PyKotaCommandLineError, "%s : %s" % (pwd.getpwuid(os.geteuid())[0], _("You're not allowed to use this command.")) 
     177             
    173178    def matchString(self, s, patterns) : 
    174179        """Returns True if the string s matches one of the patterns, else False."""