From f1482dd2189322b7f63a77066cafe71d6b65253d Mon Sep 17 00:00:00 2001 From: Alexandre Morignot Date: Thu, 27 Nov 2014 01:40:55 +0100 Subject: [PATCH] [residentadvisor] add ticket status --- modules/residentadvisor/pages.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/modules/residentadvisor/pages.py b/modules/residentadvisor/pages.py index 2b14302b..a0dba14f 100644 --- a/modules/residentadvisor/pages.py +++ b/modules/residentadvisor/pages.py @@ -18,7 +18,7 @@ # along with weboob. If not, see . -from weboob.capabilities.calendar import CATEGORIES, STATUS +from weboob.capabilities.calendar import CATEGORIES, STATUS, TICKET from weboob.browser.elements import ItemElement, ListElement, method from weboob.browser.filters.html import Attr, CleanHTML, Link from weboob.browser.filters.standard import CleanDecimal, CleanText, Date, CombineDate, DateTime, Regexp, Time, Type @@ -96,6 +96,17 @@ class EventPage(BasePage): return end_date + def obj_ticket(self): + li_class = Attr('//li[@id="tickets"]//li[1]', 'class', default=None)(self) + + if li_class: + if li_class == 'closed': + return TICKET.CLOSED + else: + return TICKET.AVAILABLE + + return TICKET.NOTAVAILABLE + class SearchPage(BasePage): @method