rename BasePage.loaded() to on_loaded()
This commit is contained in:
parent
3b312923ea
commit
42de7aa5a3
16 changed files with 18 additions and 18 deletions
|
|
@ -97,7 +97,7 @@ class ContactItem:
|
|||
|
||||
|
||||
class ContactListPage(PageBase):
|
||||
def loaded(self):
|
||||
def on_loaded(self):
|
||||
self.items = []
|
||||
|
||||
tags = self.document.getElementsByTagName('form')[0].childNodes[3].childNodes[1].childNodes
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ class ContactThreadPage(PageBase):
|
|||
|
||||
id_regexp = re.compile("/thread.php\?id=([0-9]+)")
|
||||
|
||||
def loaded(self):
|
||||
def on_loaded(self):
|
||||
self.items = []
|
||||
|
||||
a_list = self.document.getElementsByTagName('a')
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class RegisterConfirmPage(PageBase):
|
|||
pass
|
||||
|
||||
class RedirectPage(PageBase):
|
||||
def loaded(self):
|
||||
def on_loaded(self):
|
||||
for link in self.browser.links():
|
||||
print link
|
||||
self.browser.location('/wait.php')
|
||||
|
|
@ -82,5 +82,5 @@ class ShopPage(PageBase):
|
|||
pass
|
||||
|
||||
class ErrPage(PageBase):
|
||||
def loaded(self):
|
||||
def on_loaded(self):
|
||||
raise BrowserIncorrectPassword('Incorrect login/password')
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ class ProfilePage(PageBase, Profile):
|
|||
name = self.name
|
||||
return '<Profile name="%s">' % name
|
||||
|
||||
def loaded(self):
|
||||
def on_loaded(self):
|
||||
self.name = u''
|
||||
self.description = u''
|
||||
self.table = deepcopy(self.empty_table)
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ class ProfilesListBase(PageBase):
|
|||
WITHOUT_PHOTO = 'http://s.adopteunmec.com/img/thumb0.gif'
|
||||
SHOW_WITHOUT_PHOTO = True
|
||||
|
||||
def loaded(self):
|
||||
def on_loaded(self):
|
||||
|
||||
self.id_list = []
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ from time import sleep
|
|||
|
||||
class WaitPage(PageBase):
|
||||
|
||||
def loaded(self):
|
||||
def on_loaded(self):
|
||||
raise AdopteWait()
|
||||
|
||||
def check(self):
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ from weboob.capabilities.bank import Operation
|
|||
|
||||
class AccountComing(BasePage):
|
||||
|
||||
def loaded(self):
|
||||
def on_loaded(self):
|
||||
self.operations = []
|
||||
|
||||
for tr in self.document.getiterator('tr'):
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@ from weboob.tools.browser import BasePage
|
|||
class AccountsList(BasePage):
|
||||
LINKID_REGEXP = re.compile(".*ch4=(\w+).*")
|
||||
|
||||
def loaded(self):
|
||||
def on_loaded(self):
|
||||
pass
|
||||
|
||||
def get_list(self):
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ from weboob.tools.browser import BasePage
|
|||
from weboob.backends.bnporc.captcha import Captcha, TileError
|
||||
|
||||
class LoginPage(BasePage):
|
||||
def loaded(self):
|
||||
def on_loaded(self):
|
||||
pass
|
||||
|
||||
def login(self, login, password):
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ from weboob.capabilities.bank import Account
|
|||
from .base import CragrBasePage
|
||||
|
||||
class AccountsList(CragrBasePage):
|
||||
def loaded(self):
|
||||
def on_loaded(self):
|
||||
pass
|
||||
|
||||
def get_list(self):
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ import ClientForm
|
|||
from .base import CragrBasePage
|
||||
|
||||
class LoginPage(CragrBasePage):
|
||||
def loaded(self):
|
||||
def on_loaded(self):
|
||||
pass
|
||||
|
||||
def login(self, login, password):
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ class IndexPage(DLFPPage):
|
|||
pass
|
||||
|
||||
class LoginPage(DLFPPage):
|
||||
def loaded(self):
|
||||
def on_loaded(self):
|
||||
if self.has_error():
|
||||
raise BrowserIncorrectPassword()
|
||||
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ class Article(object):
|
|||
self.part2 = self.browser.tostring(div)
|
||||
|
||||
class ContentPage(DLFPPage):
|
||||
def loaded(self):
|
||||
def on_loaded(self):
|
||||
self.article = None
|
||||
for div in self.document.find('body').find('div').findall('div'):
|
||||
self.parse_div(div)
|
||||
|
|
|
|||
|
|
@ -21,5 +21,5 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
from weboob.tools.browser import BasePage
|
||||
|
||||
class RoutePage(BasePage):
|
||||
def loaded(self):
|
||||
def on_loaded(self):
|
||||
return
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|||
from weboob.tools.browser import BasePage
|
||||
|
||||
class VideoPage(BasePage):
|
||||
def loaded(self):
|
||||
def on_loaded(self):
|
||||
found = self.document.getroot().cssselect('meta[name=title]')
|
||||
if found:
|
||||
content = found[0].attrib['content']
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ class BasePage(object):
|
|||
self.document = document
|
||||
self.url = url
|
||||
|
||||
def loaded(self):
|
||||
def on_loaded(self):
|
||||
"""
|
||||
Called when the page is loaded.
|
||||
"""
|
||||
|
|
@ -234,7 +234,7 @@ class BaseBrowser(mechanize.Browser):
|
|||
|
||||
document = self.__parser.parse(result, self.ENCODING)
|
||||
self.page = pageCls(self, document, result.geturl())
|
||||
self.page.loaded()
|
||||
self.page.on_loaded()
|
||||
|
||||
if self.password is not None and not self.is_logged():
|
||||
debug('!! Relogin !!')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue