+class _WrapperBase(object):
+ __slots__ = [
+ "_fn",
+ "_text",
+ ]
+
+ def __init__(self, text, fn):
+ """Initializes this class.
+
+ @param text: Description
+ @param fn: Wrapped function
+
+ """
+ assert text.strip()
+
+ self._text = text
+ self._fn = fn
+
+ def __call__(self, *args):
+ return self._fn(*args)
+
+
+class _DescWrapper(_WrapperBase):
+ """Wrapper class for description text.
+
+ """
+ def __str__(self):
+ return self._text
+
+
+class _CommentWrapper(_WrapperBase):
+ """Wrapper class for comment.
+
+ """
+ def __str__(self):
+ return "%s [%s]" % (self._fn, self._text)
+
+