Thomas Lotze  committed 72d72b0

Dropped the ``ophelia-dump`` script which has never been really useful.

  • Participants
  • Parent commits a2e6b66
  • Branches wsgi-only

Comments (0)

Files changed (6)

 - Dropped the version restriction on zope.tal, updated tests. Page templates
   no longer grow a trailing new-line character when rendering themselves.
+- Dropped the ``ophelia-dump`` script which has never been really useful.
 - Re-organised tests, added programmatic tests for the WSGI interface.
 - Use Python's own ``doctest`` module for tests, got rid of using
     The wsgiref-based server is installed as the ``ophelia-wsgiref``
     executable. Its script entry point is ``ophelia.wsgi.wsgiref_server``.
-Dump single pages to stdout
-    An executable which is always installed with the ophelia egg is
-    ``ophelia-dump``. This script has Ophelia render the response
-    corresponding to the path you specify, and prints it to ``sys.stdout``,
-    optionally with HTTP headers. The script's entry point is
-    ``ophelia.dump.dump``.
 Both scripts provide some usage instructions when called with the ``--help``
 option. They read a configuration file; see CONFIGURATION.txt for details.

File doc/modules.txt

-    ophelia.dump

File ophelia/CONFIGURATION.txt

 Configuration files
-Ophelia comes with two clients that all exercise its request handler: an
-wsgiref-based HTTP server and the ``ophelia-dump`` script. They read their
-configuration from a section of an INI-style configuration file. An example
-configurations can be found below.
+Ophelia comes with a wsgiref-based HTTP server that exercises the Ophelia
+request handler. It reads its configuration from a section of an INI-style
+configuration file. An example configurations can be found below.
 Two variables must always be present:
 You may want to wrap this call in a run-control script.
-The same configuration can be used with the ophelia-dump script, except that
-it doesn't require the host and port to be set.
 .. Local Variables:
 .. mode: rst

File ophelia/

-# Copyright (c) 2007-2008 Thomas Lotze
-# See also LICENSE.txt
-"""A script entry point for dumping a page built by Ophelia to stdout.
-import sys
-import optparse
-import ConfigParser
-import zope.exceptions.exceptionformatter
-import ophelia.request
-def dump(config_file="", section="DEFAULT"):
-    oparser = optparse.OptionParser("usage: %prog [options] path")
-    oparser.add_option("-c", dest="config_file", default=config_file)
-    oparser.add_option("-s", dest="section", default=section)
-    oparser.add_option("-v", dest="verbose",
-                       action="store_true", default=False,
-                       help="verbose, print response headers")
-    cmd_options, args = oparser.parse_args()
-    if len(args) != 1:
-        sys.stderr.write("Exactly one path must be requested.")
-        return 1
-    path = args[0]
-    config = ConfigParser.ConfigParser()
-    env = dict((key.replace('-', '_'), value)
-               for key, value in config.items(cmd_options.section))
-    env.setdefault('wsgi.input', sys.stdin)
-    if path.startswith('/'):
-        path = path[1:]
-    if '?' in path:
-        path, env["QUERY_STRING"] = path.split('?', 1)
-    request = ophelia.request.Request(
-        path, env.pop("template_root"), env.pop("site"), **env)
-    try:
-        headers, body = request()
-    except:
-        msg = "".join(zope.exceptions.exceptionformatter.format_exception(
-            with_filenames=True, *sys.exc_info()))
-        sys.stderr.write(msg)
-        return 1
-    if cmd_options.verbose:
-        sys.stdout.write(
-            '\n'.join("%s: %s" % item for item in headers.items()) +
-            "\n\n")
-    sys.stdout.write(body)
 entry_points = {
     "console_scripts": [
-    "ophelia-dump = ophelia.dump:dump",
     "ophelia-wsgiref = ophelia.wsgi:wsgiref_server",