Files
Anthias/html_templates.py
Christian Nilsson ac743b643c Use asset_id in filename when saving html page for image instead of asset name.
Also removing unused code in html_templates.
2013-01-18 19:35:11 +01:00

20 lines
682 B
Python

# -*- coding: utf8 -*-
def black_page():
filepath = "/tmp/screenly_html/black_page.html"
html = "<html><head><style>body {background-color:#000000;}</style></head><!-- Just a black page --></html>"
f = open(filepath, 'w')
f.write(html)
f.close()
return filepath
def image_page(image, asset_id):
full_filename = '/tmp/screenly_html/' + asset_id + '.html'
html = "<html><head><style>body {background-image:url('%s'); background-repeat:no-repeat; background-position:center; background-color:#000000;}</style></head><!-- Just a black page --></html>" % image
f = open(full_filename, 'w')
f.write(html)
f.close()
return full_filename