Skip to content

Commit

Permalink
Move services below examples/
Browse files Browse the repository at this point in the history
  • Loading branch information
bebraw committed Feb 3, 2015
1 parent 15f5b75 commit fda4f2c
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions services.py → examples/services.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
# -*- coding: utf-8 -*-
"""
Example Services for using pypandoc
Django Services make use of the File object but that can be removed
and simply return the NamedTemporaryFile object
"""
from django.core.files import File
from tempfile import NamedTemporaryFile

import pypandoc
Expand Down Expand Up @@ -48,7 +45,7 @@ def generate(self, html, **kwargs):
# generate it using pandoc
self.service.convert(html, to_format, format=from_format, extra_args=extra_args)
# return the file which is now populated with the docx forms
return File(self.file_object)
return self.file_object


class PandocDocxService(BasePandocService):
Expand All @@ -69,4 +66,4 @@ def generate(self, html, **kwargs):
# generate it using pandoc
self.service.convert(html, to_format, format=from_format, extra_args=extra_args)
# return the file which is now populated with the docx forms
return File(self.file_object)
return self.file_object

0 comments on commit fda4f2c

Please sign in to comment.