From f1ab81f247682ba24e066275c9a048fb0b8e2a05 Mon Sep 17 00:00:00 2001 From: Matt Webb Date: Sat, 27 Sep 2014 10:10:58 +0100 Subject: [PATCH] ability to type HTML on the front-end --- app/main/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/main/__init__.py b/app/main/__init__.py index 63943a7..a446a3d 100644 --- a/app/main/__init__.py +++ b/app/main/__init__.py @@ -11,6 +11,7 @@ import pprint main = Blueprint('main', __name__) class SendDeliveryForm(Form): + html = TextAreaField(u'HTML to render') submit = SubmitField('Send Delivery') @main.route('/') @@ -26,10 +27,10 @@ def device(device_address): sender = current_app.sender if form.validate_on_submit(): - html = """

Hello, World!

My name is Little Printer

""" + #html = """

Hello, World!

My name is Little Printer

""" flash('Form submitted') q = sender.for_device(device) if q is not None: - dc = set_delivery_and_print(device.device_address, html=html) + dc = set_delivery_and_print(device.device_address, html=form.html.data) q.queue_device_command(dc) return render_template('dump.html', dump=pprint.pformat(device), form=form) -- 2.47.3