summaryrefslogtreecommitdiffstats
path: root/command_context.py
diff options
context:
space:
mode:
authorJan Pokorný <jpokorny@redhat.com>2014-06-17 20:11:29 +0200
committerJan Pokorný <jpokorny@redhat.com>2014-06-17 20:11:29 +0200
commitd0715a400fff796be61b37404d6527e03092c0ad (patch)
tree106eba480921241aea26701d5e1504085089b5c2 /command_context.py
parent8d77df7c0e116e4cd1f6aa38f00b856571327d49 (diff)
downloadclufter-d0715a400fff796be61b37404d6527e03092c0ad.tar.gz
clufter-d0715a400fff796be61b37404d6527e03092c0ad.tar.xz
clufter-d0715a400fff796be61b37404d6527e03092c0ad.zip
command_context: teach CommandContextBase to `repr` itself
Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
Diffstat (limited to 'command_context.py')
-rw-r--r--command_context.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/command_context.py b/command_context.py
index e197f5b..ff1cf1b 100644
--- a/command_context.py
+++ b/command_context.py
@@ -68,6 +68,9 @@ class CommandContextBase(MutableMapping):
def __len__(self):
return len(self._dict)
+ def __repr__(self):
+ return "<{0}: {1}>".format(repr(self.__class__), repr(self._dict))
+
def __setitem__(self, key, value):
# XXX value could be also any valid dict constructor argument
self._dict[key] = CommandContextBase(initial=value, parent=self) \