コード例 #1
0
ファイル: epub_gen.py プロジェクト: MarcinOS/librepy
 def _generate_ops_dir(self):
     output_path = os.path.join(self.destination_dir, settings.OPS_DIR)
     create_dir_if_needed(output_path)
     
     #generate content.opf file
     self.publication.template = settings.CONTENT_OPF_TEMPLATE
     self.publication.serialize(os.path.join(output_path, settings.CONTENT_OPF_FILE_NAME))
コード例 #2
0
    def _generate_ops_dir(self):
        output_path = os.path.join(self.destination_dir, settings.OPS_DIR)
        create_dir_if_needed(output_path)

        #generate content.opf file
        self.publication.template = settings.CONTENT_OPF_TEMPLATE
        self.publication.serialize(
            os.path.join(output_path, settings.CONTENT_OPF_FILE_NAME))
コード例 #3
0
ファイル: epub_gen.py プロジェクト: MarcinOS/librepy
    def _generate_meta_inf_dir(self):
        output_path = os.path.join(self.destination_dir, settings.META_INF_DIR)
        create_dir_if_needed(output_path)

        #generate container file
        generate_file_from_template(path=os.path.join(output_path, settings.CONTAINER_FILE_NAME),
                                    template_name=settings.CONTAINER_XML_TEMPLATE,
                                    context=dict(content_ops_path=os.path.join(settings.OPS_DIR,
                                                                               settings.CONTENT_OPF_FILE_NAME)))
コード例 #4
0
    def _generate_meta_inf_dir(self):
        output_path = os.path.join(self.destination_dir, settings.META_INF_DIR)
        create_dir_if_needed(output_path)

        #generate container file
        generate_file_from_template(
            path=os.path.join(output_path, settings.CONTAINER_FILE_NAME),
            template_name=settings.CONTAINER_XML_TEMPLATE,
            context=dict(content_ops_path=os.path.join(
                settings.OPS_DIR, settings.CONTENT_OPF_FILE_NAME)))
コード例 #5
0
    def __init__(self, destination_dir, publication):
        self.destination_dir = os.path.join(settings.OUTPUT_DIR,
                                            destination_dir)
        create_dir_if_needed(self.destination_dir)

        self.publication = publication
コード例 #6
0
ファイル: epub_gen.py プロジェクト: MarcinOS/librepy
    def __init__(self, destination_dir, publication):
        self.destination_dir = os.path.join(settings.OUTPUT_DIR, destination_dir)
        create_dir_if_needed(self.destination_dir)

        self.publication = publication