Author: hertzog Date: 2006-03-26 20:53:13 +0000 (Sun, 26 Mar 2006) New Revision: 108
Added: lib/trunk/bin/webserver.py lib/trunk/etc/cherrypy.conf lib/trunk/lib/collabmaint/web.py lib/trunk/templates/ lib/trunk/templates/layout.kid lib/trunk/templates/list-packages.kid lib/trunk/templates/list-repositories.kid lib/trunk/webroot/ lib/trunk/webroot/layout.css Log: Start of a cherrypy-based + kid web interface. Added: lib/trunk/bin/webserver.py =================================================================== --- lib/trunk/bin/webserver.py 2006-02-05 17:40:21 UTC (rev 107) +++ lib/trunk/bin/webserver.py 2006-03-26 20:53:13 UTC (rev 108) @@ -0,0 +1,12 @@ +#!/usr/bin/python + +import sys +sys.path.append("./lib") + +import cherrypy +import collabmaint.web + +cherrypy.root = collabmaint.web.WebInterface() +cherrypy.config.update(file="etc/cherrypy.conf") +cherrypy.server.start() + Property changes on: lib/trunk/bin/webserver.py ___________________________________________________________________ Name: svn:executable + * Added: lib/trunk/etc/cherrypy.conf =================================================================== --- lib/trunk/etc/cherrypy.conf 2006-02-05 17:40:21 UTC (rev 107) +++ lib/trunk/etc/cherrypy.conf 2006-03-26 20:53:13 UTC (rev 108) @@ -0,0 +1,10 @@ +[global] +server.socketPort = 8080 +server.threadPool = 3 +sessionFilter.on = True +staticFilter.root = "/home/rhertzog/partages/debian/svn/collab-maint/trunk/webroot" + +[/layout.css] +staticFilter.on = True +staticFilter.file = "layout.css" + Added: lib/trunk/lib/collabmaint/web.py =================================================================== --- lib/trunk/lib/collabmaint/web.py 2006-02-05 17:40:21 UTC (rev 107) +++ lib/trunk/lib/collabmaint/web.py 2006-03-26 20:53:13 UTC (rev 108) @@ -0,0 +1,23 @@ + +import cherrypy +import kid +import collabmaint.conf + +class WebInterface: + def __init__(self): + return + + def index(self): + repos = collabmaint.conf.Cnf["ActiveRepositories"].split(" ") + template = kid.Template(file="templates/list-repositories.kid") + template.list = repos + return template.serialize(output='xhtml') + index.exposed = True + + def default(self, repository): + template = kid.Template(file="templates/list-packages.kid") + template.repository = repository + template.list = [ "a", "b" ] + return template.serialize(output='xhtml') + default.exposed = True + Added: lib/trunk/templates/layout.kid =================================================================== --- lib/trunk/templates/layout.kid 2006-02-05 17:40:21 UTC (rev 107) +++ lib/trunk/templates/layout.kid 2006-03-26 20:53:13 UTC (rev 108) @@ -0,0 +1,24 @@ +<?python +page_title = "Debian Collaborative Maintenance" +def page_specific_css(): + return "" +?> +<html xmlns:py="http://purl.org/kid/ns#"> + <head> + <title>${page_title}</title> + + <link href="static/layout.css" type="text/css" rel="stylesheet" /> + ${page_specific_css()} + </head> + + <body> + <h1>${page_title}</h1> + + <content>Default content - this will be replaced</content> + + <div class="footer"> + <hr/> + Copyright 2006 Raphaƫl Hertzog + </div> + </body> +</html> Added: lib/trunk/templates/list-packages.kid =================================================================== --- lib/trunk/templates/list-packages.kid 2006-02-05 17:40:21 UTC (rev 107) +++ lib/trunk/templates/list-packages.kid 2006-03-26 20:53:13 UTC (rev 108) @@ -0,0 +1,20 @@ +<?python +layout_params['page_title'] = "Packages from " #+ repository +# +# TODO: everything ! +# +?> +<html py:layout="'layout.kid'" + xmlns:py="http://purl.org/kid/ns#"> + +<!-- <link py:def="page_specific_css()" + href="content1.css" type="text/css" rel="stylesheet" /> --> + + <div py:match="item.tag == 'content'"> + <h1>${repository}</h1> + <table> + <!-- list all the packages --> + </table> + </div> + +</html> Added: lib/trunk/templates/list-repositories.kid =================================================================== --- lib/trunk/templates/list-repositories.kid 2006-02-05 17:40:21 UTC (rev 107) +++ lib/trunk/templates/list-repositories.kid 2006-03-26 20:53:13 UTC (rev 108) @@ -0,0 +1,16 @@ +<?python +layout_params['page_title'] = "List of repositories" +?> +<html py:layout="'layout.kid'" + xmlns:py="http://purl.org/kid/ns#"> + +<!-- <link py:def="page_specific_css()" + href="content1.css" type="text/css" rel="stylesheet" /> --> + + <div py:match="item.tag == 'content'"> + <ul> + <li py:for="i in list"><a href="${i}">${i}</a></li> + </ul> + </div> + +</html> Added: lib/trunk/webroot/layout.css =================================================================== --- lib/trunk/webroot/layout.css 2006-02-05 17:40:21 UTC (rev 107) +++ lib/trunk/webroot/layout.css 2006-03-26 20:53:13 UTC (rev 108) @@ -0,0 +1,3 @@ + +table { border-width: 2px } + _______________________________________________ Collab-maint-devel mailing list Collab-maint-devel@lists.alioth.debian.org http://lists.alioth.debian.org/mailman/listinfo/collab-maint-devel