summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--blockext/__init__.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/blockext/__init__.py b/blockext/__init__.py
index 6f3eede..c1779a5 100644
--- a/blockext/__init__.py
+++ b/blockext/__init__.py
@@ -227,7 +227,7 @@ class Block(object):
if blocking and shape != "command":
raise ValueError("only commands can be blocking")
- self.text = text
+ self._text = text
self.shape = shape
self.func = func
self.is_blocking = blocking
@@ -247,6 +247,10 @@ class Block(object):
shape_defaults = map(Block.INPUT_DEFAULTS.get, self.arg_shapes)
self.defaults = [a or b for (a, b) in zip(defaults, shape_defaults)]
+ @property
+ def text(self):
+ return self._text.format(**vars(Blockext))
+
def __repr__(self):
return "<Block(%r)>" % self.text