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

Module tools

source code

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)

Classes [hide private]
  Mail
Class for configuring and sending emails with alternative text / html body, multiple attachments and encryption support
  Recaptcha
Usage:
  Auth
  Crud
  Service
  PluginManager
Plugin Manager is similar to a storage object but it is a single level singleton this means that multiple instances within the same thread share the same attributes Its constructor is also special.
  Expose
  Wiki
  Config
Functions [hide private]
 
DEFAULT() source code
 
getarg(position, default=None) source code
 
callback(actions, form, tablename=None) source code
 
validators(*a) source code
 
call_or_redirect(f, *args) source code
 
replace_id(url, form) source code
 
addrow(form, a, b, c, style, _id, position=-1) source code
 
fetch(url, data=None, headers=None, cookie=<SimpleCookie: >, user_agent='Mozilla/5.0') source code
 
geocode(address) source code
 
universal_caller(f, *a, **b) source code
 
completion(callback)
Executes a task on completion of the called action.
source code
 
prettydate(d, T=<function <lambda> at 0x55307d0>) source code
 
test_thread_separation() source code
Variables [hide private]
  logger = logging.getLogger("web2py")
  regex_geocode = re.compile(r'<geometry>\W*?<location>\W*?<lat>...
  ON = True
  TAG = __TAG__()
  __package__ = 'gluon'
  current = None
Function Details [hide private]

completion(callback)

source code 

Executes a task on completion of the called action. For example:

    from gluon.tools import completion
    @completion(lambda d: logging.info(repr(d)))
    def index():
        return dict(message='hello')

It logs the output of the function every time input is called.
The argument of completion is executed in a new thread.


Variables Details [hide private]

regex_geocode

Value:
re.compile(r'<geometry>\W*?<location>\W*?<lat>(?P<la>[^<]*)</lat>\W*?<\
lng>(?P<lo>[^<]*)</lng>\W*?</location>')