本文整理汇总了Python中Cheetah.DummyTransaction.DummyTransaction类的典型用法代码示例。如果您正苦于以下问题:Python DummyTransaction类的具体用法?Python DummyTransaction怎么用?Python DummyTransaction使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DummyTransaction类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: pagetitle
def pagetitle(self, **KWS):
## CHEETAH: generated from #def pagetitle at line 4, 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("""Editing a copy of """)
_v = VFFSL(SL, "book.title.booktitle", True) # '${book.title.booktitle}' on line 5, col 19
if _v is not None:
write(_filter(_v, rawExpr="${book.title.booktitle}")) # from line 5, col 19.
write(
"""
"""
)
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
示例2: pagetitle
def pagetitle(self, **KWS):
## CHEETAH: generated from #def pagetitle at line 4, 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('''Report: ''')
_v = VFN(VFFSL(SL,"report",True),"metadata",True)['name'] # "${report.metadata['name']}" on line 5, col 9
if _v is not None: write(_filter(_v, rawExpr="${report.metadata['name']}")) # from line 5, col 9.
write('''
''')
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
示例3: respond
def respond(self, trans=None):
## CHEETAH: main method generated for this template
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
_v = VFFSL(SL,"req.output",True) # '$req.output' on line 1, col 1
if _v is not None: write(_filter(_v, rawExpr='$req.output')) # from line 1, col 1.
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
示例4: writeBody
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.body(trans=trans)
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
示例5: body
def body(self, **KWS):
## CHEETAH: generated from #def body at line 8, 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('''<h1>Category record for ''')
_v = VFFSL(SL,"category.title.booktitle",True) # '$category.title.booktitle' on line 9, col 25
if _v is not None: write(_filter(_v, rawExpr='$category.title.booktitle')) # from line 9, col 25.
write('''</h1>
<form method="get" action="/categoryedit">
''')
_v = VFFSL(SL,"category.object_to_form",True) # '$category.object_to_form' on line 11, col 1
if _v is not None: write(_filter(_v, rawExpr='$category.object_to_form')) # from line 11, col 1.
write('''
</form>
''')
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
示例6: writeBody
def writeBody(self,
trans=None,
dummyTrans=False,
VFFSL=valueFromFrameOrSearchList,
VFN=valueForName,
getmtime=getmtime,
currentTime=time.time):
"""
Generated from #block writeBody at line 36, col 1.
"""
if not trans:
trans = DummyTransaction()
dummyTrans = True
write = trans.response().write
SL = self._searchList
filter = self._currentFilter
globalSetVars = self._globalSetVars
########################################
## START - generated method body
write('This skeleton page has no flesh. Its body needs to be implemented.\n')
########################################
## END - generated method body
if dummyTrans:
return trans.response().getvalue()
else:
return ""
示例7: banner
def banner(self, **KWS):
## CHEETAH: generated from #def banner at line 12, 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
_v = VFFSL(SL,"title",True) # '$title' on line 13, col 1
if _v is not None: write(_filter(_v, rawExpr='$title')) # from line 13, col 1.
write('''
''')
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
示例8: side
def side(self, **KWS):
## CHEETAH: generated from #block side at line 46, 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
self._handleCheetahInclude("../server/www/templates/chunks/side.tmpl", trans=trans, includeFrom="file", raw=False)
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
示例9: writeBody
def writeBody(self, **KWS):
## CHEETAH: generated from #block writeBody at line 36, 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('This skeleton page has no flesh. Its body needs to be implemented.\n')
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
示例10: title
def title(self, **KWS):
## CHEETAH: generated from #def title at line 8, 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('''Untitled
''')
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
示例11: body
def body(self, **KWS):
## CHEETAH: generated from #block body at line 19, 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('''
''')
# Show error if this page is shown
write('''<h1><center><font color="RED">
OOOPS!
</font></center></h1>
''')
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
示例12: body
def body(self,
trans=None,
dummyTrans=False,
VFS=valueFromSearchList,
VFN=valueForName,
getmtime=getmtime,
currentTime=time.time,
globals=globals,
locals=locals,
__builtin__=__builtin__):
"""
Generated from #block body at line 12, col 1.
"""
if not trans:
trans = DummyTransaction()
dummyTrans = True
write = trans.response().write
SL = self._searchList
filter = self._currentFilter
globalSetVars = self._globalSetVars
########################################
## START - generated method body
########################################
## END - generated method body
if dummyTrans:
return trans.response().getvalue()
else:
return ""
示例13: respond
def respond(self, trans=None):
## CHEETAH: main method generated for this template
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
# Master page template
write('''
''')
# Header
write('''<html>
<head>
<title>
TSmells Pieces Tests
</title>
<head>
<body>
<center>
<h1>
TSmells Pieces Tests
</h1>
</center>
''')
# Body
self.body(trans=trans)
write('''
''')
# Footer
write('''<hr />
<font size="-1">
Generated ''')
_v = VFFSL(SL,"ctime",False)() # '$ctime()' on line 31, col 19
if _v is not None: write(_filter(_v, rawExpr='$ctime()')) # from line 31, col 19.
write(''' by <a href="mailto:[email protected]">Manuel Breugelmans</a>
</font>
</body>
''')
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
示例14: respond
def respond(self, trans=None):
## CHEETAH: main method generated for this template
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('''
<div class="pagination">
''')
if VFN(VFFSL(SL,"req.__dict__",True),"get",False)('pagination'): # generated from line 4, col 1
write('''
''')
if VFN(VFFSL(SL,"req.pagination",True),"fetchcount",False)(True): # generated from line 6, col 1
write('''
<a class="more" href="''')
_v = VFFSL(SL,"links",True)['paginate_more'](VFFSL(SL,"req",True)) # "$links['paginate_more']($req)" on line 8, col 23
if _v is not None: write(_filter(_v, rawExpr="$links['paginate_more']($req)")) # from line 8, col 23.
write('''">More</a>
''')
write('''\t
''')
if VFFSL(SL,"req.pagination.offset",True): # generated from line 12, col 1
write('''
<a class="less" href="''')
_v = VFFSL(SL,"links",True)['paginate_less'](VFFSL(SL,"req",True)) # "$links['paginate_less']($req)" on line 14, col 23
if _v is not None: write(_filter(_v, rawExpr="$links['paginate_less']($req)")) # from line 14, col 23.
write('''">Less</a>
''')
write('''
''')
write('''</div>''')
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""
示例15: body
def body(self, **KWS):
## CHEETAH: generated from #block body 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('''
<div class="form">
<form action="''')
_v = VFFSL(SL,"req.uri",True) # '$req.uri' on line 6, col 15
if _v is not None: write(_filter(_v, rawExpr='$req.uri')) # from line 6, col 15.
write('''" method="POST">
<div class="row textfields">
<div class="column">
<label for="email">Email</label>
<input name="email" type="text" />
</div>
<div class="column">
<label for="password">Password</label>
<input name="password" type="password" />
</div>
</div>
<div class="row"><div class="column">
<input type="submit" />
</div></div>
</form>
</div>
''')
########################################
## END - generated method body
return _dummyTrans and trans.response().getvalue() or ""