本文整理汇总了Python中Cheetah.Template.Template.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python Template.__init__方法的具体用法?Python Template.__init__怎么用?Python Template.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cheetah.Template.Template
的用法示例。
在下文中一共展示了Template.__init__方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from Cheetah.Template import Template [as 别名]
# 或者: from Cheetah.Template.Template import __init__ [as 别名]
def __init__(self, *args, **KWs):
Template.__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)
示例2: __init__
# 需要导入模块: from Cheetah.Template import Template [as 别名]
# 或者: from Cheetah.Template.Template import __init__ [as 别名]
def __init__(self, *args, **KWs):
Template.__init__(self, *args, **KWs)
self._metaTags = {'HTTP-EQUIV':{'keywords':'Cheetah',
'Content-Type':'text/html; charset=iso-8859-1',
},
'NAME':{'generator':'Cheetah: The Python-Powered Template Engine'}
}
# metaTags = {'HTTP_EQUIV':{'test':1234}, 'NAME':{'test':1234,'test2':1234} }
self._stylesheets = {}
# stylesheets = {'.cssClassName':'stylesheetCode'}
self._stylesheetsOrder = []
# stylesheetsOrder = ['.cssClassName',]
self._stylesheetLibs = {}
# stylesheetLibs = {'libName':'libSrcPath'}
self._javascriptLibs = {}
self._javascriptTags = {}
# self._javascriptLibs = {'libName':'libSrcPath'}
self._bodyTagAttribs = {}
示例3: __init__
# 需要导入模块: from Cheetah.Template import Template [as 别名]
# 或者: from Cheetah.Template.Template import __init__ [as 别名]
def __init__(self, *args, **KWs):
# If we have a diamond-inheritence, this function could be called more than once
# And that would be bad. Let's check for that case, and return if it is the case.
# Template can deal with being called more than once, but some of the code below
# wouldn't be safe called more than once
if self._ScriptElement_haveCalledInit:
return
self._ScriptElement_haveCalledInit = True
localKWs = self.extractLocalKWs(['xmlElement', 'parent'], KWs)
Template.__init__(self, *args, **KWs)
self.getVar('templates').add(self)
# Only set the dependencies attribute if it isn't taken
# care of elsewhere
if not hasattr(type(self), 'dependencies'):
self.dependencies = set()
assert 'parent' in localKWs
self.parent = localKWs['parent']
if self.parent and self.parent == self.simulation:
self.simulation._children.append(self)
self.xmlElement = localKWs.get('xmlElement', None)
self.dependenciesEntity = None
self.functions = {}
self.codeBlocks = {}
self._haveBeenRemoved = False
self._children = []
if hasattr(type(self), 'globalNameSpaceName'):
globalNameSpace = KWs['searchList'][0]
globalNameSpace[self.globalNameSpaceName] = self
# Create the entry in the callOnceGuards
_ScriptElement._callOncePerInstanceGuards[self] = set()
示例4: __init__
# 需要导入模块: from Cheetah.Template import Template [as 别名]
# 或者: from Cheetah.Template.Template import __init__ [as 别名]
def __init__(self, filename, projectDirectory, switchProjectPath):
self.filename = filename
Template.__init__(self, file=os.path.join(os.path.dirname(__file__), 'core', self.filename + '.tmpl'))
self.projectDirectory = projectDirectory
self.histfilePath = os.path.join(switchProjectPath, 'history')
示例5: __init__
# 需要导入模块: from Cheetah.Template import Template [as 别名]
# 或者: from Cheetah.Template.Template import __init__ [as 别名]
def __init__(self, *args, **KWs):
"""
"""
Template.__init__(self, *args, **KWs)
示例6: __init__
# 需要导入模块: from Cheetah.Template import Template [as 别名]
# 或者: from Cheetah.Template.Template import __init__ [as 别名]
def __init__(self, activity):
self.activity = activity
Template.__init__(self, file=os.path.join(os.path.dirname(__file__), 'kde', 'in.tmpl'))
示例7: __init__
# 需要导入模块: from Cheetah.Template import Template [as 别名]
# 或者: from Cheetah.Template.Template import __init__ [as 别名]
def __init__(self, filename, key, value):
self.filename = filename
self.key = key
self.value = value
Template.__init__(self, file=os.path.join(os.path.dirname(__file__), 'alias', self.filename + '.tmpl'))