From 6f7d08e0ec7b3c46ea6e9e6aae7fbc9327df29b4 Mon Sep 17 00:00:00 2001 From: Simon Law Date: Fri, 20 Jul 2012 15:54:02 -0400 Subject: settings.WKHTMLTOPDF_CMD is loaded on-the-fly, not at the module level. This allows overriding this configuration option at run-time. --- wkhtmltopdf/utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'wkhtmltopdf') diff --git a/wkhtmltopdf/utils.py b/wkhtmltopdf/utils.py index aab4152..ce32621 100644 --- a/wkhtmltopdf/utils.py +++ b/wkhtmltopdf/utils.py @@ -11,8 +11,6 @@ from django.utils.encoding import smart_str from .subprocess import check_output -WKHTMLTOPDF_CMD = getattr(settings, 'WKHTMLTOPDF_CMD', 'wkhtmltopdf') - def _options_to_args(**options): """Converts ``options`` into a string of command-line arguments.""" @@ -63,7 +61,8 @@ def wkhtmltopdf(pages, output=None, **kwargs): } options.update(kwargs) - args = list(chain([WKHTMLTOPDF_CMD], + cmd = getattr(settings, 'WKHTMLTOPDF_CMD', 'wkhtmltopdf') + args = list(chain([cmd], _options_to_args(**options), list(pages), [output])) -- cgit v1.2.3