Removed unused imports. Raise ImportError when import fails.

svn path=/plone.app.discussion/trunk/; revision=39571
This commit is contained in:
Timo Stollenwerk 2010-08-31 17:36:28 +00:00
parent 77d3bc2eb1
commit 87ce946947

View File

@ -1,6 +1,6 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
"""Captcha validator, see captcha.txt for design notes.
# Captcha validator, see captcha.txt for design notes. """
from Acquisition import aq_inner from Acquisition import aq_inner
@ -10,6 +10,8 @@ from z3c.form.interfaces import IValidator
from zope.component import getMultiAdapter, queryUtility from zope.component import getMultiAdapter, queryUtility
from zope.interface import implements, Interface
from zope.schema.interfaces import IField from zope.schema.interfaces import IField
from zope.component import adapts from zope.component import adapts
@ -21,18 +23,14 @@ from plone.app.discussion.interfaces import IDiscussionLayer
try: try:
from plone.formwidget.captcha.validator import WrongCaptchaCode from plone.formwidget.captcha.validator import WrongCaptchaCode
except: except ImportError:
pass pass
try: try:
from plone.formwidget.recaptcha.validator import WrongCaptchaCode from plone.formwidget.recaptcha.validator import WrongCaptchaCode
except: except ImportError:
pass pass
from zope.interface import implements, Interface
from zope.schema.interfaces import IField
from zope.component import adapts
class CaptchaValidator(validator.SimpleFieldValidator): class CaptchaValidator(validator.SimpleFieldValidator):
implements(IValidator) implements(IValidator)