aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Vilcans <martin@librador.com>2011-08-24 00:18:14 +0200
committerMartin Vilcans <martin@librador.com>2011-08-24 00:18:14 +0200
commitcd6a0be01d0f09faa55760769a9beee011599240 (patch)
tree94cdf1b3340be291af4686c1bd5e2fc8b82eb113
parentbeec72fbfa4c462463d354dbc75392a47de77f74 (diff)
downloadscreenplain-cd6a0be01d0f09faa55760769a9beee011599240.tar.gz
Serve annotated HTML from server so we can debug parsing
-rw-r--r--server/app.yaml6
-rw-r--r--server/index.html2
-rw-r--r--server/main.py7
3 files changed, 10 insertions, 5 deletions
diff --git a/server/app.yaml b/server/app.yaml
index 340a161..949c8b0 100644
--- a/server/app.yaml
+++ b/server/app.yaml
@@ -7,9 +7,13 @@ handlers:
- url: /styles
static_dir: styles
-- url: /text
+- url: /convert
script: main.py
- url: /
static_files: index.html
upload: index.html
+
+- url: /style.css
+ static_files: style.css
+ upload: style.css
diff --git a/server/index.html b/server/index.html
index 051b8c6..3273a1f 100644
--- a/server/index.html
+++ b/server/index.html
@@ -3,7 +3,7 @@
<html>
Hello world
-<form action="text" method="POST">
+<form action="convert" method="POST">
<textarea cols=80 rows=30 name="data">
EXT. SOMEWHERE - DAY
diff --git a/server/main.py b/server/main.py
index 6e87e18..f3f5e40 100644
--- a/server/main.py
+++ b/server/main.py
@@ -8,13 +8,14 @@ from bottle import route, template, request, response, error, debug
from google.appengine.ext.webapp.util import run_wsgi_app
from screenplain.export.text import to_text
+from screenplain.export.annotated_html import to_annotated_html
-@route('/text', method='POST')
+@route('/convert', method='POST')
def DisplayForm():
- response.content_type = 'text/plain; charset=utf-8'
+ response.content_type = 'text/html; charset=utf-8'
input = StringIO(request.forms.get('data'))
output = StringIO()
- to_text(input, output)
+ to_annotated_html(input, output)
return output.getvalue()
def main():