コード例 #1
0
ファイル: converter.py プロジェクト: danielhjames/Booktype
    def _create_endmatter(self, book):
        """Creates end matter file.

        End matter HTML file will be used by booktype2mpdf.php script to create
        PDF file.

        :Args:
          - book: EPUB Book object
        """

        data = self._get_data(book)
        data.update(self.get_extra_data(book))

        endmatter_name = get_single_endmatter(self.theme_name, self.name)
        html = render_to_string(endmatter_name, data)

        f = codecs.open('{}/endmatter.html'.format(self.sandbox_path), 'wt', 'utf8')
        f.write(html)
        f.close()
コード例 #2
0
    def _create_endmatter(self, book):
        """Creates end matter file.

        End matter HTML file will be used by booktype2mpdf.php script to create
        PDF file.

        :Args:
          - book: EPUB Book object
        """

        data = self._get_data(book)
        data.update(self.get_extra_data(book))

        endmatter_name = get_single_endmatter(self.theme_name, self.name)
        html = render_to_string(endmatter_name, data)

        f = codecs.open('{}/endmatter.html'.format(self.sandbox_path), 'wt',
                        'utf8')
        f.write(html)
        f.close()