mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
[SNBOutput] Removed a duplicated function.
This commit is contained in:
parent
081c5385f2
commit
9be246500b
@ -12,21 +12,7 @@ from calibre.ptempfile import TemporaryDirectory
|
|||||||
from calibre.constants import __appname__, __version__
|
from calibre.constants import __appname__, __version__
|
||||||
from calibre.ebooks.oeb.base import XHTML, XHTML_NS, barename, namespace
|
from calibre.ebooks.oeb.base import XHTML, XHTML_NS, barename, namespace
|
||||||
from calibre.ebooks.snb.snbfile import SNBFile
|
from calibre.ebooks.snb.snbfile import SNBFile
|
||||||
from calibre.ebooks.snb.snbml import SNBMLizer
|
from calibre.ebooks.snb.snbml import SNBMLizer, ProcessFileName
|
||||||
|
|
||||||
def ProcessFileName(fileName):
|
|
||||||
# Flat the path
|
|
||||||
fileName = fileName.replace("/", "_").replace(os.sep, "_")
|
|
||||||
# Handle bookmark for HTML file
|
|
||||||
fileName = fileName.replace("#", "_")
|
|
||||||
# Make it lower case
|
|
||||||
fileName = fileName.lower()
|
|
||||||
# Change extension for image files to png
|
|
||||||
root, ext = os.path.splitext(fileName)
|
|
||||||
if ext in [ '.jpeg', '.jpg', '.gif', '.svg' ]:
|
|
||||||
fileName = root + '.png'
|
|
||||||
return fileName
|
|
||||||
|
|
||||||
|
|
||||||
class SNBOutput(OutputFormatPlugin):
|
class SNBOutput(OutputFormatPlugin):
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user