tarina

git clone https://git.tarina.org/tarina
Log | Files | Refs | README | LICENSE

commit c1634856b1786ec0bfe001fc7b70e53c5c34d390
parent 9b7ddc11050b55c9a74f774d010614cb335b5400
Author: rbckman <robinbackman@gmail.com>
Date:   Fri, 10 Aug 2018 16:06:18 +0300

added tarina server

Diffstat:
Asrv/tarinaserver.py | 26++++++++++++++++++++++++++
Asrv/templates/index.html | 16++++++++++++++++
2 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/srv/tarinaserver.py b/srv/tarinaserver.py @@ -0,0 +1,26 @@ +import web +import os + +films = [] + +urls = ( + '/', 'index' +) + +render = web.template.render('templates/') + +class index: + def GET(self): + films = os.walk('static/Videos/').next()[1] + renderedfilms = [] + unrenderedfilms = [] + for i in films: + if os.path.isfile('static/Videos/' + i + '/' + i + '.mp4') == True: + renderedfilms.append(i) + else: + unrenderedfilms.append(i) + return render.index(renderedfilms, unrenderedfilms) + +if __name__== "__main__": + app = web.application(urls, globals()) + app.run() diff --git a/srv/templates/index.html b/srv/templates/index.html @@ -0,0 +1,16 @@ +$def with (renderedfilms, unrenderedfilms) +$var renderedfilms = renderedfilms +$var unrenderedfilms = unrenderedfilms + +<h1>Films</h1> + +$for i in renderedfilms: + <p>--------------------------------------------------------------</p> + <h3>$i</h3> + <a href="static/Videos/$i/${i}.mp4"><img width="300px" src="static/Videos/$i/scene001/shot001/take001.png"/></a><br> + +<h1>Films unrendered</h1> + +$for i in unrenderedfilms: + <h3>$i </h3> +