Skip to content
Snippets Groups Projects
Commit 23a5a791 authored by Renaud Le Gac's avatar Renaud Le Gac
Browse files

Add a new option in the application controller to run a test scripts.

Useful to develop new feature in the application framework.
parent 41989e63
No related branches found
No related tags found
No related merge requests found
...@@ -25,6 +25,11 @@ def index(): ...@@ -25,6 +25,11 @@ def index():
debug debug
activate the debug mode on the server side. activate the debug mode on the server side.
test
launch the javascript apptest.js instead of the main
application scripts appmain.js. Useful to develop new
features and components in the application framework.
EXAMPLES EXAMPLES
http://localhost:8000/mdvPostInstall http://localhost:8000/mdvPostInstall
...@@ -32,10 +37,11 @@ def index(): ...@@ -32,10 +37,11 @@ def index():
""" """
# is debug option required ? # options
debug = False for opt in ["debug", "test"]:
if "debug" in request.get_vars: exec("%s = False" % opt)
debug = True if opt in request.get_vars:
exec("%s = True" % opt)
# application path # application path
base = os.path.join(os.path.sep, request.application) base = os.path.join(os.path.sep, request.application)
...@@ -60,10 +66,14 @@ def index(): ...@@ -60,10 +66,14 @@ def index():
os.path.join(base, 'static', 'appjs', 'entryform.js'), os.path.join(base, 'static', 'appjs', 'entryform.js'),
os.path.join(base, 'static', 'appjs', 'vieweditgrid.js'), os.path.join(base, 'static', 'appjs', 'vieweditgrid.js'),
os.path.join(base, 'static', 'appjs', 'appcfg.js'), os.path.join(base, 'static', 'appjs', 'appcfg.js'),
os.path.join(base, 'static', 'appjs', 'appmgr.js'), os.path.join(base, 'static', 'appjs', 'appmgr.js')]
os.path.join(base, 'static', 'appmain.js')
]
# main application script
if test:
applibs.append(os.path.join(base, 'static', 'apptest.js'))
else:
applibs.append(os.path.join(base, 'static', 'appmain.js'))
# page view # page view
response.view = "applayout.html" response.view = "applayout.html"
......
/**
* apptest.js
*
* To test and debug new features
*
* $Id: appmain.js 640 2009-06-01 15:26:41Z legac $
*
*/
Ext.onReady(function(){
Ext.QuickTips.init();
// var app = new App.Mgr({
// cfgParams: {
// debug: App.debug,
// exclude: ["systemsAddRpms", "systemsRemoveRpms"],
// },
// });
//
// app.render(document.body);
});
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment