chiark / gitweb /
cgi.py: Remove defunct `html' function.
authorMark Wooding <mdw@distorted.org.uk>
Fri, 8 Mar 2013 07:12:25 +0000 (07:12 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Fri, 8 Mar 2013 07:12:25 +0000 (07:12 +0000)
cgi.py

diff --git a/cgi.py b/cgi.py
index 02797cec108ea59458e51fca804d3b96a1d363bf..0630feb4d5a422d05fe48028743d3c0d77ec2471 100644 (file)
--- a/cgi.py
+++ b/cgi.py
@@ -166,47 +166,6 @@ def static(name):
   """Build a URL for the static file NAME."""
   return htmlescape(CFG.STATIC + '/' + name)
 
   """Build a URL for the static file NAME."""
   return htmlescape(CFG.STATIC + '/' + name)
 
-@CTX.contextmanager
-def html(title, **kw):
-  """
-  Context manager for HTML output.
-
-  Keyword arguments are output as HTTP headers (if no header has been written
-  yet).  A `<head>' element is written, and a `<body>' opened, before the
-  context body is executed; the elements are closed off properly at the end.
-  """
-
-  kw = dict(kw, content_type = 'text/html')
-  OUT.header(**kw)
-
-  ## Write the HTML header.
-  PRINT("""\
-<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01//EN'
-          'http://www.w3c.org/TR/html4/strict.dtd'>
-<html>
-<head>
-  <title>%(title)s</title>
-  <link rel=stylesheet type='text/css' media=screen href='%(style)s'>
-  <meta http-equiv='Content-Script-Type' content='text/javascript'>
-  <script type='text/javascript' src='%(script)s'></script>
-</head>""" % dict(title = html_quotify(title),
-                 style = static('chpwd.css'),
-                 script = static('chpwd.js')))
-
-  ## Write the body.
-  PRINT('<body>')
-  yield None
-  PRINT('''\
-
-<div class=credits>
-  <a href="%(about)s">Chopwood</a>, version %(version)s:
-  copyright &copy; 2012 Mark Wooding
-</div>
-
-</body>
-</html>''' % dict(about = static('about.html'),
-                  version = VERSION))
-
 def redirect(where, **kw):
   """
   Write a complete redirection to some other URL.
 def redirect(where, **kw):
   """
   Write a complete redirection to some other URL.