- Timestamp:
- 05/03/08 18:45:38 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/utils.py
r3354 r3366 24 24 import sys 25 25 import os 26 import pwd 26 27 import locale 27 28 import gettext … … 30 31 from pykota.errors import PyKotaCommandLineError 31 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 32 38 def initlocale(lang="", cset=None) : 33 39 """Initializes the locale stuff."""