Commit dc75a261 authored by Tristan Cavelier's avatar Tristan Cavelier

wkhtmltopdf: disable cache by default

parent 42160d8e
......@@ -30,7 +30,7 @@ from cloudooo.interfaces.handler import IHandler
from cloudooo.file import File
from cloudooo.util import logger, parseContentType
from subprocess import Popen, PIPE
from tempfile import mktemp
from tempfile import mktemp, mkdtemp
from os.path import basename
from base64 import b64decode
......@@ -55,6 +55,9 @@ class Handler(object):
)
return path
def makeTempDir(self, *args, **kw):
return mkdtemp(*args, dir=self.file.directory_name, **kw)
def convertPathToUrl(self, path):
if path.startswith("/"):
return "file://" + path
......@@ -356,6 +359,8 @@ class Handler(object):
"include_in_outline",
], conversion_kw)
command += self.makeSwitchOptionList(["default_header"], conversion_kw)
# put cache in the temp dir - to disable cache
command += ["--cache-dir", self.makeTempDir(prefix="cache")]
command += self.makeOneStringArgumentOptionList([
#"cache_dir", # we decide
"encoding",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment