Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

pypm install silva.captcha

How to install silva.captcha

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install silva.captcha
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
1.1 Available View build log
Windows (64-bit)
1.1 Available View build log
Mac OS X (10.5+)
1.1 Available View build log
Linux (32-bit)
1.1 Available View build log
Linux (64-bit)
1.1 Available View build log
Lastest release
version 1.1 on Jan 5th, 2011

Copyright (c) 2008, Infrae. All rights reserved. See also LICENSE.txt

Captcha Support for Silva

This is a captcha support for Silva. It works with the help of collective.captcha, and plone.keyring.

After installing the extension, you can either use a formlib widget, or ask the captcha directly.

You can get the captcha image in your template the following way:

<tal:captcha tal:define="captcha nocall:here/@@captcha"

System Message: ERROR/3 (<string>, line 16)

Inconsistent literal block quoting.

tal:content="structure captcha/image_tag"> </tal:captcha>

You can get the captcha as a sound file like this:

<div class="captchaAudio"

System Message: ERROR/3 (<string>, line 22)

Inconsistent literal block quoting.

tal:define="captcha nocall:here/@@captcha"> <a href="#" target="_blank" tal:attributes="href captcha/audio_url">Audio version</a> </div>

You can validate an captcha entry like this:

System Message: WARNING/2 (<string>, line 29)

Literal block expected; none found.

from zope.component import getMultiAdapter

captcha = getMultiAdapter((self.context, self.request), name='captcha') if not captcha.verify(input): # Bad value else: # Good value

This extension require at least Silva 2.0.7 or higher. You can have more information about collective.captcha.

Use in Python Script

In your Python Script/Code Sources, you can use for example:

System Message: WARNING/2 (<string>, line 46)

Literal block expected; none found.

from silva.captcha import validate

request = context.REQUEST input = request.form.get('captcha_field', None) if not validate(context, context.REQUEST, input): # Bad value else: # Good value

This will validate (or not) the input of the captcha.


If you installed Silva using buildout, by getting one from the Infrae SVN repository, or creating one using Paster, you should edit your buildout configuration file buildout.cfg to add or edit the following section:


eggs = ... silva.captcha

zcml = ... silva.captcha

If the section instance wasn't already in the configuration file, pay attention to re-copy values for eggs and zcml from the profile you use.

After you can restart buildout:

$ ./bin/buildout

If you don't use buildout, you can install this extension using easy_install, and after create a file called silva.captcha-configure.zcml in the /path/to/instance/etc/package-includes directory. This file will responsible to load the extension and should only contain this:

<include package="silva.captcha" />

Latest version

The latest version is available in a Subversion repository.


1.1 (2008-11-12)
  • Add a validate method for Python Scripts and Code sources.
  • Don't make Silva Root become a local site if it's already the case

System Message: WARNING/2 (<string>, line 114)

Bullet list ends without a blank line; unexpected unindent.

(i.e. Silva 2.2).

1.0.1 (2008-06-04)
  • Fix broken extension uninstall,
  • Add simple test to test extension install/uninstall.
1.0 (2008-05-27)
  • Initial release

Subscribe to package updates

Last updated Jan 5th, 2011

Download Stats

Last month:2

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.