--- a/qmsk/dmx/web.py Sat Jun 07 16:22:56 2014 +0300
+++ b/qmsk/dmx/web.py Sat Jun 07 16:23:16 2014 +0300
@@ -1,5 +1,7 @@
-import pvl.web
-from pvl.web import urls, html
+from qmsk.web import urls
+from qmsk.web.application import Application
+from qmsk.web.html import HTMLHandler
+from qmsk.web.html import html5 as html
import collections
import logging; log = logging.getLogger('qmsk.dmx.web')
@@ -37,11 +39,8 @@
def head_color (head, value) :
return html.div(class_='dmx-color-background')(colorize(html.div(id='-'.join([head, 'color']), class_='dmx-color')(' '), **value))
-class Handler (pvl.web.Handler) :
+class Handler (HTMLHandler) :
# Bootstrap
- DOCTYPE = 'html'
- HTML_XMLNS = None
- HTML_LANG = 'en'
CSS = (
'//code.jquery.com/ui/1.10.4/themes/ui-darkness/jquery-ui.css',
'//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css',
@@ -64,7 +63,7 @@
if self.request.method == 'POST' :
update = collections.defaultdict(dict)
- for name, value in self.request.form.iteritems() :
+ for name, value in self.request.form.items() :
head_name, attr = name.split('-', 1)
head = self.app.universe[head_name]
@@ -125,10 +124,10 @@
)
)
-class DMXWebApplication (pvl.web.Application) :
- URLS = urls.Map((
- urls.rule('/', Handler),
- ))
+class DMXWebApplication (Application) :
+ URLS = urls.rules({
+ '/': Handler,
+ })
def __init__ (self, universe, **opts) :
"""
@@ -144,6 +143,6 @@
Update given {head: {attr: value}}
"""
- for head, attrs in update.iteritems():
+ for head, attrs in update.items():
self.universe.update(head, attrs)