<s> from weasyprint import HTML <EOL> from sellmo . contrib . reporting . generators import AbstractReportGenerator <EOL> import logging <EOL> logger = logging . getLogger ( '<STR_LIT>' ) <EOL> logger . handlers = [ ] <EOL> class WeasyPrintReportGenerator ( AbstractReportGenerator ) : <EOL> @ property <EOL> def input_formats ( self ) : <EOL> return [ '<STR_LIT:html>' ] <EOL> @ property <EOL> def output_formats ( self ) : <EOL> return [ '<STR_LIT>' ] <EOL> def get_data ( self , writer , frmt ) : <EOL> html = super ( WeasyPrintReportGenerator , self ) . get_data ( writer , frmt ) <EOL> return HTML ( string = html ) . write_pdf ( ) <EOL> def get_extension ( self , frmt ) : <EOL> return '<STR_LIT:.>' + frmt <EOL> def get_mimetype ( self , frmt ) : <EOL> if frmt == '<STR_LIT>' : <EOL> return '<STR_LIT>' </s>
