simplify and factorize code, remove dead code, follow conventions, use new-style classes

This commit is contained in:
Christophe Benz 2010-12-09 15:27:06 +01:00 committed by Romain Bignon
commit f1b3264a67
28 changed files with 202 additions and 251 deletions

View file

@ -24,7 +24,6 @@ __all__ = ['AccountComing']
class AccountComing(BasePage):
def on_loaded(self):
self.operations = []

View file

@ -24,7 +24,6 @@ __all__ = ['AccountHistory']
class AccountHistory(BasePage):
def on_loaded(self):
self.operations = []

View file

@ -24,6 +24,10 @@ from weboob.tools.browser import BasePage
from ..errors import PasswordExpired
__all__ = ['AccountsList']
class AccountsList(BasePage):
LINKID_REGEXP = re.compile(".*ch4=(\w+).*")

View file

@ -55,9 +55,11 @@ class LoginPage(BasePage):
self.browser['ch5'] = img.get_codes(password)
self.browser.submit()
class ConfirmPage(BasePage):
pass
class ChangePasswordPage(BasePage):
def change_password(self, current, new):
img = Captcha(self.browser.openurl('/NSImgGrille'))

View file

@ -15,6 +15,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import re
from weboob.tools.browser import BasePage
@ -56,6 +57,7 @@ class TransferPage(BasePage):
self.browser['T5'] = reason
self.browser.submit()
class TransferConfirmPage(BasePage):
def on_loaded(self):
for td in self.document.getroot().cssselect('td#size2'):
@ -67,6 +69,7 @@ class TransferConfirmPage(BasePage):
self.browser.location('/NS_VIRDA?stp=%s' % m.group(1))
return
class TransferCompletePage(BasePage):
def get_id(self):
return self.group_dict['id']