mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-08-07 09:01:38 -04:00
Make the name of the html syntax highlighter module more explicit
Avoids name collisions with the stdlib html module in python3
This commit is contained in:
parent
9b777491ce
commit
281ddb8678
@ -52,7 +52,7 @@
|
||||
"lib_dirs": "!openssl_lib_dirs"
|
||||
},
|
||||
{
|
||||
"name": "html",
|
||||
"name": "html_syntax_highlighter",
|
||||
"sources": "calibre/gui2/tweak_book/editor/syntax/html.c"
|
||||
},
|
||||
{
|
||||
|
@ -174,7 +174,7 @@ class Plugins(collections.Mapping):
|
||||
'speedup',
|
||||
'html_as_json',
|
||||
'unicode_names',
|
||||
'html',
|
||||
'html_syntax_highlighter',
|
||||
'hyphen',
|
||||
'freetype',
|
||||
'imageops',
|
||||
|
@ -486,7 +486,7 @@ static PyMethodDef html_methods[] = {
|
||||
#define INITERROR return NULL
|
||||
static struct PyModuleDef html_module = {
|
||||
/* m_base */ PyModuleDef_HEAD_INIT,
|
||||
/* m_name */ "html",
|
||||
/* m_name */ "html_syntax_highlighter",
|
||||
/* m_doc */ "Speedups for the html syntax highlighter",
|
||||
/* m_size */ -1,
|
||||
/* m_methods */ html_methods,
|
||||
@ -496,12 +496,12 @@ static struct PyModuleDef html_module = {
|
||||
/* m_free */ 0,
|
||||
};
|
||||
|
||||
CALIBRE_MODINIT_FUNC PyInit_html(void) {
|
||||
CALIBRE_MODINIT_FUNC PyInit_html_syntax_highlighter(void) {
|
||||
PyObject *temp, *mod = PyModule_Create(&html_module);
|
||||
#else
|
||||
#define INITERROR return
|
||||
CALIBRE_MODINIT_FUNC inithtml(void) {
|
||||
PyObject *temp, *mod = Py_InitModule3("html", html_methods,
|
||||
CALIBRE_MODINIT_FUNC inithtml_syntax_highlighter(void) {
|
||||
PyObject *temp, *mod = Py_InitModule3("html_syntax_highlighter", html_methods,
|
||||
"Speedups for the html syntax highlighter");
|
||||
#endif
|
||||
|
||||
@ -544,4 +544,4 @@ CALIBRE_MODINIT_FUNC inithtml(void) {
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
return mod;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
@ -64,7 +64,7 @@ def refresh_spell_check_status():
|
||||
|
||||
from calibre.constants import plugins
|
||||
|
||||
_speedup = plugins['html'][0]
|
||||
_speedup = plugins['html_syntax_highlighter'][0]
|
||||
if _speedup is not None:
|
||||
Tag = _speedup.Tag
|
||||
bold_tags, italic_tags = _speedup.bold_tags, _speedup.italic_tags
|
||||
|
Loading…
x
Reference in New Issue
Block a user