17 lines
285 B
Python
17 lines
285 B
Python
from functools import wraps
|
|
|
|
import jingrow
|
|
|
|
|
|
def disabled(fn):
|
|
"""
|
|
Decorator to disable a function or method. Raises permission error when
|
|
called.
|
|
"""
|
|
|
|
@wraps(fn)
|
|
def wrapper(*args, **kwargs):
|
|
jingrow.throw("This method is disabled", jingrow.PermissionError)
|
|
|
|
return wrapper
|