コード例 #1
0
ファイル: commonpage.py プロジェクト: zeus911/vpnease-l2tp
 def renderHTTP_exception(self, ctx, reason):
     _log.error('rendering exception: %s' % reason)
     request = inevow.IRequest(ctx)
     request.setResponseCode(http.INTERNAL_SERVER_ERROR)
     request.write("<html><head><title>Exception</title></head><body>")
     from nevow import failure
     result = failure.formatFailure(reason)
     request.write(''.join(flat.flatten(result)))
     request.write("</body></html>")
     request.finishRequest(False)
コード例 #2
0
ファイル: commonpage.py プロジェクト: nakedible/vpnease-l2tp
 def renderHTTP_exception(self, ctx, reason):
     _log.error('rendering exception: %s' % reason)
     request = inevow.IRequest(ctx)
     request.setResponseCode(http.INTERNAL_SERVER_ERROR)
     request.write("<html><head><title>Exception</title></head><body>")
     from nevow import failure
     result = failure.formatFailure(reason)
     request.write(''.join(flat.flatten(result)))
     request.write("</body></html>")
     request.finishRequest( False )
コード例 #3
0
ファイル: appserver.py プロジェクト: perkinslr/nevow-py3
 def renderInlineException(self, context, reason):
     from nevow import failure
     formatted = failure.formatFailure(reason)
     desc = str(reason)
     return flat.serialize([
         stan.xml("""<div style="border: 1px dashed red; color: red; clear: both" onclick="this.childNodes[1].style.display = this.childNodes[1].style.display == 'none' ? 'block': 'none'">"""),
         desc,
         stan.xml('<div style="display: none">'),
         formatted,
         stan.xml('</div></div>')
     ], context)
コード例 #4
0
 def renderInlineException(self, context, reason):
     from nevow import failure
     formatted = failure.formatFailure(reason)
     desc = str(reason)
     return flat.serialize([
         stan.xml(
             """<div style="border: 1px dashed red; color: red; clear: both" onclick="this.childNodes[1].style.display = this.childNodes[1].style.display == 'none' ? 'block': 'none'">"""
         ), desc,
         stan.xml('<div style="display: none">'), formatted,
         stan.xml('</div></div>')
     ], context)