def ResultingHTML(self): table = Parse(self.OriginalHTML) row = table.at(0, self.Row - 1) cell = row.at(0, self.Column - 1) if (self.OverwriteCellBody is not None): cell.body = self.OverwriteCellBody if (self.AddToCellBody is not None): cell.addToBody(self.AddToCellBody) if (self.OverwriteCellTag is not None): cell.tag = self.OverwriteCellTag if (self.OverwriteEndCellTag is not None): cell.end = self.OverwriteEndCellTag if (self.AddToCellTag is not None): cell.addToTag(self.stripDelimiters(self.AddToCellTag)) if (self.OverwriteRowTag is not None): row.tag = self.OverwriteRowTag if (self.OverwriteEndRowTag is not None): row.end = self.OverwriteEndRowTag if (self.AddToRowTag is not None): row.addToTag(self.stripDelimiters(self.AddToRowTag)) if (self.OverwriteTableTag is not None): table.tag = self.OverwriteTableTag if (self.OverwriteEndTableTag is not None): table.end = self.OverwriteEndTableTag if (self.AddToTableTag is not None): table.addToTag(self.stripDelimiters(self.AddToTableTag)) if (self.AddCellFollowing is not None): self.addParse(cell, self.AddCellFollowing, ["td"]) if (self.RemoveFollowingCell is not None): self.removeParse(cell) if (self.AddRowFollowing is not None): self.addParse(row, self.AddRowFollowing, ["tr", "td"]) if (self.RemoveFollowingRow is not None): self.removeParse(row) if (self.AddTableFollowing is not None): self.addParse(table, self.AddTableFollowing, ["table", "tr", "td"]) return self.GenerateOutput(table)
def ResultingHTML(self): table = Parse(self.OriginalHTML) row = table.at(0, self.Row - 1) cell = row.at(0, self.Column - 1) if (self.OverwriteCellBody is not None): cell.body = self.OverwriteCellBody if (self.AddToCellBody is not None): cell.addToBody(self.AddToCellBody) if (self.OverwriteCellTag is not None): cell.tag = self.OverwriteCellTag if (self.OverwriteEndCellTag is not None): cell.end = self.OverwriteEndCellTag if (self.AddToCellTag is not None): cell.addToTag(self.stripDelimiters(self.AddToCellTag)) if (self.OverwriteRowTag is not None): row.tag = self.OverwriteRowTag if (self.OverwriteEndRowTag is not None): row.end = self.OverwriteEndRowTag if (self.AddToRowTag is not None): row.addToTag(self.stripDelimiters(self.AddToRowTag)) if (self.OverwriteTableTag is not None): table.tag = self.OverwriteTableTag if (self.OverwriteEndTableTag is not None): table.end = self.OverwriteEndTableTag if (self.AddToTableTag is not None): table.addToTag(self.stripDelimiters(self.AddToTableTag)) if (self.AddCellFollowing is not None): self.addParse(cell, self.AddCellFollowing, ["td"]) if (self.RemoveFollowingCell is not None): self.removeParse(cell) if (self.AddRowFollowing is not None): self.addParse(row, self.AddRowFollowing, ["tr", "td"]) if (self.RemoveFollowingRow is not None): self.removeParse(row) if (self.AddTableFollowing is not None): self.addParse(table, self.AddTableFollowing, ["table", "tr", "td"]) return self.GenerateOutput(table)
def buildCells(self, row): if not row: nil = Parse(tag="td",body="None",parts=None,more=None) nil.addToTag(" colspan="+str(len(self.columnBindings))) return nil next = root = Parse(None, None, None, None) for i in range(len(self.columnBindings)): next.more = Parse(tag="td",body=" ",parts=None,more=None) next = next.more a = self.columnBindings[i] if not a: self.ignore(next) else: try: a.target = row next.body = self.gray(self.escape(a.toString(a.get()))) except Exception, e: self.exception(next, e)
def buildCells(self, row): if not row: nil = Parse(tag="td", body="None", parts=None, more=None) nil.addToTag(" colspan=" + str(len(self.columnBindings))) return nil next = root = Parse(None, None, None, None) for i in range(len(self.columnBindings)): next.more = Parse(tag="td", body=" ", parts=None, more=None) next = next.more a = self.columnBindings[i] if not a: self.ignore(next) else: try: a.target = row next.body = self.gray(self.escape(a.toString(a.get()))) except Exception, e: self.exception(next, e)