Пример #1
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))
Пример #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
    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
    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