From 2e9fd9c6b93a77dcf5caa42a4d71b9da2021693f Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Fri, 28 Jan 2011 09:14:04 +0000 Subject: Minor fixups on pygments example --- examples/pygments_api/views.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples/pygments_api/views.py') diff --git a/examples/pygments_api/views.py b/examples/pygments_api/views.py index 01f1b4b6..02f541f3 100644 --- a/examples/pygments_api/views.py +++ b/examples/pygments_api/views.py @@ -38,15 +38,15 @@ class PygmentsRoot(Resource): if not os.path.exists(pathname): # We only need to generate the file if it doesn't already exist. - title = content['title'] if content['title'] else None + options = {'title': content['title']} if content['title'] else {} linenos = 'table' if content['linenos'] else False lexer = get_lexer_by_name(content['lexer']) - formatter = HtmlFormatter(style=content['style'], linenos=linenos, full=True, title=title) + formatter = HtmlFormatter(style=content['style'], linenos=linenos, full=True, **options) with open(pathname, 'w') as outfile: highlight(content['code'], lexer, formatter, outfile) - return Response(status.HTTP_303_SEE_OTHER, headers={'Location': self.reverse(PygmentsInstance, unique_id)}) + return Response(status.HTTP_201_CREATED, headers={'Location': self.reverse(PygmentsInstance, unique_id)}) class PygmentsInstance(Resource): -- cgit v1.2.3