aboutsummaryrefslogtreecommitdiffstats
path: root/examples/pygments_api/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/pygments_api/views.py')
-rw-r--r--examples/pygments_api/views.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/pygments_api/views.py b/examples/pygments_api/views.py
index ffea60ae..44dd2caa 100644
--- a/examples/pygments_api/views.py
+++ b/examples/pygments_api/views.py
@@ -61,7 +61,7 @@ class PygmentsRoot(View):
Return a list of all currently existing snippets.
"""
unique_ids = [os.path.split(f)[1] for f in list_dir_sorted_by_ctime(HIGHLIGHTED_CODE_DIR)]
- return [reverse('pygments-instance', args=[unique_id]) for unique_id in unique_ids]
+ return Response([reverse('pygments-instance', args=[unique_id]) for unique_id in unique_ids])
def post(self, request):
"""
@@ -98,7 +98,7 @@ class PygmentsInstance(View):
pathname = os.path.join(HIGHLIGHTED_CODE_DIR, unique_id)
if not os.path.exists(pathname):
return Response(status.HTTP_404_NOT_FOUND)
- return open(pathname, 'r').read()
+ return Response(open(pathname, 'r').read())
def delete(self, request, unique_id):
"""
@@ -107,5 +107,5 @@ class PygmentsInstance(View):
pathname = os.path.join(HIGHLIGHTED_CODE_DIR, unique_id)
if not os.path.exists(pathname):
return Response(status.HTTP_404_NOT_FOUND)
- return os.remove(pathname)
+ return Response(os.remove(pathname))