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