Esempio n. 1
0
    def __init__(self, basepage):
        divkeyboard = basepage.document.find(
            "//div[@id='clavierdisplayLogin']")
        if divkeyboard is None:
            divkeyboard = basepage.document.find(
                "//div[@id='claviertransfer']")
        try:
            img = divkeyboard.xpath("img")[1]
        except:
            raise BrowserIncorrectPassword()
        url = img.attrib.get("src")
        coords = {}
        coords["11"] = (5, 5, 33, 33)
        coords["21"] = (45, 5, 73, 33)
        coords["31"] = (85, 5, 113, 33)
        coords["41"] = (125, 5, 153, 33)
        coords["51"] = (165, 5, 193, 33)
        coords["12"] = (5, 45, 33, 73)
        coords["22"] = (45, 45, 73, 73)
        coords["32"] = (85, 45, 113, 73)
        coords["42"] = (125, 45, 153, 73)
        coords["52"] = (165, 45, 193, 73)

        VirtKeyboard.__init__(self, basepage.browser.openurl(url), coords,
                              self.color)

        self.check_symbols(self.symbols, basepage.browser.responses_dirname)
Esempio n. 2
0
    def __init__(self, basepage):
        divkeyboard = basepage.document.find("//div[@id='clavierdisplayLogin']")
        if divkeyboard is None:
            divkeyboard = basepage.document.find("//div[@id='claviertransfer']")
        try:
            img = divkeyboard.xpath("img")[1]
        except:
            raise BrowserIncorrectPassword()
        url = img.attrib.get("src")
        coords = {}
        coords["11"] = (5, 5, 33, 33)
        coords["21"] = (45, 5, 73, 33)
        coords["31"] = (85, 5, 113, 33)
        coords["41"] = (125, 5, 153, 33)
        coords["51"] = (165, 5, 193, 33)
        coords["12"] = (5, 45, 33, 73)
        coords["22"] = (45, 45, 73, 73)
        coords["32"] = (85, 45, 113, 73)
        coords["42"] = (125, 45, 153, 73)
        coords["52"] = (165, 45, 193, 73)

        VirtKeyboard.__init__(self, basepage.browser.openurl(url), coords, self.color)

        if basepage.browser.responses_dirname is None:
            basepage.browser.responses_dirname = \
                    tempfile.mkdtemp(prefix='weboob_session_')
        self.check_symbols(self.symbols, basepage.browser.responses_dirname)
Esempio n. 3
0
    def __init__(self, basepage):
        self.basepage = basepage
        divkeyboard = basepage.doc.find("//div[@id='clavierdisplayLogin']")
        if divkeyboard is None:
            divkeyboard = basepage.doc.find("//div[@id='claviertransfer']")
        try:
            img = divkeyboard.xpath("img")[1]
        except:
            raise BrowserIncorrectPassword()
        url = img.attrib.get("src")
        coords = {}
        coords["11"] = (5, 5, 33, 33)
        coords["21"] = (45, 5, 73, 33)
        coords["31"] = (85, 5, 113, 33)
        coords["41"] = (125, 5, 153, 33)
        coords["51"] = (165, 5, 193, 33)
        coords["12"] = (5, 45, 33, 73)
        coords["22"] = (45, 45, 73, 73)
        coords["32"] = (85, 45, 113, 73)
        coords["42"] = (125, 45, 153, 73)
        coords["52"] = (165, 45, 193, 73)

        VirtKeyboard.__init__(self, StringIO(basepage.browser.open(url).content), coords, self.color)

        self.check_symbols(self.symbols, basepage.browser.responses_dirname)
Esempio n. 4
0
    def __init__(self, page):
        m = re.search(r'background:url\("(.*?)"\)',
                      ''.join(page.document.xpath('//script/text()')))
        if m:
            img_url = m.group(1)
            size = 252
        else:
            img_url = page.document.xpath(
                '//img[@id="imageCVS"]')[0].attrib['src']
            size = 146
        coords = {}

        x, y, width, height = (0, 0, size / 4, size / 4)
        for i, _ in enumerate(
                page.document.xpath('//div[@id="imageclavier"]//button')):
            code = '%02d' % i
            coords[code] = (x + 4, y + 4, x + width - 8, y + height - 8)
            if (x + width + 1) >= size:
                y += height + 1
                x = 0
            else:
                x += width + 1

        VirtKeyboard.__init__(self, page.browser.openurl(img_url), coords,
                              self.color)

        self.check_symbols(self.symbols, page.browser.responses_dirname)
Esempio n. 5
0
    def __init__(self, page):
        VirtKeyboard.__init__(self,
                              BytesIO(page.content),
                              self.coords,
                              self.color,
                              convert='RGB')

        self.check_symbols(self.symbols, None)
Esempio n. 6
0
    def __init__(self, page):
        self.page = page
        img = page.doc.xpath("//div[has-class('clavier')]/img")
        if len(img) == 0:
            raise BrowserIncorrectPassword()

        url = Attr(".", "src")(img[1])

        VirtKeyboard.__init__(self, StringIO(self.page.browser.open(url).content), self.coords, self.color)

        self.check_symbols(self.symbols, self.page.browser.responses_dirname)
Esempio n. 7
0
    def __init__(self, page):
        self.page = page
        img = page.doc.xpath("//div[has-class('clavier')]/img")
        if len(img) == 0:
            raise BrowserIncorrectPassword()

        url = Attr('.', "src")(img[1])

        VirtKeyboard.__init__(self, StringIO(self.page.browser.open(url).content),
                              self.coords, self.color)

        self.check_symbols(self.symbols, self.page.browser.responses_dirname)
Esempio n. 8
0
    def __init__(self, basepage):
        coords = {}
        coords["01"] = (31, 28, 49, 49)
        coords["02"] = (108, 28, 126, 49)
        coords["03"] = (185, 28, 203, 49)
        coords["04"] = (262, 28, 280, 49)
        coords["05"] = (339, 28, 357, 49)
        coords["06"] = (31, 100, 49, 121)
        coords["07"] = (108, 100, 126, 121)
        coords["08"] = (185, 100, 203, 121)
        coords["09"] = (262, 100, 280, 121)
        coords["10"] = (339, 100, 357, 121)

        VirtKeyboard.__init__(self, basepage.browser.openurl(self.url % time.time()), coords, self.color)
        self.check_symbols(self.symbols, basepage.browser.responses_dirname)
Esempio n. 9
0
    def __init__(self, basepage):
        coords = {
            "01": (31, 28, 49, 49),
            "02": (108, 28, 126, 49),
            "03": (185, 28, 203, 49),
            "04": (262, 28, 280, 49),
            "05": (339, 28, 357, 49),
            "06": (31, 100, 49, 121),
            "07": (108, 100, 126, 121),
            "08": (185, 100, 203, 121),
            "09": (262, 100, 280, 121),
            "10": (339, 100, 357, 121),
        }

        VirtKeyboard.__init__(self, basepage.browser.openurl(self.url % time.time()), coords, self.color)
        self.check_symbols(self.symbols, basepage.browser.responses_dirname)
Esempio n. 10
0
    def __init__(self, page):
        coords = {}

        size = 136
        x, y, width, height = (0, 0, size/5, size/5)
        for a in page.document.xpath('//div[@id="secret-nbr-keyboard"]/a'):
            code = a.attrib['ondblclick']
            coords[code] = (x+1, y+1, x+height-2, y+height-2)
            if (x + width + 1) >= size:
                y += height
                x = 0
            else:
                x += width

        VirtKeyboard.__init__(self, page.browser.openurl(self.url % time.time()), coords, self.color)

        self.check_symbols(self.symbols, page.browser.responses_dirname)
Esempio n. 11
0
    def __init__(self, page):
        img_url = re.search('background:url\((.*?)\)',etree.tostring(page.document)).group(1)
        coords = {}

        size = 252
        x, y, width, height = (0, 0, size/4, size/4)
        for i,a in enumerate(page.document.xpath('//div[@id="imageclavier"]//button')):
            code = '%02d' % i
            coords[code] = (x+8, y+8, x+height-8, y+height-8)
            if (x + width + 1) >= size:
                y += height
                x = 0
            else:
                x += width

        VirtKeyboard.__init__(self, page.browser.openurl(img_url), coords, self.color)

        self.check_symbols(self.symbols, page.browser.responses_dirname)
Esempio n. 12
0
    def __init__(self, page):
        coords = {}

        size = 136
        x, y, width, height = (0, 0, size / 5, size / 5)
        for a in page.document.xpath('//div[@id="secret-nbr-keyboard"]/a'):
            code = a.attrib['ondblclick']
            coords[code] = (x + 1, y + 1, x + height - 2, y + height - 2)
            if (x + width + 1) >= size:
                y += height
                x = 0
            else:
                x += width

        VirtKeyboard.__init__(self,
                              page.browser.openurl(self.url % time.time()),
                              coords, self.color)

        self.check_symbols(self.symbols, page.browser.responses_dirname)
Esempio n. 13
0
    def __init__(self, page):
        m = re.search(r'background:url\((.*?)\)',etree.tostring(page.document))
        if m:
            img_url = m.group(1)
            size = 252
        else:
            img_url = page.document.xpath('//img[@id="imageCVS"]')[0].attrib['src']
            size = 146
        coords = {}

        x, y, width, height = (0, 0, size/4, size/4)
        for i, _ in enumerate(page.document.xpath('//div[@id="imageclavier"]//button')):
            code = '%02d' % i
            coords[code] = (x+4, y+4, x+width-8, y+height-8)
            if (x + width + 1) >= size:
                y += height + 1
                x = 0
            else:
                x += width + 1

        VirtKeyboard.__init__(self, page.browser.openurl(img_url), coords, self.color)

        self.check_symbols(self.symbols, page.browser.responses_dirname)
Esempio n. 14
0
    def __init__(self, page):
        img_url = Regexp(CleanText('//style'), r'background:url\((.*?)\)', default=None)(page.doc) or \
                  Regexp(CleanText('//script'), r'IMG_ALL = "(.*?)"', default=None)(page.doc)
        size = 252
        if not img_url:
            img_url = page.doc.xpath('//img[@id="imageCVS"]')[0].attrib['src']
            size = 146
        coords = {}

        x, y, width, height = (0, 0, size // 4, size // 4)
        for i, _ in enumerate(page.doc.xpath('//div[@id="imageclavier"]//button')):
            code = '%02d' % i
            coords[code] = (x+4, y+4, x+width-8, y+height-8)
            if (x + width + 1) >= size:
                y += height + 1
                x = 0
            else:
                x += width + 1

        data = page.browser.open(img_url).content
        VirtKeyboard.__init__(self, BytesIO(data), coords, self.color)

        self.check_symbols(self.symbols, page.browser.responses_dirname)
Esempio n. 15
0
    def __init__(self, page):
        img_url = Regexp(CleanText('//style'), r'background:url\((.*?)\)', default=None)(page.doc) or \
                  Regexp(CleanText('//script'), r'IMG_ALL = "(.*?)"', default=None)(page.doc)
        size = 252
        if not img_url:
            img_url = page.doc.xpath('//img[@id="imageCVS"]')[0].attrib['src']
            size = 146
        coords = {}

        x, y, width, height = (0, 0, size // 4, size // 4)
        for i, _ in enumerate(
                page.doc.xpath('//div[@id="imageclavier"]//button')):
            code = '%02d' % i
            coords[code] = (x + 4, y + 4, x + width - 8, y + height - 8)
            if (x + width + 1) >= size:
                y += height + 1
                x = 0
            else:
                x += width + 1

        data = page.browser.open(img_url).content
        VirtKeyboard.__init__(self, BytesIO(data), coords, self.color)

        self.check_symbols(self.symbols, page.browser.responses_dirname)
Esempio n. 16
0
    def __init__(self, page):
        VirtKeyboard.__init__(self, BytesIO(page.content), self.coords, self.color, convert='RGB')

        self.check_symbols(self.symbols, None)
Esempio n. 17
0
 def get_symbol_coords(self, coords):
     # strip borders
     x1, y1, x2, y2 = coords
     return VirtKeyboard.get_symbol_coords(self, (x1+3, y1+3, x2-3, y2-3))
Esempio n. 18
0
 def get_symbol_code(self,md5sum):
     code = VirtKeyboard.get_symbol_code(self,md5sum)
     return '%02d' % int(code.split('_')[-1])
Esempio n. 19
0
 def get_symbol_code(self, md5sum):
     return VirtKeyboard.get_symbol_code(self, md5sum)
Esempio n. 20
0
 def get_symbol_coords(self, coords):
     # strip borders
     x1, y1, x2, y2 = coords
     return VirtKeyboard.get_symbol_coords(self,
                                           (x1 + 3, y1 + 3, x2 - 3, y2 - 3))
Esempio n. 21
0
 def get_symbol_code(self, md5sum):
     code = VirtKeyboard.get_symbol_code(self, md5sum)
     return '%02d' % int(code.split('_')[-1])
Esempio n. 22
0
 def get_symbol_code(self, md5sum):
     code = VirtKeyboard.get_symbol_code(self, md5sum)
     return code
Esempio n. 23
0
 def get_symbol_code(self, md5sum):
     code = VirtKeyboard.get_symbol_code(self, md5sum)
     return re.sub(u'[^\d]', '', code)
Esempio n. 24
0
 def get_symbol_code(self, md5sum):
     code = VirtKeyboard.get_symbol_code(self, md5sum)
     return re.sub(u'[^\d]', '', code)
Esempio n. 25
0
 def get_symbol_code(self, md5sum):
     code = VirtKeyboard.get_symbol_code(self, md5sum)
     return code