mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-25 02:44:18 +00:00
Add some documentation
This commit is contained in:
parent
3a989534cf
commit
bbcf5c5312
@ -16,7 +16,14 @@ def admin_required(f):
|
|||||||
|
|
||||||
|
|
||||||
def background(f):
|
def background(f):
|
||||||
''' This decorator executes a function in a Thread '''
|
'''
|
||||||
|
' This decorator executes a function in a Thread.
|
||||||
|
' Decorated functions need to be executed within a code block where an
|
||||||
|
' app context exists.
|
||||||
|
'
|
||||||
|
' NOTE: An app object is passed as a keyword argument to the decorated
|
||||||
|
' function.
|
||||||
|
'''
|
||||||
@wraps(f)
|
@wraps(f)
|
||||||
def wrapped(*args, **kwargs):
|
def wrapped(*args, **kwargs):
|
||||||
kwargs['app'] = current_app._get_current_object()
|
kwargs['app'] = current_app._get_current_object()
|
||||||
|
Loading…
Reference in New Issue
Block a user