(file) Return to message.py CVS log (file) (dir) Up to [home] / webnote / lib

File: [home] / webnote / lib / message.py (download) / (as text)
Revision: 1.2, Mon Jan 2 08:54:31 2006 UTC (4 years, 8 months ago) by ws
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +3 -0 lines
be a bit more verbose

"""Messages returned to the user."""

from lib.logger import log
from etc.common import SHOWDEBUG

def Error(ex):
  """ex is an exception"""
  print 'Content-type: text/html\n\n'
  print '<html><body><h2>Congratulations!  You found a bug in Webnote!</h2>'
  print '<p>(or perhaps the database is down)</p>'
  print ("<p>We'll try to have webnote up and running again as soon as "
         "possible</p>")
  if SHOWDEBUG:
    import cgitb
    cgitb.handler()
  print '</body></html>'
  log(str(ex))

def PlainText(s):
  print 'Content-type: text/plain\n\n'
  print s

def Redirect(url=None):
  if not url:
    url = '.'
  
  print 'Location: %s\n\n' % url

tony at ponderer dot org
Powered by
ViewCVS 0.9.2