Whitespace, fix permission name and fix interface declaration.

svn path=/plone.formwidget.captcha/trunk/; revision=39602
This commit is contained in:
Hanno Schlichting 2010-09-02 10:35:40 +00:00
parent c1a4ac4b19
commit 0f63bc5345
2 changed files with 23 additions and 23 deletions

View File

@ -2,18 +2,17 @@
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser"
i18n_domain="collective.captcha">
<browser:view
name="captcha"
for="*"
permission="zope2.Public"
permission="zope.Public"
provides=".interfaces.ICaptchaView"
class=".captcha.Captcha"
>
class=".captcha.Captcha">
<browser:page name="image" attribute="image" />
<browser:page name="audio" attribute="audio" />
</browser:view>
</configure>

View File

@ -1,38 +1,39 @@
from zope.interface import Interface
class ICaptchaView(Interface):
"""Captcha generating and verifying view
Usage:
Usage:
- Use the view from a page to generate an image tag and/or an audio
URL. Use the 'image_tag' and 'audio_url' methods for these.
- Place the image tag and/or audio url in the page
- The image tag will load the captcha for the user, or the user will
use the audio url to listen to the aural captcha.
- The user will identify the word, and tell the server through a form
submission.
- Use the user input to verify.
The view will ensure that captcha state is preserved until verification
has taken place. The image tag and audio url for a given instance of the
captcha view will give the same word.
"""
def image_tag(self):
def image_tag():
"""Generate an image tag linking to a captcha"""
def audio_url(self):
def audio_url():
"""A URL for an aural captcha"""
def verify(self, input):
def verify(input):
"""Verify the user-supplied input.
Returns a boolean value indicating if the input matched
"""