diff --git a/controllers/default.py b/controllers/default.py index 9855f00e5398ea91aaaa6cf163b4529439bd00b3..b45d3475181f4c2c1eec66ffb8d98e64587169fe 100644 --- a/controllers/default.py +++ b/controllers/default.py @@ -25,10 +25,11 @@ def index(): debug 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. + script foo + by default the javascript appmain.js is launch. + this option will launch the specified script, i.e. foo.js. + Useful to develop new features and components in the + application framework. EXAMPLES @@ -37,18 +38,25 @@ def index(): """ - # options - for opt in ["debug", "test"]: - exec("%s = False" % opt) - if opt in request.get_vars: - exec("%s = True" % opt) - + # option debug + debug = False + if "debug" in request.get_vars: + debug = True + + # option script + script = "appmain" + if "script" in request.get_vars: + script = request.get_vars.script + + print "OPTION DEBUG:", debug + print "OPTION SCRIPT:", script + # application path base = os.path.join(os.path.sep, request.application) # css files csslibs = [os.path.join(base, 'static', 'extjs', 'resources', 'css', 'ext-all.css'), - os.path.join(base, 'static', 'appjs', 'icons.css')] + os.path.join(base, 'static', 'extjs', 'examples', 'shared', 'icons', 'silk.css')] # javascript librairies if debug: @@ -69,10 +77,7 @@ def index(): os.path.join(base, 'static', 'appjs', 'appmgr.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')) + applibs.append(os.path.join(base, 'static', '%s.js' % script)) # page view response.view = "applayout.html"