mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 10:14:46 -04:00
Edit Book: Add another mimetype for xpgt files
This commit is contained in:
parent
5a5b5fb6f2
commit
7c061e3f5f
@ -11,12 +11,15 @@ from PyQt4.Qt import QTextCharFormat
|
|||||||
from calibre.ebooks.oeb.base import OEB_DOCS, OEB_STYLES
|
from calibre.ebooks.oeb.base import OEB_DOCS, OEB_STYLES
|
||||||
from calibre.ebooks.oeb.polish.container import guess_type
|
from calibre.ebooks.oeb.polish.container import guess_type
|
||||||
|
|
||||||
|
_xml_types = {'application/oebps-page-map+xml', 'application/vnd.adobe-page-template+xml'} | {
|
||||||
|
guess_type('a.'+x) for x in ('ncx', 'opf', 'svg', 'xpgt', 'xml')}
|
||||||
|
|
||||||
def syntax_from_mime(name, mime):
|
def syntax_from_mime(name, mime):
|
||||||
if mime in OEB_DOCS:
|
if mime in OEB_DOCS:
|
||||||
return 'html'
|
return 'html'
|
||||||
if mime in OEB_STYLES:
|
if mime in OEB_STYLES:
|
||||||
return 'css'
|
return 'css'
|
||||||
if mime in {guess_type('a.svg'), guess_type('a.opf'), guess_type('a.ncx'), guess_type('a.xml'), 'application/oebps-page-map+xml', 'application/vnd.adobe-page-template+xml'}:
|
if mime in _xml_types:
|
||||||
return 'xml'
|
return 'xml'
|
||||||
if mime.startswith('text/'):
|
if mime.startswith('text/'):
|
||||||
return 'text'
|
return 'text'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user