From 9fe6391baa20c87842dd8475b6d8732d0a34b24b Mon Sep 17 00:00:00 2001 From: Charlie Denton Date: Fri, 27 Jul 2012 09:34:22 +0100 Subject: Fix typo in docstring. --- wkhtmltopdf/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'wkhtmltopdf/utils.py') diff --git a/wkhtmltopdf/utils.py b/wkhtmltopdf/utils.py index 29e4ef6..69114b7 100644 --- a/wkhtmltopdf/utils.py +++ b/wkhtmltopdf/utils.py @@ -17,7 +17,7 @@ from .subprocess import check_output def _options_to_args(**options): - """Converts ``options`` into a string of command-line arguments.""" + """Converts ``options`` into a list of command-line arguments.""" flags = [] for name in sorted(options): value = options[name] -- cgit v1.2.3 From f172db7a2a7f404e6543f04fc8664800591848e4 Mon Sep 17 00:00:00 2001 From: Marc Tamlyn Date: Fri, 27 Jul 2012 11:37:19 +0100 Subject: Remove more deprecated stuff and tests for them. --- wkhtmltopdf/utils.py | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'wkhtmltopdf/utils.py') diff --git a/wkhtmltopdf/utils.py b/wkhtmltopdf/utils.py index 69114b7..f95eddf 100644 --- a/wkhtmltopdf/utils.py +++ b/wkhtmltopdf/utils.py @@ -7,7 +7,6 @@ import os import sys from tempfile import mkstemp import urllib -import warnings from django.conf import settings from django.template import loader @@ -87,18 +86,6 @@ def wkhtmltopdf(pages, output=None, **kwargs): return check_output(args, stderr=sys.stderr, env=env) -def template_to_temp_file(template_name, dictionary=None, context_instance=None): - """ - Renders a template to a temp file, and returns the path of the file. - """ - warnings.warn('template_to_temp_file is deprecated in favour of PDFResponse. It will be removed in version 1.', - PendingDeprecationWarning, 2) - file_descriptor, tempfile_path = mkstemp(suffix='.html') - with fdopen(file_descriptor, 'wt') as f: - f.write(smart_str(loader.render_to_string(template_name, dictionary=dictionary, context_instance=context_instance))) - return tempfile_path - - def content_disposition_filename(filename): """ Sanitize a file name to be used in the Content-Disposition HTTP -- cgit v1.2.3 From dde369a6963382fe452b4f82f3953ca8c7f00e63 Mon Sep 17 00:00:00 2001 From: Marc Tamlyn Date: Fri, 27 Jul 2012 12:39:03 +0100 Subject: Tidy up imports. --- wkhtmltopdf/utils.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'wkhtmltopdf/utils.py') diff --git a/wkhtmltopdf/utils.py b/wkhtmltopdf/utils.py index f95eddf..99998a2 100644 --- a/wkhtmltopdf/utils.py +++ b/wkhtmltopdf/utils.py @@ -1,16 +1,13 @@ from __future__ import absolute_import from copy import copy +from functools import wraps from itertools import chain -from os import fdopen import os import sys -from tempfile import mkstemp import urllib from django.conf import settings -from django.template import loader -from django.utils.encoding import smart_str from .subprocess import check_output -- cgit v1.2.3