#!/usr/bin/env python ################################################## ## DEPENDENCIES import sys import os import os.path from os.path import getmtime, exists import time import types import __builtin__ from Cheetah.Version import MinCompatibleVersion as RequiredCheetahVersion from Cheetah.Version import MinCompatibleVersionTuple as RequiredCheetahVersionTuple from Cheetah.Template import Template from Cheetah.DummyTransaction import DummyTransaction from Cheetah.NameMapper import NotFound, valueForName, valueFromSearchList, valueFromFrameOrSearchList from Cheetah.CacheRegion import CacheRegion import Cheetah.Filters as Filters import Cheetah.ErrorCatchers as ErrorCatchers from prewikka.templates.ClassicLayout import ClassicLayout ################################################## ## MODULE CONSTANTS try: True, False except NameError: True, False = (1==1), (1==0) VFFSL=valueFromFrameOrSearchList VFSL=valueFromSearchList VFN=valueForName currentTime=time.time __CHEETAH_version__ = '2.0' __CHEETAH_versionTuple__ = (2, 0, 0, 'final', 0) __CHEETAH_genTime__ = 1200702932.9678409 __CHEETAH_genTimestamp__ = 'Fri Jan 18 19:35:32 2008' __CHEETAH_src__ = 'prewikka/templates/UserSettings.tmpl' __CHEETAH_srcLastModified__ = 'Fri Sep 21 04:18:32 2007' __CHEETAH_docstring__ = 'Autogenerated by CHEETAH: The Python-Powered Template Engine' if __CHEETAH_versionTuple__ < RequiredCheetahVersionTuple: raise AssertionError( 'This template was compiled with Cheetah version' ' %s. Templates compiled before version %s must be recompiled.'%( __CHEETAH_version__, RequiredCheetahVersion)) ################################################## ## CLASSES class UserSettings(ClassicLayout): ################################################## ## CHEETAH GENERATED METHODS def __init__(self, *args, **KWs): ClassicLayout.__init__(self, *args, **KWs) if not self._CHEETAH__instanceInitialized: cheetahKWArgs = {} allowedKWs = 'searchList namespaces filter filtersLib errorCatcher'.split() for k,v in KWs.items(): if k in allowedKWs: cheetahKWArgs[k] = v self._initCheetahInstance(**cheetahKWArgs) def layout_start_hook(self, **KWS): ## CHEETAH: generated from #def layout_start_hook at line 3, col 1. trans = KWS.get("trans") if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)): trans = self.transaction # is None unless self.awake() was called if not trans: trans = DummyTransaction() _dummyTrans = True else: _dummyTrans = False write = trans.response().write SL = self._CHEETAH__searchList _filter = self._CHEETAH__currentFilter ######################################## ## START - generated method body write(''' ''') ######################################## ## END - generated method body return _dummyTrans and trans.response().getvalue() or "" def main_content(self, **KWS): ## CHEETAH: generated from #block main_content at line 18, col 1. trans = KWS.get("trans") if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)): trans = self.transaction # is None unless self.awake() was called if not trans: trans = DummyTransaction() _dummyTrans = True else: _dummyTrans = False write = trans.response().write SL = self._CHEETAH__searchList _filter = self._CHEETAH__currentFilter ######################################## ## START - generated method body _orig_filter_10871731 = _filter filterName = 'CleanOutput' if self._CHEETAH__filters.has_key("CleanOutput"): _filter = self._CHEETAH__currentFilter = self._CHEETAH__filters[filterName] else: _filter = self._CHEETAH__currentFilter = \ self._CHEETAH__filters[filterName] = getattr(self._CHEETAH__filtersLib, filterName)(self).filter write('''
''') if VFFSL(SL,"user.login",True): # generated from line 24, col 1 write(''' ''') else: # generated from line 27, col 1 write(''' ''') write(''' ''') if VFFSL(SL,"user.origin",True): # generated from line 31, col 1 write(''' ''') write('''
''') if False: _("Account information") _v = VFFSL(SL,"_",False)("Account information") # '$_("Account information")' on line 36, col 10 if _v is not None: write(_filter(_v, rawExpr='$_("Account information")')) # from line 36, col 10. write(''' ''') if VFFSL(SL,"user.login",True): # generated from line 39, col 1 write(''' ''') else: # generated from line 46, col 1 write(''' ''') if VFFSL(SL,"errmsg",True): # generated from line 48, col 4 write(''' \t ''') write(''' ''') write(''' ''') row_classes = ("table_row_even", "table_row_odd") write('''
''') if False: _("Login:") _v = VFFSL(SL,"_",False)("Login:") # '$_("Login:")' on line 41, col 41 if _v is not None: write(_filter(_v, rawExpr='$_("Login:")')) # from line 41, col 41. write('''

''') _v = VFFSL(SL,"user.login",True) # '$user.login' on line 43, col 70 if _v is not None: write(_filter(_v, rawExpr='$user.login')) # from line 43, col 70. write('''

''') _v = VFFSL(SL,"errmsg",True) # '$errmsg' on line 50, col 42 if _v is not None: write(_filter(_v, rawExpr='$errmsg')) # from line 50, col 42. write('''
Login:
''') if False: _("Language:") _v = VFFSL(SL,"_",False)("Language:") # '$_("Language:")' on line 61, col 41 if _v is not None: write(_filter(_v, rawExpr='$_("Language:")')) # from line 61, col 41. write('''
''') if False: _("Permissions:") _v = VFFSL(SL,"_",False)("Permissions:") # '$_("Permissions:")' on line 80, col 21 if _v is not None: write(_filter(_v, rawExpr='$_("Permissions:")')) # from line 80, col 21. write('''
''') cnt = 0 checked_cnt = 0 write(''' ''') if VFFSL(SL,"can_manage_user",True): # generated from line 91, col 1 disabled = "" else: # generated from line 93, col 1 disabled = "disabled=\"disabled\"" write(''' ''') for perm, value in VFFSL(SL,"user.permissions",True): # generated from line 97, col 7 write(''' ''') cnt += 1 write(''' ''') if VFFSL(SL,"cnt",True) == VFFSL(SL,"checked_cnt",True): # generated from line 115, col 1 checked = "checked=\"checked\"" else: # generated from line 117, col 1 checked = "" write('''
''') _v = VFFSL(SL,"perm",True) # '$perm' on line 99, col 38 if _v is not None: write(_filter(_v, rawExpr='$perm')) # from line 99, col 38. write(''' ''') if VFFSL(SL,"value",True): # generated from line 101, col 9 checked_cnt += 1 checked = "checked=\"checked\"" else: # generated from line 104, col 9 checked = "" write('''
 ''') if False: _("Check All") _v = VFFSL(SL,"_",False)("Check All") # '$_("Check All")' on line 121, col 50 if _v is not None: write(_filter(_v, rawExpr='$_("Check All")')) # from line 121, col 50. write('''

''') if VFFSL(SL,"can_change_password",True): # generated from line 133, col 1 write('''
''') if False: _("Change password") _v = VFFSL(SL,"_",False)("Change password") # '$_("Change password")' on line 135, col 11 if _v is not None: write(_filter(_v, rawExpr='$_("Change password")')) # from line 135, col 11. write(''' ''') if VFFSL(SL,"ask_current_password",True): # generated from line 137, col 5 write(''' ''') write('''
''') if False: _("Current password:") _v = VFFSL(SL,"_",False)("Current password:") # '$_("Current password:")' on line 139, col 11 if _v is not None: write(_filter(_v, rawExpr='$_("Current password:")')) # from line 139, col 11. write('''
''') if False: _("New password:") _v = VFFSL(SL,"_",False)("New password:") # '$_("New password:")' on line 144, col 11 if _v is not None: write(_filter(_v, rawExpr='$_("New password:")')) # from line 144, col 11. write('''
''') if False: _("Confirm new password:") _v = VFFSL(SL,"_",False)("Confirm new password:") # '$_("Confirm new password:")' on line 148, col 11 if _v is not None: write(_filter(_v, rawExpr='$_("Confirm new password:")')) # from line 148, col 11. write('''

''') write('''
''') _filter = _orig_filter_10871731 ######################################## ## END - generated method body return _dummyTrans and trans.response().getvalue() or "" def writeBody(self, **KWS): ## CHEETAH: main method generated for this template trans = KWS.get("trans") if (not trans and not self._CHEETAH__isBuffering and not callable(self.transaction)): trans = self.transaction # is None unless self.awake() was called if not trans: trans = DummyTransaction() _dummyTrans = True else: _dummyTrans = False write = trans.response().write SL = self._CHEETAH__searchList _filter = self._CHEETAH__currentFilter ######################################## ## START - generated method body write(''' ''') self.main_content(trans=trans) ######################################## ## END - generated method body return _dummyTrans and trans.response().getvalue() or "" ################################################## ## CHEETAH GENERATED ATTRIBUTES _CHEETAH__instanceInitialized = False _CHEETAH_version = __CHEETAH_version__ _CHEETAH_versionTuple = __CHEETAH_versionTuple__ _CHEETAH_genTime = __CHEETAH_genTime__ _CHEETAH_genTimestamp = __CHEETAH_genTimestamp__ _CHEETAH_src = __CHEETAH_src__ _CHEETAH_srcLastModified = __CHEETAH_srcLastModified__ _mainCheetahMethod_for_UserSettings= 'writeBody' ## END CLASS DEFINITION if not hasattr(UserSettings, '_initCheetahAttributes'): templateAPIClass = getattr(UserSettings, '_CHEETAH_templateClass', Template) templateAPIClass._addCheetahPlumbingCodeToClass(UserSettings) # CHEETAH was developed by Tavis Rudd and Mike Orr # with code, advice and input from many other volunteers. # For more information visit http://www.CheetahTemplate.org/ ################################################## ## if run from command line: if __name__ == '__main__': from Cheetah.TemplateCmdLineIface import CmdLineIface CmdLineIface(templateObj=UserSettings()).run()