[tor-commits] [bridgedb/develop] Pep8; move ReCaptchaKeyError to the beginning of captcha.py.

isis at torproject.org isis at torproject.org
Sun Mar 16 16:38:45 UTC 2014


commit 624e60cda89faa6cd6e032feba59078478b50169
Author: Isis Lovecruft <isis at torproject.org>
Date:   Fri Feb 28 23:38:55 2014 +0000

    Pep8; move ReCaptchaKeyError to the beginning of captcha.py.
---
 lib/bridgedb/captcha.py |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/lib/bridgedb/captcha.py b/lib/bridgedb/captcha.py
index 430643c..67b23d3 100644
--- a/lib/bridgedb/captcha.py
+++ b/lib/bridgedb/captcha.py
@@ -38,6 +38,13 @@ from BeautifulSoup import BeautifulSoup
 from recaptcha.client import captcha as recaptcha
 
 
+class ReCaptchaKeyError(Exception):
+    """Exception raised when recaptcha API keys are not supplied"""
+
+    def __init__(self):
+        msg = 'You must supply recaptcha API keys'
+        Exception.__init__(self, msg)
+
 class ReCaptcha(object):
     """ A recaptcha captcha and method to request them """
 
@@ -62,8 +69,3 @@ class ReCaptcha(object):
         self.challenge = str(soup.find('input', {'name' : 'recaptcha_challenge_field'})['value'])
         self.image = urllib2.urlopen(imgurl).read()
 
-class ReCaptchaKeyError(Exception):
-    """ Exception raised when recaptcha API keys are not supplied"""
-    def __init__(self):
-        msg = 'You must supply recaptcha API keys'
-        Exception.__init__(self, msg)





More information about the tor-commits mailing list