mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-06 03:13:43 +02:00
Avoid unnecessary QUrl round-tripping
This commit is contained in:
parent
4637e39350
commit
877810c134
1 changed files with 2 additions and 6 deletions
|
|
@ -9,7 +9,7 @@
|
|||
import os
|
||||
from urlparse import urldefrag
|
||||
from lxml import etree
|
||||
from PyQt4.QtCore import Qt, QUrl
|
||||
from PyQt4.QtCore import Qt
|
||||
from PyQt4.QtCore import QByteArray
|
||||
from PyQt4.QtCore import QBuffer
|
||||
from PyQt4.QtCore import QIODevice
|
||||
|
|
@ -17,7 +17,6 @@
|
|||
from PyQt4.QtGui import QImage
|
||||
from PyQt4.QtGui import QPainter
|
||||
from PyQt4.QtSvg import QSvgRenderer
|
||||
from calibre.constants import iswindows
|
||||
from calibre.ebooks.oeb.base import XHTML, XLINK
|
||||
from calibre.ebooks.oeb.base import SVG_MIME, PNG_MIME
|
||||
from calibre.ebooks.oeb.base import xml2str, xpath
|
||||
|
|
@ -125,10 +124,7 @@ def dataize_svg(self, item, svg=None):
|
|||
with PersistentTemporaryFile(suffix='.'+ext) as pt:
|
||||
pt.write(data)
|
||||
self.temp_files.append(pt.name)
|
||||
href = unicode(QUrl.fromLocalFile(pt.name).toString())[len('file://'):]
|
||||
if iswindows:
|
||||
href = href[1:]
|
||||
elem.attrib[XLINK('href')] = href
|
||||
elem.attrib[XLINK('href')] = pt.name
|
||||
return svg
|
||||
|
||||
def stylizer(self, item):
|
||||
|
|
|
|||
Loading…
Reference in a new issue