Add multiaccount support for history command
This commit is contained in:
parent
adce6d0c83
commit
c4f44361b6
3 changed files with 6 additions and 3 deletions
|
|
@ -76,7 +76,7 @@ class Freemobile(BaseBrowser):
|
||||||
|
|
||||||
def get_history(self, subscription):
|
def get_history(self, subscription):
|
||||||
if not self.is_on_page(HistoryPage):
|
if not self.is_on_page(HistoryPage):
|
||||||
self.location('/moncompte/ajax.php?page=consotel_current_month', 'login=' + self.username)
|
self.location('/moncompte/ajax.php?page=consotel_current_month', 'login=' + subscription._login)
|
||||||
return self.page.get_calls(subscription)
|
return self.page.get_calls(subscription)
|
||||||
|
|
||||||
def get_details(self, subscription):
|
def get_details(self, subscription):
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,6 @@ class DetailsPage(BasePage):
|
||||||
return voice
|
return voice
|
||||||
|
|
||||||
def get_details(self, subscription):
|
def get_details(self, subscription):
|
||||||
print self.details
|
|
||||||
num = self.details['num' + subscription.id]
|
num = self.details['num' + subscription.id]
|
||||||
return self.details[num]
|
return self.details[num]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,12 @@ class HomePage(BasePage):
|
||||||
|
|
||||||
def get_list(self):
|
def get_list(self):
|
||||||
l = []
|
l = []
|
||||||
for divabo in self.document.xpath('//div[@class="idAbonne pointer"]'):
|
for divglobal in self.document.xpath('//div[@class="abonne"]'):
|
||||||
|
login = divglobal.xpath('//div[@class="acceuil_btn"]/a')[0].attrib['href'].split('l=')[1]
|
||||||
|
divabo = divglobal.xpath('div[@class="idAbonne pointer"]')[0]
|
||||||
owner = unicode(divabo.xpath('p')[0].text.replace(' - ', ''))
|
owner = unicode(divabo.xpath('p')[0].text.replace(' - ', ''))
|
||||||
phone = unicode(divabo.xpath('p/span')[0].text)
|
phone = unicode(divabo.xpath('p/span')[0].text)
|
||||||
|
self.browser.logger.debug('Found ' + login + ' as subscription identifier')
|
||||||
self.browser.logger.debug('Found ' + owner + ' as subscriber')
|
self.browser.logger.debug('Found ' + owner + ' as subscriber')
|
||||||
self.browser.logger.debug('Found ' + phone + ' as phone number')
|
self.browser.logger.debug('Found ' + phone + ' as phone number')
|
||||||
phoneplan = unicode(self.document.xpath('//div[@class="forfaitChoisi"]')[0].text.lstrip().rstrip())
|
phoneplan = unicode(self.document.xpath('//div[@class="forfaitChoisi"]')[0].text.lstrip().rstrip())
|
||||||
|
|
@ -41,5 +44,6 @@ class HomePage(BasePage):
|
||||||
subscription = Subscription(phone)
|
subscription = Subscription(phone)
|
||||||
subscription.label = phone + ' - ' + phoneplan
|
subscription.label = phone + ' - ' + phoneplan
|
||||||
subscription.subscriber = owner
|
subscription.subscriber = owner
|
||||||
|
subscription._login = login
|
||||||
|
|
||||||
yield subscription
|
yield subscription
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue