Пример #1
0
    def _get_folder_icon_src(self):
        request = Request.blank(self.ob.aq_parent.absolute_url())
        request.headers['Cookie'] = '__ac=YWRtaW46'  # login as "admin"
        page = parse_html(request.get_response(self.wsgi_request).body)
        for tr in css(page, 'table#folderfile_list tr'):
            links = [a.attrib['href'] for a in css(tr, 'td a')]
            if self.ob.absolute_url() in links:
                break
        else:
            self.fail("Link to object %r not found" % self.ob)

        return css(tr, 'td img')[0].attrib['src']
Пример #2
0
    def _get_folder_icon_src(self):
        request = Request.blank(self.ob.aq_parent.absolute_url())
        request.headers['Cookie'] = '__ac=YWRtaW46' # login as "admin"
        page = parse_html(request.get_response(self.wsgi_request).body)
        for tr in css(page, 'table#folderfile_list tr'):
            links = [a.attrib['href'] for a in css(tr, 'td a')]
            if self.ob.absolute_url() in links:
                break
        else:
            self.fail("Link to object %r not found" % self.ob)

        return css(tr, 'td img')[0].attrib['src']
Пример #3
0
 def _get_h1_icon_src(self):
     request = Request.blank(self.ob.absolute_url())
     page = parse_html(request.get_response(self.wsgi_request).body)
     return css(page, 'h1 img')[0].attrib['src']
Пример #4
0
 def _get_h1_icon_src(self):
     request = Request.blank(self.ob.absolute_url())
     page = parse_html(request.get_response(self.wsgi_request).body)
     return css(page, 'h1 img')[0].attrib['src']