From a4483af5b4c699142eff5658f7a3df073d219e59 Mon Sep 17 00:00:00 2001 From: Ken Roberts Date: Sat, 4 Jun 2016 01:03:25 -0700 Subject: [PATCH] Revert htmlbuilder for now --- openlp/core/lib/htmlbuilder.py | 152 ++++++++++++++++----------------- 1 file changed, 76 insertions(+), 76 deletions(-) diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index ffe9f05cc..f0d8ddef2 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -396,74 +396,74 @@ from openlp.core.lib.theme import BackgroundType, BackgroundGradientType, Vertic log = logging.getLogger(__name__) -# TODO: Tested at home +# TODO: Verify where this is used before converting to python3 HTMLSRC = """ OpenLP Display - - -{html_additions} + + +%s
@@ -582,17 +582,17 @@ def build_html(item, screen, is_live, background, image=None, plugins=None): css_additions += plugin.get_display_css() js_additions += plugin.get_display_javascript() html_additions += plugin.get_display_html() - html = HTMLSRC.format(background_css=build_background_css(item, width), - additions=css_additions, - footer_css=build_footer_css(item, height), - lyrics_css=build_lyrics_css(item), - transitions='true' if (theme_data and - theme_data.display_slide_transition and - is_live) else 'false', - js_additions=js_additions, - bgimage=bgimage_src, - image=image_src, - html_additions=html_additions) + html = HTMLSRC % ( + build_background_css(item, width), + css_additions, + build_footer_css(item, height), + build_lyrics_css(item), + 'true' if theme_data and theme_data.display_slide_transition and is_live else 'false', + js_additions, + bgimage_src, + image_src, + html_additions + ) return html @@ -650,23 +650,23 @@ def build_lyrics_css(item): :param item: Service Item containing theme and location information """ - # TODO: Tested at home + # TODO: Verify this before converting to python3 style = """ -.lyricstable {{ +.lyricstable { z-index: 5; position: absolute; display: table; - {stable} -}} -.lyricscell {{ + %s +} +.lyricscell { display: table-cell; word-wrap: break-word; -webkit-transition: opacity 0.4s ease; - {lyrics} -}} -.lyricsmain {{ - {main} -}} + %s +} +.lyricsmain { + %s +} """ theme_data = item.theme_data lyricstable = '' @@ -680,7 +680,7 @@ def build_lyrics_css(item): lyricsmain += ' text-shadow: {theme} {shadow}px ' \ '{shadow}px;'.format(theme=theme_data.font_main_shadow_color, shadow=theme_data.font_main_shadow_size) - lyrics_css = style.format(stable=lyricstable, lyrics=lyrics, main=lyricsmain) + lyrics_css = style % (lyricstable, lyrics, lyricsmain) return lyrics_css