[weboob] [PATCH 3/7] VirtKeyboard: symbol detection improvement

Pierre Mazière pierre.maziere at gmail.com
Thu Nov 3 10:02:56 CET 2011


Signed-off-by: Pierre Mazière <pierre.maziere at gmail.com>
---
 weboob/backends/bnporc/pages/login.py |    4 ++--
 weboob/tools/captcha/virtkeyboard.py  |   10 ++++------
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/weboob/backends/bnporc/pages/login.py b/weboob/backends/bnporc/pages/login.py
index 6a335e6..d894486 100644
--- a/weboob/backends/bnporc/pages/login.py
+++ b/weboob/backends/bnporc/pages/login.py
@@ -105,8 +105,8 @@ class ChangePasswordPage(BasePage):
                  '4':'2359eea8671bf112b58264bec0294f71',
                  '5':'82b55b63480114f04fad8c5c4fa5673a',
                  '6':'e074864faeaeabb3be3d118192cd8879',
-                 '7':'753468d88d4810206a6f0ab9c6ef1b16',
-                 '8':'9cc4789a2cb223e8f2d5e676e90264b5',
+                 '7':'af5740e4ca71fadc6f4ae1412d864a1c',
+                 '8':'cab759c574038ad89a0e35cc76ab7214',
                  '9':'828cf0faf86ac78e7f43208907620527'
                 }
 
diff --git a/weboob/tools/captcha/virtkeyboard.py b/weboob/tools/captcha/virtkeyboard.py
index 5ed4bc2..85dbbb0 100644
--- a/weboob/tools/captcha/virtkeyboard.py
+++ b/weboob/tools/captcha/virtkeyboard.py
@@ -67,9 +67,8 @@ class VirtKeyboard(object):
                         break;
                     else:
                         break
-            if newY1!=-1 and empty_line:
-                newY2=y-1
-                break
+            if newY1!=-1 and not empty_line:
+                newY2=y
         newX1=-1
         newX2=-1
         for x in range(x1,min(x2+1,self.width)):
@@ -82,9 +81,8 @@ class VirtKeyboard(object):
                         break
                     else:
                         break
-            if newX1!=-1 and empty_column:
-                newX2=x-1
-                break
+            if newX1!=-1 and not empty_column:
+                newX2=x
         return (newX1,newY1,newX2,newY2)
 
     def checksum(self,(x1,y1,x2,y2)):
-- 
1.7.7



More information about the weboob mailing list