diff options
author | Jan Pokorný <jpokorny@redhat.com> | 2014-06-17 20:11:29 +0200 |
---|---|---|
committer | Jan Pokorný <jpokorny@redhat.com> | 2014-06-17 20:11:29 +0200 |
commit | d0715a400fff796be61b37404d6527e03092c0ad (patch) | |
tree | 106eba480921241aea26701d5e1504085089b5c2 | |
parent | 8d77df7c0e116e4cd1f6aa38f00b856571327d49 (diff) | |
download | clufter-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>
-rw-r--r-- | command_context.py | 3 |
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) \ |