def to_site(self, el): # import pdb; pdb.set_trace() # site = to_html_string(el) # with open(self.output_folder + '/TRC-2015-Executive-Summary.html', 'w') as f: # f.write(site.encode('utf-8')) # return '' return to_html_string(el)
def parse_description(sequence, index, *stop_tags): desc = "" while len(sequence) > index and sequence[index].tag not in stop_tags: desc += to_html_string(sequence[index]) + "\n" index += 1 return desc.strip() if desc else None, index