Create an id for calls

This commit is contained in:
Florent 2013-01-28 15:45:44 +01:00
commit 9d693bd982
2 changed files with 6 additions and 2 deletions

View file

@ -80,7 +80,11 @@ 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=' + subscription._login) self.location('/moncompte/ajax.php?page=consotel_current_month', 'login=' + subscription._login)
return self.page.get_calls(subscription) num = 0
for call in self.page.get_calls():
call.id = subscription.id + "-%s" % num
num += 1
yield call
def get_details(self, subscription): def get_details(self, subscription):
if not self.is_on_page(DetailsPage): if not self.is_on_page(DetailsPage):

View file

@ -161,5 +161,5 @@ class HistoryPage(BasePage):
self.calls.append(detail) self.calls.append(detail)
def get_calls(self, subscription): def get_calls(self):
return sorted(self.calls, key=_get_date, reverse=True) return sorted(self.calls, key=_get_date, reverse=True)