compileapp
Module¶
Functions required to execute app components¶
Note
FOR INTERNAL USE ONLY
-
gluon.compileapp.
LOAD
(c=None, f='index', args=None, vars=None, extension=None, target=None, ajax=False, ajax_trap=False, url=None, user_signature=False, timeout=None, times=1, content='loading...', post_vars={}, **attr)[source]¶ LOADs a component into the action’s document
Parameters: - c (str) – controller
- f (str) – function
- args (tuple or list) – arguments
- vars (dict) – vars
- extension (str) – extension
- target (str) – id of the target
- ajax (bool) – True to enable AJAX bahaviour
- ajax_trap (bool) – True if ajax is set to True, traps both links and forms “inside” the target
- url (str) – overrides c,`f`,`args` and vars
- user_signature (bool) – adds hmac signature to all links with a key that is different for every user
- timeout (int) – in milliseconds, specifies the time to wait before starting the request or the frequency if times is greater than 1 or “infinity”
- times (integer or str) – how many times the component will be requested “infinity” or “continuous” are accepted to reload indefinitely the component
-
class
gluon.compileapp.
LoadFactory
(environment)[source]¶ Bases:
object
Attention: this helper is new and experimental
-
gluon.compileapp.
build_environment
(request, response, session, store_current=True)[source]¶ Build the environment dictionary into which web2py files are executed.
-
gluon.compileapp.
compile_application
(folder, skip_failed_views=False)[source]¶ Compiles all models, views, controller for the application in folder.
-
gluon.compileapp.
compile_controllers
(folder)[source]¶ Compiles all the controllers in the application specified by folder
-
gluon.compileapp.
compile_models
(folder)[source]¶ Compiles all the models in the application specified by folder
-
gluon.compileapp.
compile_views
(folder, skip_failed_views=False)[source]¶ Compiles all the views in the application specified by folder
-
gluon.compileapp.
local_import_aux
(name, reload_force=False, app='welcome')[source]¶ In apps, instead of importing a local module (in applications/app/modules) with:
import a.b.c as d
you should do:
d = local_import('a.b.c')
or (to force a reload):
d = local_import(‘a.b.c’, reload=True)This prevents conflict between applications and un-necessary execs. It can be used to import any module, including regular Python modules.
-
class
gluon.compileapp.
mybuiltin
[source]¶ Bases:
object
NOTE could simple use a dict and populate it, NOTE not sure if this changes things though if monkey patching import…..
-
gluon.compileapp.
read_pyc
(filename)[source]¶ Read the code inside a bytecode compiled file if the MAGIC number is compatible
Returns: a code object
-
gluon.compileapp.
remove_compiled_application
(folder)[source]¶ Deletes the folder compiled containing the compiled application.
-
gluon.compileapp.
run_controller_in
(controller, function, environment)[source]¶ Runs the controller.function() (for the app specified by the current folder). It tries pre-compiled controller_function.pyc first before compiling it.
-
gluon.compileapp.
run_models_in
(environment)[source]¶ Runs all models (in the app specified by the current folder) It tries pre-compiled models first before compiling them.