Changeset 3367 for pykota/trunk/pykota
- Timestamp:
- 05/03/08 18:58:06 (16 years ago)
- Location:
- pykota/trunk/pykota
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/tool.py
r3327 r3367 171 171 sys.stderr.flush() 172 172 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 173 178 def matchString(self, s, patterns) : 174 179 """Returns True if the string s matches one of the patterns, else False.""" -
pykota/trunk/pykota/utils.py
r3366 r3367 31 31 from pykota.errors import PyKotaCommandLineError 32 32 33 def onlyAdmin(app, restricted=True) :34 """Raises an exception if the user is not a PyKota administrator."""35 if restricted and not app.config.isAdmin :36 raise PyKotaCommandLineError, "%s : %s" % (pwd.getpwuid(os.geteuid())[0], _("You're not allowed to use this command."))37 38 33 def initlocale(lang="", cset=None) : 39 34 """Initializes the locale stuff."""