# HG changeset patch # User Steve Losh # Date 1255474965 14400 # Node ID 9539fb54320e3971117034ce81c4fc077ff9a7dd # Parent 96a4cc60e57d62a5076d23f256edf4fac80cd3fd More infrastructure for the web interface. diff -r 96a4cc60e57d -r 9539fb54320e review/web_templates/index.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/review/web_templates/index.html Tue Oct 13 19:02:45 2009 -0400 @@ -0,0 +1,13 @@ +$def with (repo) + + + + + Code Review + + + +

Reviewing: $repo.root

+ + \ No newline at end of file diff -r 96a4cc60e57d -r 9539fb54320e review/web_ui.py --- a/review/web_ui.py Tue Oct 13 18:50:22 2009 -0400 +++ b/review/web_ui.py Tue Oct 13 19:02:45 2009 -0400 @@ -2,7 +2,9 @@ import sys, os -top_path = os.path.split(os.path.split(os.path.realpath(__file__))[0])[0] +package_path = os.path.split(os.path.realpath(__file__))[0] +template_path = os.path.join(package_path, 'web_templates') +top_path = os.path.split(package_path)[0] bundled_path = os.path.join(top_path, 'bundled') webpy_path = os.path.join(bundled_path, 'webpy') @@ -10,16 +12,22 @@ import web +_repo = None urls = ( '/', 'index' ) +render = web.template.render(template_path) class index: def GET(self): - return "Hello, world!" + return render.index(_repo) + app = web.application(urls, globals()) def load_interface(repo): + global _repo + _repo = repo + sys.argv = sys.argv[:1] # Seriously, web.py? This is such a hack. - app.run() \ No newline at end of file + app.run()