Package web2py :: 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
  Auth
Class for authentication, authorization, role based access control.
  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.
Functions [hide private]
 
DEFAULT() source code
 
callback(actions, form, tablename=1) source code
 
validators(*a) source code
 
call_or_redirect(f, *args) source code
 
addrow(form, a, b, c, style, _id, position=-1) source code
 
fetch(url, data=1, headers={}, 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 0x2543668>) source code
 
test_thread_separation() source code
Variables [hide private]
  logger = logging.getLogger("web2py")
  regex_geocode = re.compile(r'<coordinates>(?P<la>[^,]*),(?P<lo...
  ON = True
  TAG = <gluon.html.__TAG__ object at 0x2128f10>
  current = <thread._local object at 0x1f4ab10>
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'<coordinates>(?P<la>[^,]*),(?P<lo>[^,]*).*?</coordinates>\
')