[llvm-commits] [zorg] r125868 - in /zorg/trunk/llvmlab/llvmlab: llvmlabtool/main.py ui/app.py ui/templates/layout.html ui/views.py
Daniel Dunbar
daniel at zuster.org
Fri Feb 18 08:41:02 PST 2011
Author: ddunbar
Date: Fri Feb 18 10:41:02 2011
New Revision: 125868
URL: http://llvm.org/viewvc/llvm-project?rev=125868&view=rev
Log:
llvmlab: Add runserver command, and tweak module structure to be more canonical.
Modified:
zorg/trunk/llvmlab/llvmlab/llvmlabtool/main.py
zorg/trunk/llvmlab/llvmlab/ui/app.py
zorg/trunk/llvmlab/llvmlab/ui/templates/layout.html
zorg/trunk/llvmlab/llvmlab/ui/views.py
Modified: zorg/trunk/llvmlab/llvmlab/llvmlabtool/main.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/llvmlab/llvmlab/llvmlabtool/main.py?rev=125868&r1=125867&r2=125868&view=diff
==============================================================================
--- zorg/trunk/llvmlab/llvmlab/llvmlabtool/main.py (original)
+++ zorg/trunk/llvmlab/llvmlab/llvmlabtool/main.py Fri Feb 18 10:41:02 2011
@@ -10,7 +10,7 @@
import llvmlab.data
def action_create(name, args):
- """create an llvmlab installation"""
+ """create a llvmlab installation"""
import llvmlab
from optparse import OptionParser, OptionGroup
@@ -89,6 +89,21 @@
print >>data_file
data_file.close()
+def action_runserver(name, args):
+ """run a llvmlab instance"""
+
+ import llvmlab
+ from optparse import OptionParser, OptionGroup
+ parser = OptionParser("%%prog %s [options] <path>" % name)
+ (opts, args) = parser.parse_args(args)
+
+ if len(args) != 0:
+ parser.error("invalid number of arguments")
+
+ from llvmlab.ui import app
+ instance = app.App.create_standalone()
+ instance.run()
+
###
commands = dict((name[7:], f) for name,f in locals().items()
Modified: zorg/trunk/llvmlab/llvmlab/ui/app.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/llvmlab/llvmlab/ui/app.py?rev=125868&r1=125867&r2=125868&view=diff
==============================================================================
--- zorg/trunk/llvmlab/llvmlab/ui/app.py (original)
+++ zorg/trunk/llvmlab/llvmlab/ui/app.py Fri Feb 18 10:41:02 2011
@@ -86,7 +86,3 @@
password + self.config["SECRET_KEY"]).hexdigest()
user = self.config.data.users.get(username)
return user and passhash == user.passhash
-
-if __name__ == '__main__':
- app = App.create_standalone()
- app.run()
Modified: zorg/trunk/llvmlab/llvmlab/ui/templates/layout.html
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/llvmlab/llvmlab/ui/templates/layout.html?rev=125868&r1=125867&r2=125868&view=diff
==============================================================================
--- zorg/trunk/llvmlab/llvmlab/ui/templates/layout.html (original)
+++ zorg/trunk/llvmlab/llvmlab/ui/templates/layout.html Fri Feb 18 10:41:02 2011
@@ -5,7 +5,7 @@
<META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>{{ self.title() }}</title>
<link rel="stylesheet" type="text/css"{#
- #} href="{{ url_for('static', filename='style.css') }}">
+ #} href="{{ url_for('.static', filename='style.css') }}">
</head>
<body>
<div class="header">
Modified: zorg/trunk/llvmlab/llvmlab/ui/views.py
URL: http://llvm.org/viewvc/llvm-project/zorg/trunk/llvmlab/llvmlab/ui/views.py?rev=125868&r1=125867&r2=125868&view=diff
==============================================================================
--- zorg/trunk/llvmlab/llvmlab/ui/views.py (original)
+++ zorg/trunk/llvmlab/llvmlab/ui/views.py Fri Feb 18 10:41:02 2011
@@ -6,7 +6,7 @@
from flask import url_for
from flask import current_app
from flask import Module
-ui = Module('app.py')
+ui = Module(__name__)
@ui.route('/')
def index():
@@ -14,7 +14,7 @@
@ui.route('/favicon.ico')
def favicon_ico():
- return redirect(url_for('static', filename='favicon.ico'))
+ return redirect(url_for('.static', filename='favicon.ico'))
@ui.route('/users')
def users():
More information about the llvm-commits
mailing list