mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
PoDoFo cleanups
This commit is contained in:
parent
536bd9a31b
commit
5a1731a38f
@ -40,6 +40,7 @@ class LinuxFreeze(Command):
|
||||
'/usr/bin/pdftohtml',
|
||||
'/usr/lib/libwmflite-0.2.so.7',
|
||||
'/usr/lib/liblcms.so.1',
|
||||
'/usr/lib/libstlport.so.5.1',
|
||||
'/tmp/calibre-mount-helper',
|
||||
'/usr/lib/libunrar.so',
|
||||
'/usr/lib/libchm.so.0',
|
||||
|
@ -14,6 +14,7 @@ from calibre.ebooks.metadata import MetaInformation, string_to_authors, \
|
||||
from calibre.utils.ipc.job import ParallelJob
|
||||
from calibre.utils.ipc.server import Server
|
||||
from calibre.ptempfile import PersistentTemporaryFile
|
||||
from calibre import prints
|
||||
|
||||
podofo, podofo_err = plugins['podofo']
|
||||
|
||||
@ -117,12 +118,18 @@ def set_metadata(stream, mi):
|
||||
|
||||
job.update()
|
||||
server.close()
|
||||
if job.result is not None:
|
||||
if job.failed:
|
||||
prints(job.details)
|
||||
elif job.result is not None:
|
||||
stream.seek(0)
|
||||
stream.truncate()
|
||||
stream.write(job.result)
|
||||
stream.flush()
|
||||
stream.seek(0)
|
||||
try:
|
||||
os.remove(pt.name)
|
||||
except:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
|
@ -55,8 +55,7 @@ podofo_PDFDoc_load(podofo_PDFDoc *self, PyObject *args, PyObject *kwargs) {
|
||||
} else return NULL;
|
||||
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
@ -73,8 +72,7 @@ podofo_PDFDoc_open(podofo_PDFDoc *self, PyObject *args, PyObject *kwargs) {
|
||||
} else return NULL;
|
||||
|
||||
|
||||
Py_INCREF(Py_None);
|
||||
return Py_None;
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
|
Loading…
x
Reference in New Issue
Block a user