Home | Trees | Indices | Help |
|
---|
|
| This file is part of the web2py Web Framework | Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) Functions required to execute app components --------------------------------------------- Note: FOR INTERNAL USE ONLY
|
|||
mybuiltin NOTE could simple use a dict and populate it, NOTE not sure if this changes things though if monkey patching import..... |
|||
LoadFactory Attention: this helper is new and experimental |
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
logger = logging.getLogger("web2py")
|
|||
is_pypy = False
|
|||
is_gae = None hash(x) |
|||
is_jython = False
|
|||
TEST_CODE =
|
|||
CACHED_REGEXES =
|
|||
CACHED_REGEXES_MAX_SIZE = 1000
|
|||
_base_environment_ =
|
|||
__package__ =
|
|
LOADs a component into the action's document Args: 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 |
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. |
Read the code inside a bytecode compiled file if the MAGIC number is compatible Returns: a code object |
Runs the controller.function() (for the app specified by the current folder). It tries pre-compiled controller_function.pyc first before compiling it. |
Executes the view for the requested action. The view is the one specified in `response.view` or determined by the url or `view/generic.extension` It tries the pre-compiled views_controller_function.pyc before compiling it. |
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 |
|
TEST_CODE
|
_base_environment_
|
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Sun Mar 16 02:36:10 2014 | http://epydoc.sourceforge.net |