Commit d5421ec7 authored by Tristan Cavelier's avatar Tristan Cavelier

wkhtmltopdf: disable cache by default

parent 4e6096c9
...@@ -30,7 +30,7 @@ from cloudooo.interfaces.handler import IHandler ...@@ -30,7 +30,7 @@ from cloudooo.interfaces.handler import IHandler
from cloudooo.file import File from cloudooo.file import File
from cloudooo.util import logger, parseContentType from cloudooo.util import logger, parseContentType
from subprocess import Popen, PIPE from subprocess import Popen, PIPE
from tempfile import mktemp from tempfile import mktemp, mkdtemp
from os.path import basename from os.path import basename
from base64 import b64decode from base64 import b64decode
...@@ -57,6 +57,9 @@ class Handler(object): ...@@ -57,6 +57,9 @@ class Handler(object):
) )
return path return path
def makeTempDir(self, *args, **kw):
return mkdtemp(*args, dir=self.file.directory_name, **kw)
def convertPathToUrl(self, path): def convertPathToUrl(self, path):
if path.startswith("/"): if path.startswith("/"):
return "file://" + path return "file://" + path
...@@ -362,6 +365,8 @@ class Handler(object): ...@@ -362,6 +365,8 @@ class Handler(object):
"include_in_outline", "include_in_outline",
], conversion_kw) ], conversion_kw)
command += self.makeSwitchOptionList(["default_header"], 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([ command += self.makeOneStringArgumentOptionList([
#"cache_dir", # we decide #"cache_dir", # we decide
"encoding", "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