From 01f5c101a4a6e2b37b41373c8a1f1c4f65c1317b Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Sun, 5 Jul 2015 20:54:09 +0200 Subject: [PATCH] that's possible to have several md5sum in the same list --- weboob/tools/captcha/virtkeyboard.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/weboob/tools/captcha/virtkeyboard.py b/weboob/tools/captcha/virtkeyboard.py index d33ef690..eb6084a1 100644 --- a/weboob/tools/captcha/virtkeyboard.py +++ b/weboob/tools/captcha/virtkeyboard.py @@ -140,10 +140,14 @@ class VirtKeyboard(object): s += " " return hashlib.md5(s).hexdigest() - def get_symbol_code(self, md5sum): - for i in self.md5: - if md5sum == self.md5[i]: - return i + def get_symbol_code(self, md5sum_list): + if isinstance(md5sum_list, basestring): + md5sum_list = [md5sum_list] + + for md5sum in md5sum_list: + for i in self.md5: + if md5sum == self.md5[i]: + return i raise VirtKeyboardError('Symbol not found for hash "%s".' % md5sum) def get_string_code(self, string):