aboutsummaryrefslogtreecommitdiffstats
path: root/examples/pygments_api/views.py
diff options
context:
space:
mode:
authorMarko Tibold2011-12-30 01:37:32 +0100
committerMarko Tibold2011-12-30 01:37:32 +0100
commit1b28339e5b733a0422c2bcd06b39e289bc98f69b (patch)
tree9e766f4f9d9ec596bc0e2702e1bb291b90aa3a93 /examples/pygments_api/views.py
parent91cee26ad89c04a70f33ae334150dd127f900474 (diff)
parenta0c4dca9462c738aac3c712607997b9bd1f7b2c8 (diff)
downloaddjango-rest-framework-1b28339e5b733a0422c2bcd06b39e289bc98f69b.tar.bz2
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'examples/pygments_api/views.py')
-rw-r--r--examples/pygments_api/views.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/pygments_api/views.py b/examples/pygments_api/views.py
index e50029f6..884cff3a 100644
--- a/examples/pygments_api/views.py
+++ b/examples/pygments_api/views.py
@@ -72,10 +72,10 @@ class PygmentsRoot(View):
linenos = 'table' if self.CONTENT['linenos'] else False
options = {'title': self.CONTENT['title']} if self.CONTENT['title'] else {}
formatter = HtmlFormatter(style=self.CONTENT['style'], linenos=linenos, full=True, **options)
-
+
with open(pathname, 'w') as outfile:
highlight(self.CONTENT['code'], lexer, formatter, outfile)
-
+
remove_oldest_files(HIGHLIGHTED_CODE_DIR, MAX_FILES)
return Response(status.HTTP_201_CREATED, headers={'Location': reverse('pygments-instance', args=[unique_id])})