Commit 8cedea3b authored by Etienne Nadji's avatar Etienne Nadji

modifié : plugin/vepub_css.py

	modifié :         plugin/vim_epub.py
parent 6d5cf3b1
......@@ -10,6 +10,8 @@ from __future__ import unicode_literals
import os
from vim_epub import to_unicode_or_bust,desunicode
def make_fontdef_summary(font_name,sources,output_file):
if sources:
output_file = "{0}{1}{2}".format(
......@@ -28,7 +30,7 @@ def make_fontdef_summary(font_name,sources,output_file):
tirets = len(font_name) * "-"
out.write("\t+{0}-------------------------+\n".format(tirets))
out.write("\t| Définitions of " + font_name + " font |\n")
out.write("\t| Définitions of " + desunicode(font_name) + " font |\n")
out.write("\t+{0}-------------------------+\n\n".format(tirets))
fonts = []
......
......@@ -635,23 +635,23 @@ class EPUB:
for line in opf:
line = line.rstrip()
if _desunicode("item") in line:
if desunicode("item") in line:
tab_item = line.split("<".encode("utf8"))[0]
if _desunicode('</manifest>') in line:
if desunicode('</manifest>') in line:
if filetype["manifest"]:
new_opf += "\n{0}{1}".format(tab_item,manifest)
new_opf += "\n</manifest>"
else:
new_opf += "\n</manifest>"
elif _desunicode('</spine>') in line:
elif desunicode('</spine>') in line:
if filetype["spine"]:
new_opf += "\n{0}{1}".format(tab_item,spine)
new_opf += "\n</spine>"
else:
new_opf += "\n</spine>"
else:
if line.startswith(_desunicode("<?xml")):
if line.startswith(desunicode("<?xml")):
new_opf += "{0}".format(line)
else:
new_opf = new_opf + "\n" + to_unicode_or_bust(line)
......@@ -1264,7 +1264,7 @@ def to_unicode_or_bust(obj, encoding='utf-8'):
obj = unicode(obj, encoding)
return obj
def _desunicode(s): return s.encode("utf8")
def desunicode(s): return s.encode("utf8")
def merge_html(file_1,file_2,output_file):
"""Merge file_1 and file_2 into output_file"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment