aboutsummaryrefslogtreecommitdiffstats
path: root/wkhtmltopdf/utils.py
diff options
context:
space:
mode:
authorSimon Law <simon.law@ecometrica.com>2012-07-20 15:58:55 -0400
committerSimon Law <simon.law@ecometrica.com>2012-07-20 15:58:55 -0400
commit803aba8859109e2c17e4bdf53126c058a2b60918 (patch)
treeb18aaa217f70cf23aa0bf3615860a282afed8249 /wkhtmltopdf/utils.py
parent6f7d08e0ec7b3c46ea6e9e6aae7fbc9327df29b4 (diff)
downloaddjango-wkhtmltopdf-803aba8859109e2c17e4bdf53126c058a2b60918.tar.gz
django-wkhtmltopdf-803aba8859109e2c17e4bdf53126c058a2b60918.tar.bz2
django-wkhtmltopdf-803aba8859109e2c17e4bdf53126c058a2b60918.zip
settings.WKHTMLTOPDF_CMD_OPTIONS sets default command-line options.
Diffstat (limited to 'wkhtmltopdf/utils.py')
-rw-r--r--wkhtmltopdf/utils.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/wkhtmltopdf/utils.py b/wkhtmltopdf/utils.py
index ce32621..7fe432a 100644
--- a/wkhtmltopdf/utils.py
+++ b/wkhtmltopdf/utils.py
@@ -1,5 +1,6 @@
from __future__ import absolute_import
+from copy import copy
from itertools import chain
from os import fdopen
import sys
@@ -56,9 +57,11 @@ def wkhtmltopdf(pages, output=None, **kwargs):
output = '-'
# Default options:
- options = {
- 'quiet': True,
- }
+ options = getattr(settings, 'WKHTMLTOPDF_CMD_OPTIONS', None)
+ if options is None:
+ options = {'quiet': True}
+ else:
+ options = copy(options)
options.update(kwargs)
cmd = getattr(settings, 'WKHTMLTOPDF_CMD', 'wkhtmltopdf')