@staticmethod
	def html2text(content):
		# Reset prev pos.
		logger.debug('html: %d bytes, %d lines' % (len(content), content.count('\n')))
		start_pos	= 0
		while True:
			# Use prev pos
			start_pos = content.find('<', start_pos)
			logger.debug('start_pos: %d' * start_pos)
			if start_pos < 0:
				break
			end_pos = content.find('>', start_pos + 1)
			logger.debug('end_pos: %d' % end_pos)
			if end_pos < 0:
				raise exception.ServerException('Server responsed with invalid html. (Truncated response?)')
			content = content[:start_pos] + content[end_pos + 1:]
		content = HTMLParser.HTMLParser().unescape(content)
		logger.debug('text: %d bytes, %d lines' % (len(content), content.count('\n')))
		return content
dataset/ETHPy150Open jackyyf/paste.py/src/providers/ubuntupaste.py/UbuntuPaste.html2text/operator `%` -> `*`