[LNT] r188099 - [app] Factor out App.create_with_instance().
Daniel Dunbar
daniel at zuster.org
Fri Aug 9 13:02:54 PDT 2013
Author: ddunbar
Date: Fri Aug 9 15:02:54 2013
New Revision: 188099
URL: http://llvm.org/viewvc/llvm-project?rev=188099&view=rev
Log:
[app] Factor out App.create_with_instance().
Modified:
lnt/trunk/lnt/server/ui/app.py
Modified: lnt/trunk/lnt/server/ui/app.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/ui/app.py?rev=188099&r1=188098&r2=188099&view=diff
==============================================================================
--- lnt/trunk/lnt/server/ui/app.py (original)
+++ lnt/trunk/lnt/server/ui/app.py Fri Aug 9 15:02:54 2013
@@ -81,7 +81,7 @@ class Request(flask.Request):
class App(flask.Flask):
@staticmethod
- def create_standalone(config_path):
+ def create_with_instance(instance):
# Construct the application.
app = App(__name__)
@@ -92,13 +92,18 @@ class App(flask.Flask):
app.jinja_env.undefined = jinja2.StrictUndefined
# Load the application configuration.
- app.load_config(config_path)
+ app.load_config(instance)
# Load the application routes.
app.register_module(lnt.server.ui.views.frontend)
return app
+ @staticmethod
+ def create_standalone(config_path):
+ instance = lnt.server.instance.Instance.frompath(config_path)
+ return App.create_with_instance(instance)
+
def __init__(self, name):
super(App, self).__init__(name)
self.start_time = time.time()
@@ -113,8 +118,8 @@ class App(flask.Flask):
# #169).
self.wsgi_app = RootSlashPatchMiddleware(self.wsgi_app)
- def load_config(self, config_path):
- self.instance = lnt.server.instance.Instance.frompath(config_path)
+ def load_config(self, instance):
+ self.instance = instance
self.old_config = self.instance.config
self.jinja_env.globals.update(
More information about the llvm-commits
mailing list