def get_contents(self):
    for encoding in self.encodings:
        try:
            lines = codecs.open(self.path, 'r', encoding)
            html = ' '.join((line.rstrip('\r\n') for line in lines))
            return self.__get_contents_in_html(html)
        except UnicodeDecodeError:
            continue
    print(('Cannot detect encoding of ' + self.path))
    return None
def get_contents(self):
    for encoding in self.encodings:
        try:
            lines = codecs.open(self.path, 'r', encoding)
            html = ' '.join((line.rstrip('\r\n') for line in lines))
            return self.__get_contents_in_html(html)
        except UnicodeDecodeError:
            continue
    print(('Cannot detect encoding of ' + self.path))
    return None