From 2ec1f7c7ff600be6d6391414a0feb5d5ec9aaa34 Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Fri, 14 May 2021 17:40:07 -0700 Subject: [PATCH] Move template to global to get rid of indentation. --- heresmyclipboard.py | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/heresmyclipboard.py b/heresmyclipboard.py index a184f9a..0eeb084 100644 --- a/heresmyclipboard.py +++ b/heresmyclipboard.py @@ -10,19 +10,20 @@ log = vlogging.getLogger(__name__, 'heresmyclipboard') site = flask.Flask(__name__) +TEMPLATE = ''' + + +
+{{clip}}
+
+ + +''' + @site.route('/') def root(): clip = pyperclip.paste() - template = ''' - - -
-    {{clip}}
-    
- - - ''' - return flask.render_template_string(template, clip=clip) + return flask.render_template_string(TEMPLATE, clip=clip) def heresmyclipboard_argparse(args): log.info(f'Starting server on port {args.port}, pid={os.getpid()}')