[biplan] code optimisation
This commit is contained in:
parent
7dee2218ff
commit
13b61f0559
1 changed files with 2 additions and 4 deletions
|
|
@ -88,9 +88,7 @@ class ProgramPage(HTMLPage):
|
||||||
klass = BiplanCalendarEventConcert if Env('is_concert') else BiplanCalendarEventTheatre
|
klass = BiplanCalendarEventConcert if Env('is_concert') else BiplanCalendarEventTheatre
|
||||||
|
|
||||||
def condition(self):
|
def condition(self):
|
||||||
if(self.el.xpath('./div')):
|
return (self.el.xpath('./div'))
|
||||||
return True
|
|
||||||
return False
|
|
||||||
|
|
||||||
def validate(self, obj):
|
def validate(self, obj):
|
||||||
return (self.is_valid_event(obj, self.env['city'], self.env['categories']) and
|
return (self.is_valid_event(obj, self.env['city'], self.env['categories']) and
|
||||||
|
|
@ -136,7 +134,7 @@ class EventPage(HTMLPage):
|
||||||
event.description = CleanHTML("%s/div/div[@class='presentation-popup']" % _div)(self)
|
event.description = CleanHTML("%s/div/div[@class='presentation-popup']" % _div)(self)
|
||||||
raise SkipItem()
|
raise SkipItem()
|
||||||
|
|
||||||
self.env['is_concert'] = not div.attrib['class'] == 'theatre-popup'
|
self.env['is_concert'] = (div.attrib['class'] != 'theatre-popup')
|
||||||
self.env['url'] = self.page.url
|
self.env['url'] = self.page.url
|
||||||
|
|
||||||
obj_id = Env('_id')
|
obj_id = Env('_id')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue