(req, name=Tests.__all__[0])
return """<html>
<head>
<title>PyCAPTCHA Example</title>
</head>
<body>
<h1>PyCAPTCHA Example (for mod_python)</h1>
<p>
  <b>%s</b>:
  %s
</p>

<p><img src="image?id=%s"/></p>
<p>
  <form action="solution" method="get">
    Enter the word shown:
    <input type="text" name="word"/>
    <input type="hidden" name="id" value="%s"/>
  </form>
</p>

<p>
Or try...
<ul>
%s
</ul>
</p>

</body>
</html>
""" % (test.__class__.__name__, test.__doc__, test.id, test.id, others)
Show a newly generated CAPTCHA of the given class.
       Default is the first class name given in Tests.__all__
Show a newly generated CAPTCHA of the given class.
       Default is the first class name given in Tests.__all__
Show a newly generated CAPTCHA of the given class . Default is the first class name given in Tests . __all__
def test(req, name=Tests.__all__[0]):
    """Show a newly generated CAPTCHA of the given class.
       Default is the first class name given in Tests.__all__
       """
    test = _getFactory(req).new(getattr(Tests, name))

    # Make a list of tests other than the one we're using
    others = []
    for t in Tests.__all__:
        if t != name:
            others.append('<li><a href="?name=%s">%s</a></li>' % (t,t))
    others = "\n".join(others)

    return """<html>
<head>
<title>PyCAPTCHA Example</title>
</head>
<body>
<h1>PyCAPTCHA Example (for mod_python)</h1>
<p>
  <b>%s</b>:
  %s
</p>

<p><img src="image?id=%s"/></p>
<p>
  <form action="solution" method="get">
    Enter the word shown:
    <input type="text" name="word"/>
    <input type="hidden" name="id" value="%s"/>
  </form>
</p>

<p>
Or try...
<ul>
%s
</ul>
</p>

</body>
</html>
""" % (test.__class__.__name__, test.__doc__, test.id, test.id, others)
def test ( req , name = Tests . __all__ [ 0 ] ) : test = _getFactory ( req ) . new ( getattr ( Tests , name ) ) # Make a list of tests other than the one we're using others = [ ] for t in Tests . __all__ : if t != name : others . append ( '<li><a href="?name=%s">%s</a></li>' % ( t , t ) ) others = "\n" . join ( others ) return """<html>
<head>
<title>PyCAPTCHA Example</title>
</head>
<body>
<h1>PyCAPTCHA Example (for mod_python)</h1>
<p>
  <b>%s</b>:
  %s
</p>

<p><img src="image?id=%s"/></p>
<p>
  <form action="solution" method="get">
    Enter the word shown:
    <input type="text" name="word"/>
    <input type="hidden" name="id" value="%s"/>
  </form>
</p>

<p>
Or try...
<ul>
%s
</ul>
</p>

</body>
</html>
""" % ( test . __class__ . __name__ , test . __doc__ , test . id , test . id , others )