# HG changeset patch # User Tero Marttila # Date 1422562499 -7200 # Node ID 611787305686fe34098119980b6c2cfdfa13d926 # Parent 18c4612376305e77617d319f8061847abb26630f qmsk.web.html: HTMLMixin diff -r 18c461237630 -r 611787305686 qmsk/web/html.py --- a/qmsk/web/html.py Tue Dec 02 00:23:48 2014 +0200 +++ b/qmsk/web/html.py Thu Jan 29 22:14:59 2015 +0200 @@ -1,7 +1,7 @@ from qmsk.utils import flatten, merge from html import escape -import qmsk.web +import qmsk.web.application class Tag : def __init__ (self, _name=None, *_contents, @@ -105,7 +105,7 @@ html5 = HTML5() -class HTMLHandler (qmsk.web.Handler): +class HTMLMixin: """ A handler that renders a full HTML page. """ @@ -142,9 +142,13 @@ html = self.html + title = self.title() + + assert title + return html.html( html.head( - html.title(self.title()), + html.title(title), ( html.link(rel='Stylesheet', type="text/css", href=src) for src in self.CSS ), @@ -186,3 +190,7 @@ )) ), )) + +class HTMLHandler (HTMLMixin, qmsk.web.application.Handler): + pass +