How to use the html2text.__version__ function in html2text

To help you get started, we’ve selected a few html2text examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Dieterbe / rss2email / rss2email.py View on Github external
smtpserver = send(fromhdr, tohdr, subjecthdr, content, contenttype, extraheaders, smtpserver)

					f.seen[frameid] = id

				f.etag, f.modified = r.get('etag', None), r.get('modified', None)
			except (KeyboardInterrupt, SystemExit):
				raise
			except:
				logging.warning ("=== rss2email encountered a problem with this feed ===")
				logging.warning ("=== See the rss2email FAQ at http://www.allthingsrss.com/rss2email/ for assistance ===")
				logging.warning ("=== If this occurs repeatedly, send this to lindsey@allthingsrss.com ===")
				logging.warning ("Could not parse %s", f.url)
				logging.warning (traceback.extract_stack())
				logging.warning ("rss2email %s", __version__)
				logging.warning ("feedparser %s", feedparser.__version__)
				logging.warning ("html2text %s", h2t.__version__)
				logging.warning ("Python %s", sys.version)
				logging.warning ("=== END HERE ===")
				continue

	finally:
		save(feeds)
		if smtpserver:
			smtpserver.quit()
github rss2email / rss2email / rss2email / error.py View on Github external
_LOG.warning(
                '=== rss2email encountered a problem with this feed ===')
            _LOG.warning(
                '=== See the rss2email FAQ at {} for assistance ==='.format(
                    __url__))
            _LOG.warning(
                '=== If this occurs repeatedly, send this to {} ==='.format(
                    __email__))
            _LOG.warning(
                'error: {} {}'.format(
                    self.parsed.get('bozo_exception', "can't process"),
                    self.feed.url))
            _LOG.warning(_pprint.pformat(self.parsed))
            _LOG.warning('rss2email {}'.format(__version__))
            _LOG.warning('feedparser {}'.format(_feedparser.__version__))
            _LOG.warning('html2text {}'.format(_html2text.__version__))
            _LOG.warning('Python {}'.format(_sys.version))
            _LOG.warning('=== END HERE ===')
github JimmXinu / FanFicFare / included_dependencies / html2text / cli.py View on Github external
def main():
    baseurl = ''

    class bcolors:  # pragma: no cover
        HEADER = '\033[95m'
        OKBLUE = '\033[94m'
        OKGREEN = '\033[92m'
        WARNING = '\033[93m'
        FAIL = '\033[91m'
        ENDC = '\033[0m'
        BOLD = '\033[1m'
        UNDERLINE = '\033[4m'

    p = optparse.OptionParser(
        '%prog [(filename|url) [encoding]]',
        version='%prog ' + ".".join(map(str, __version__))
    )
    p.add_option(
        "--default-image-alt",
        dest="default_image_alt",
        action="store",
        type="str",
        default=config.DEFAULT_IMAGE_ALT,
        help="The default alt string for images with missing ones")
    p.add_option(
        "--pad-tables",
        dest="pad_tables",
        action="store_true",
        default=config.PAD_TABLES,
        help="pad the cells to equal column width in tables"
    )
    p.add_option(
github rss2email / rss2email / rss2email.py View on Github external
LOG.warning(
                '=== rss2email encountered a problem with this feed ===')
            LOG.warning(
                '=== See the rss2email FAQ at {} for assistance ==='.format(
                    __url__))
            LOG.warning(
                '=== If this occurs repeatedly, send this to {} ==='.format(
                    __email__))
            LOG.warning(
                'error: {} {}'.format(
                    self.parsed.get('bozo_exception', "can't process"),
                    self.feed.url))
            LOG.warning(_pprint.pformat(self.parsed))
            LOG.warning('rss2email', __version__)
            LOG.warning('feedparser', _feedparser.__version__)
            LOG.warning('html2text', _html2text.__version__)
            LOG.warning('Python', _sys.version)
            LOG.warning('=== END HERE ===')
github ssricardo / anki-plugins / anki-markdown / src / html2text / cli.py View on Github external
def main():
    baseurl = ''

    class bcolors:  # pragma: no cover
        HEADER = '\033[95m'
        OKBLUE = '\033[94m'
        OKGREEN = '\033[92m'
        WARNING = '\033[93m'
        FAIL = '\033[91m'
        ENDC = '\033[0m'
        BOLD = '\033[1m'
        UNDERLINE = '\033[4m'

    p = optparse.OptionParser(
        '%prog [(filename|url) [encoding]]',
        version='%prog ' + ".".join(map(str, __version__))
    )
    p.add_option(
        "--default-image-alt",
        dest="default_image_alt",
        action="store",
        type="str",
        default=config.DEFAULT_IMAGE_ALT,
        help="The default alt string for images with missing ones")
    p.add_option(
        "--pad-tables",
        dest="pad_tables",
        action="store_true",
        default=config.PAD_TABLES,
        help="pad the cells to equal column width in tables"
    )
    p.add_option(
github JimmXinu / FanFicFare / webservice / main.py View on Github external
if self.request.get('bydate'):
            q.order('-date')
        else:
            q.order('-count')

        fics = q.fetch(200)
        logging.info("Recent fetched %d downloads for user %s."%(len(fics),user.nickname()))

        try:
            import bs4
            logging.debug( "BS4 version: %s"%bs4.__version__)
            import html5lib
            logging.debug( "html5lib version: %s"%html5lib.__version__)
            import html2text
            logging.debug( "html2text version:")
            logging.debug( html2text.__version__)
            import chardet
            logging.debug( "chardet version: %s"%chardet.__version__)
            import six
            logging.debug( "six version: %s"%six.__version__)
            import webencodings
            logging.debug( "webencodings version: %s"%webencodings.VERSION)
        except:
            pass

        sendslugs = []

        for fic in fics:
            ficslug = FicSlug(fic)
            sendslugs.append(ficslug)

        template_values = dict(fics = sendslugs, nickname = user.nickname())