summaryrefslogtreecommitdiff
path: root/src/decorators.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/decorators.py')
-rw-r--r--src/decorators.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/decorators.py b/src/decorators.py
index ab987701..3cb967b3 100644
--- a/src/decorators.py
+++ b/src/decorators.py
@@ -1,7 +1,9 @@
"""
-Module containing the decorators
+Module containing various decorators
"""
+from functools import partial
+
class RefreshWrapper(object):
def __init__(self):
self.core = None
@@ -40,5 +42,14 @@ class RefreshWrapper(object):
return ret
return wrap
+def __completion(quoted, func):
+ class Completion(object):
+ quoted = quoted
+ def __new__(cls, *args, **kwargs):
+ return func(*args, **kwargs)
+ return Completion
+
+completion_quotes = partial(__completion, True)
+completion_raw = partial(__completion, False)
refresh_wrapper = RefreshWrapper()