X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/0917e94c7b5403408a167ac17f8c6474f9563fe8..22aac0da99594406b261f14c135812c855c196ef:/apps/api/views.py?ds=inline
diff --git a/apps/api/views.py b/apps/api/views.py
deleted file mode 100644
index a8118028..00000000
--- a/apps/api/views.py
+++ /dev/null
@@ -1,40 +0,0 @@
-# Create your views here.
-
-import logging
-log = logging.getLogger('platforma.render')
-
-from django.http import HttpResponse
-import librarian
-from librarian import html
-from lxml import etree
-from StringIO import StringIO
-import re
-
-LINE_SWAP_EXPR = re.compile(r'/\s', re.MULTILINE | re.UNICODE);
-
-def render(request):
- style_filename = html.get_stylesheet('partial')
-
- data = request.POST['fragment']
- path = request.POST['chunk']
-
- base, me = path.rsplit('/', 1)
- match = re.match(r'([^\[]+)\[(\d+)\]', me)
- tag, pos = match.groups()
-
- style = etree.parse(style_filename)
-
- data = u'%s' % LINE_SWAP_EXPR.sub(u'
\n', data)
- log.info(data)
- doc = etree.parse( StringIO(data) )
-
- opts = {
- 'with-paths': 'boolean(1)',
- 'base-path': "'%s'" % base,
- 'base-offset': pos,
- }
-
- result = doc.xslt(style, **opts)
- log.info( str(doc), str(result) )
-
- return HttpResponse( librarian.serialize_children(result.getroot()) )
\ No newline at end of file