Pep8 cleanup on freemobile module

This commit is contained in:
Florent 2012-03-13 14:41:11 +01:00
commit dfb66a4fbd
5 changed files with 35 additions and 35 deletions

View file

@ -36,8 +36,12 @@ class FreeMobileBackend(BaseBackend, ICapBill):
VERSION = '0.b' VERSION = '0.b'
LICENSE = 'AGPLv3+' LICENSE = 'AGPLv3+'
DESCRIPTION = 'Free Mobile website' DESCRIPTION = 'Free Mobile website'
CONFIG = BackendConfig(ValueBackendPassword('login', label='Account ID', masked=False, regexp='^(\d{8}|)$'), CONFIG = BackendConfig(ValueBackendPassword('login',
ValueBackendPassword('password', label='Password') label='Account ID',
masked=False,
regexp='^(\d{8}|)$'),
ValueBackendPassword('password',
label='Password')
) )
BROWSER = Freemobile BROWSER = Freemobile

View file

@ -23,6 +23,7 @@ from weboob.capabilities.bill import Detail
__all__ = ['HistoryPage'] __all__ = ['HistoryPage']
def convert_price(div): def convert_price(div):
try: try:
price = div.find('div[@class="horsForfait"]/p/span').text price = div.find('div[@class="horsForfait"]/p/span').text
@ -55,7 +56,6 @@ class HistoryPage(BasePage):
divint = self.document.xpath('//div[@class="international hide"]')[0] divint = self.document.xpath('//div[@class="international hide"]')[0]
self.iter_divs(divint.xpath('div[@class="detail"]'), True) self.iter_divs(divint.xpath('div[@class="detail"]'), True)
def iter_divs(self, divs, inter=False): def iter_divs(self, divs, inter=False):
for div in divs: for div in divs:
detail = Detail() detail = Detail()
@ -68,8 +68,6 @@ class HistoryPage(BasePage):
self.details.append(detail) self.details.append(detail)
def get_calls(self): def get_calls(self):
return self.calls return self.calls

View file

@ -25,6 +25,7 @@ from weboob.tools.browser import BasePage
__all__ = ['LoginPage'] __all__ = ['LoginPage']
class FreeKeyboard(object): class FreeKeyboard(object):
DEBUG = False DEBUG = False
symbols = {'0': '001111111111110011111111111111111111111111111110000000000011110000000000011111111111111111011111111111111001111111111110', symbols = {'0': '001111111111110011111111111111111111111111111110000000000011110000000000011111111111111111011111111111111001111111111110',
@ -63,12 +64,11 @@ class FreeKeyboard(object):
if self.DEBUG: if self.DEBUG:
image.save('/tmp/' + s + '.png') image.save('/tmp/' + s + '.png')
def get_symbol_code(self, digit): def get_symbol_code(self, digit):
fingerprint = self.symbols[digit] fingerprint = self.symbols[digit]
i = 0 i = 0
for string in self.fingerprints: for string in self.fingerprints:
if string.__eq__(fingerprint): if string == fingerprint:
return i return i
i += 1 i += 1
# Image contains some noise, and the match is not always perfect # Image contains some noise, and the match is not always perfect
@ -122,5 +122,3 @@ class LoginPage(BasePage):
vk.get_small(code) vk.get_small(code)
self.browser['pwd_abo'] = password self.browser['pwd_abo'] = password
self.browser.submit(nologin=True) self.browser.submit(nologin=True)