overload & and | operators to chain filters (refs #1426)
This commit is contained in:
parent
e025fb0b20
commit
8efd37e71d
5 changed files with 66 additions and 47 deletions
|
|
@ -72,12 +72,12 @@ class PastePage(BasePastebinPage):
|
|||
self.env['header'] = el.find('//div[@id="content_left"]//div[@class="paste_box_info"]')
|
||||
|
||||
obj_id = Env('id')
|
||||
obj_title = Base(Env('header'), CleanText('.//div[@class="paste_box_line1"]//h1'))
|
||||
obj_title = Base(Env('header')) & CleanText('.//div[@class="paste_box_line1"]//h1')
|
||||
obj_contents = RawText('//textarea[@id="paste_code"]')
|
||||
obj_public = Base(
|
||||
Env('header'),
|
||||
CleanVisibility(Attr('.//div[@class="paste_box_line1"]//img', 'title')))
|
||||
obj__date = Base(Env('header'), DateTime(Attr('.//div[@class="paste_box_line2"]/span[1]', 'title')))
|
||||
obj_public = Base(Env('header')) \
|
||||
& Attr('.//div[@class="paste_box_line1"]//img', 'title') \
|
||||
& CleanVisibility()
|
||||
obj__date = Base(Env('header')) & Attr('.//div[@class="paste_box_line2"]/span[1]', 'title') & DateTime()
|
||||
|
||||
|
||||
class PostPage(BasePastebinPage):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue