mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Implement clean for mathjax builder
This commit is contained in:
parent
98a2f53d90
commit
d08e0a33e1
@ -9,9 +9,9 @@ __docformat__ = 'restructuredtext en'
|
|||||||
|
|
||||||
import os, shutil, json
|
import os, shutil, json
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
from zipfile import ZipFile, ZIP_STORED, ZipInfo
|
from zipfile import ZipFile
|
||||||
from hashlib import sha1
|
from hashlib import sha1
|
||||||
from tempfile import mkdtemp, SpooledTemporaryFile
|
from tempfile import mkdtemp
|
||||||
|
|
||||||
|
|
||||||
from setup import Command, download_securely
|
from setup import Command, download_securely
|
||||||
@ -54,12 +54,15 @@ class MathJax(Command):
|
|||||||
name = prefix + '/' + os.path.relpath(f, base).replace(os.sep, '/')
|
name = prefix + '/' + os.path.relpath(f, base).replace(os.sep, '/')
|
||||||
self.add_file(f, name)
|
self.add_file(f, name)
|
||||||
|
|
||||||
def run(self, opts):
|
def clean(self):
|
||||||
self.h = sha1()
|
|
||||||
self.mathjax_dir = self.j(self.RESOURCES, 'mathjax')
|
self.mathjax_dir = self.j(self.RESOURCES, 'mathjax')
|
||||||
self.mathjax_files = {}
|
|
||||||
if os.path.exists(self.mathjax_dir):
|
if os.path.exists(self.mathjax_dir):
|
||||||
shutil.rmtree(self.mathjax_dir)
|
shutil.rmtree(self.mathjax_dir)
|
||||||
|
|
||||||
|
def run(self, opts):
|
||||||
|
self.h = sha1()
|
||||||
|
self.mathjax_files = {}
|
||||||
|
self.clean()
|
||||||
os.mkdir(self.mathjax_dir)
|
os.mkdir(self.mathjax_dir)
|
||||||
tdir = mkdtemp('calibre-mathjax-build')
|
tdir = mkdtemp('calibre-mathjax-build')
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user