Part of bzrlib
| Line # | Kind | Name | Docs |
|---|---|---|---|
| 213 | Function | use_fast_decorators | Change the default decorators to be fast loading ones. |
| 224 | Function | use_pretty_decorators | Change the default decorators to be pretty ones. |
| 28 | Function | _get_parameters | Recreate the parameters for a function using introspection. |
| 69 | Function | _pretty_needs_read_lock | Decorate unbound to take out and release a read lock. |
| 122 | Function | _fast_needs_read_lock | Decorate unbound to take out and release a read lock. |
| 154 | Function | _pretty_needs_write_lock | Decorate unbound to take out and release a write lock. |
| 187 | Function | _fast_needs_write_lock | Decorate unbound to take out and release a write lock. |
Recreate the parameters for a function using introspection.
:return: (function_params, calling_params)
function_params: is a string representing the parameters of the
function. (such as "a, b, c=None, d=1")
This is used in the function declaration.
calling_params: is another string representing how you would call the
function with the correct parameters. (such as "a, b, c=c, d=d")
Assuming you sued function_params in the function declaration, this
is the parameters to put in the function call.
For example:
def wrapper(%(function_params)s):
return original(%(calling_params)s)
Decorate unbound to take out and release a read lock.
This decorator can be applied to methods of any class with lock_read() and
unlock() methods.
Typical usage:
class Branch(...):
@needs_read_lock
def branch_method(self, ...):
stuff
Decorate unbound to take out and release a read lock.
This decorator can be applied to methods of any class with lock_read() and
unlock() methods.
Typical usage:
class Branch(...):
@needs_read_lock
def branch_method(self, ...):
stuff