Package gluon :: Module compileapp
[hide private]
[frames] | no frames]

Module compileapp

source code

This file is part of web2py Web Framework (Copyrighted, 2007) Developed by Massimo Di Pierro <mdipierro@cs.depaul.edu> License: GPL v2

Functions [hide private]
 
save_pyc(filename) source code
 
read_pyc(filename) source code
 
compile_views(folder)
compiles all the views in the applicaiton specified by the current folder
source code
 
compile_models(folder)
compiles all the models in the applicaiton specified by the current folder
source code
 
compile_controllers(folder)
compiles all the controllers in the applicaiton specified by the current folder
source code
 
run_models_in(environment)
runs all models (in the app specified by the current folder) in the environment.
source code
 
run_controller_in(controller, function, environment)
runs the controller.function() (for the app specified by the current folder) in the environment.
source code
 
run_view_in(environment)
exectutes the view in resposne.view or generic.html.
source code
 
remove_compiled_application(folder) source code
 
compile_application(folder) source code
 
test()
Example: >>> import traceback, types >>> environment={'x':1} >>> open('a.py','w').write('print 1/x') >>> save_pyc('a.py') >>> os.unlink('a.py') >>> if type(read_pyc('a.pyc'))==types.CodeType: print 'code' code >>> exec read_pyc('a.pyc') in environment 1
source code
Variables [hide private]
  error_message = '<html><body><h1>Invalid request</h1>%s</body>...
  TEST_CODE = '\ndef _TEST():\n import doctest, sys, cStringI...
Function Details [hide private]

run_models_in(environment)

source code 

runs all models (in the app specified by the current folder) in the environment. it tries precompiled models first.

run_controller_in(controller, function, environment)

source code 

runs the controller.function() (for the app specified by the current folder) in the environment. it tries precompiled controller_function.pyc first.

run_view_in(environment)

source code 

exectutes the view in resposne.view or generic.html. it tries the precompiled views_controller_funciton.pyc first.


Variables Details [hide private]

error_message

Value:
'<html><body><h1>Invalid request</h1>%s</body></html>'

TEST_CODE

Value:
'''
def _TEST():
    import doctest, sys, cStringIO, types, cgi, gluon.fileutils
    if not gluon.fileutils.check_credentials(request):
        raise HTTP(400,web2py_error=\'invalid credentials\')
    stdout=sys.stdout
    html=\'<h2>Testing controller "%s.py" ... done.</h2><br/>\\n\' % r\
equest.controller
...