예제 #1
0
    def parse_items(self, items):
        table_header = items.find('tr', attrs={'class': 'patFuncHeaders'})
        if not table_header:
            return []
        headers = [th.string.strip() for th in table_header('th')]

        entries = []
        for row in table_header.findNextSiblings('tr'):
            entry = Item(self.library, self.card)
            i = 0
            for cell in row('td'):
                column_name = headers[i]
                if column_name == 'TITLE':
                    self.parse_title(cell, entry)

                elif column_name == 'STATUS':
                    status = parse_status(cell)
                    entry.status = status[0]
                    entry.add_status_note((' '.join(status[1:])).strip())
                i += 1
            entries.append(entry)
        return entries
예제 #2
0
    def parse_items(self, items):
        table_header = items.find("tr", attrs={"class": "patFuncHeaders"})
        if not table_header:
            return []
        headers = [th.string.strip() for th in table_header("th")]

        entries = []
        for row in table_header.findNextSiblings("tr"):
            entry = Item(self.library, self.card)
            i = 0
            for cell in row.findAll(td_or_th_regex):
                column_name = headers[i]
                if column_name == "TITLE":
                    self.parse_title(cell, entry)

                elif column_name == "STATUS":
                    status = parse_status(cell)
                    entry.status = status[0]
                    entry.add_status_note((" ".join(status[1:])).strip())
                i += 1
            entries.append(entry)
        return entries
예제 #3
0
    def parse_items(self, items):
        table_header = items.find('tr', attrs={'class': 'patFuncHeaders'})
        if not table_header:
            return []
        headers = [th.string.strip() for th in table_header('th')]

        entries = []
        for row in table_header.findNextSiblings('tr'):
            entry = Item(self.library, self.card)
            i = 0
            for cell in row('td'):
                column_name = headers[i]
                if column_name == 'TITLE':
                    self.parse_title(cell, entry)

                elif column_name == 'STATUS':
                    status = parse_status(cell)
                    entry.status = status[0]
                    entry.add_status_note((' '.join(status[1:])).strip())
                i += 1
            entries.append(entry)
        return entries