mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
IGN:Updated translations
This commit is contained in:
parent
c331252d14
commit
9e1b9179d8
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -40,6 +40,12 @@ podofo_PDFDoc_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
|
|||||||
return (PyObject *)self;
|
return (PyObject *)self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void podofo_set_exception(const PdfError &err) {
|
||||||
|
const char *msg = PdfError::ErrorMessage(err.GetError());
|
||||||
|
if (msg == NULL) msg = err.what();
|
||||||
|
PyErr_SetString(PyExc_ValueError, msg);
|
||||||
|
}
|
||||||
|
|
||||||
static PyObject *
|
static PyObject *
|
||||||
podofo_PDFDoc_load(podofo_PDFDoc *self, PyObject *args, PyObject *kwargs) {
|
podofo_PDFDoc_load(podofo_PDFDoc *self, PyObject *args, PyObject *kwargs) {
|
||||||
char *buffer; Py_ssize_t size;
|
char *buffer; Py_ssize_t size;
|
||||||
@ -48,9 +54,7 @@ podofo_PDFDoc_load(podofo_PDFDoc *self, PyObject *args, PyObject *kwargs) {
|
|||||||
try {
|
try {
|
||||||
self->doc->Load(buffer, size);
|
self->doc->Load(buffer, size);
|
||||||
} catch(const PdfError & err) {
|
} catch(const PdfError & err) {
|
||||||
const char *msg = PdfError::ErrorMessage(err.GetError());
|
podofo_set_exception(err);
|
||||||
if (msg == NULL) msg = err.what();
|
|
||||||
PyErr_SetString(PyExc_ValueError, msg);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
} else return NULL;
|
} else return NULL;
|
||||||
@ -68,7 +72,7 @@ podofo_PDFDoc_save(podofo_PDFDoc *self, PyObject *args, PyObject *kwargs) {
|
|||||||
try {
|
try {
|
||||||
self->doc->Write(buffer);
|
self->doc->Write(buffer);
|
||||||
} catch(const PdfError & err) {
|
} catch(const PdfError & err) {
|
||||||
PyErr_SetString(PyExc_ValueError, PdfError::ErrorMessage(err.GetError()));
|
podofo_set_exception(err);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
} else return NULL;
|
} else return NULL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user