Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def config(**kwargs):
"""
Constructs and returns a :class:`Config` with given options
:param wkhtmltopdf: path to binary
:param meta_tag_prefix: the prefix for ``pdfkit`` specific meta tags
"""
return Config(**kwargs)
def __init__(self, url_or_file, source_type, options=None, toc=None, cover=None,
css=None, config=None, cover_first=None):
self.source = Source(url_or_file, source_type)
self.config = Config() if not config else config
try:
self.wkhtmltoimage = self.config.wkhtmltoimage.decode('utf-8')
except AttributeError:
self.wkhtmltoimage = self.config.wkhtmltoimage
self.xvfb = self.config.xvfb
self.options = {}
if self.source.isString():
self.options.update(self._find_options_in_meta(url_or_file))
if options:
self.options.update(options)
self.toc = toc if toc else {}
self.cover = cover