def generate_css(self, output_file):
        """
        Generate an external style sheet file.

        output_file must be a file handler that takes in bytes!
        """
        if self.CSS_TEMPLATE_NAME is not None:
            template = TEMPLATE_ENV.get_template(self.CSS_TEMPLATE_NAME)
            style = template.render(self._context())

        if isinstance(style, six.string_types):
            style = style.encode('utf-8')

        output_file.write(style)
def generate_css ( self , output_file ) : if self . CSS_TEMPLATE_NAME is not None : template = TEMPLATE_ENV . get_template ( self . CSS_TEMPLATE_NAME ) style = template . render ( self . _context ( ) ) if isinstance ( style , six . string_types ) : style = style . encode ( 'utf-8' ) output_file . write ( style )
Generate an external style sheet file.

        output_file must be a file handler that takes in bytes!