Changeset - 1cb63991eb19
[Not reviewed]
default
0 2 0
Drew Perttula - 6 years ago 2019-06-02 06:43:07
drewp@bigasterisk.com
asco use cyclone templating instead of genshi
Ignore-this: 1f66e01d6e3a11c5abad8f594027f514
2 files changed with 18 insertions and 16 deletions:
0 comments (0 inline, 0 general)
light9/ascoltami/index.html
Show inline comments
 
@@ -4,7 +4,7 @@
 
<html xmlns="http://www.w3.org/1999/xhtml" 
 
      xmlns:py="http://genshi.edgewall.org/">
 
  <head>
 
    <title>ascoltami on ${host}</title>
 
    <title>ascoltami on {{host}}</title>
 
    <script type="text/javascript" src="/lib/jquery/dist/jquery.min.js"></script>
 
    <script type="text/javascript" src="/lib/jquery-ui/jquery-ui.min.js"></script>
 
    <link rel="Stylesheet" type="text/css" href="/lib/jquery-ui/themes/smoothness/jquery-ui.min.css"/>
 
@@ -15,7 +15,7 @@
 
    </style>
 
  </head>
 
  <body>
 
    <h1>ascoltami on ${host}</h1>
 
    <h1>ascoltami on {{host}}</h1>
 
    <div class="songs"/>
 

	
 
    <div class="dimStalled">
 
@@ -68,10 +68,7 @@
 
    }
 
    $("#updateReq").text(updateFreq);
 

	
 
    var times = { // need to get these from server
 
	intro: 4,
 
	post: 4
 
    };
 
    var times = {% raw times %};
 

	
 
    var currentDuration = 0;
 
    var currentHighlightedSong = "";
light9/ascoltami/webapp.py
Show inline comments
 
import json, socket, subprocess, cyclone.web
 
from twisted.python.util import sibpath
 
import json, socket, subprocess, os
 

	
 
from cyclone import template
 
from rdflib import URIRef
 
import cyclone.web
 

	
 
from cycloneerr import PrettyErrorHandler
 
from light9.namespaces import L9
 
from light9.showconfig import getSongsFromShow, songOnDisk
 
from rdflib import URIRef
 
from web.contrib.template import render_genshi
 
render = render_genshi([sibpath(__file__, ".")], auto_reload=True)
 

	
 
from cycloneerr import PrettyErrorHandler
 

	
 
_songUris = {}  # locationUri : song
 

	
 
loader = template.Loader(os.path.dirname(__file__))
 

	
 

	
 
def songLocation(graph, songUri):
 
    loc = URIRef("file://%s" % songOnDisk(songUri))
 
@@ -25,9 +27,12 @@ class root(PrettyErrorHandler, cyclone.w
 

	
 
    def get(self):
 
        self.set_header("Content-Type", "application/xhtml+xml")
 
        # todo: use a template; embed the show name and the intro/post
 
        # times into the page
 
        self.write(render.index(host=socket.gethostname()))
 
        self.write(
 
            loader.load('index.html').generate(host=socket.gethostname(),
 
                                               times=json.dumps({
 
                                                   'intro': 4,
 
                                                   'post': 4
 
                                               })))
 

	
 

	
 
def playerSongUri(graph, player):
0 comments (0 inline, 0 general)