From 8ee0c106ff8609cb007b09ccbb91ea6500ee1863 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 8 Jan 2015 09:02:59 +0530 Subject: [PATCH] Nicer repr for tab stops --- src/calibre/gui2/tweak_book/editor/snippets.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/calibre/gui2/tweak_book/editor/snippets.py b/src/calibre/gui2/tweak_book/editor/snippets.py index dfb2b76811..127149194b 100644 --- a/src/calibre/gui2/tweak_book/editor/snippets.py +++ b/src/calibre/gui2/tweak_book/editor/snippets.py @@ -166,6 +166,11 @@ class EditorTabStop(object): def __exit__(self, *args): self.join_previous_edit = False + def __repr__(self): + return 'EditorTabStop(num=%r text=%r left=%r right=%r is_deleted=%r mirrors=%r)' % ( + self.num, self.text, self.left, self.right, self.is_deleted, self.mirrors) + __str__ = __unicode__ = __repr__ + def apply_selected_text(self, text): if self.takes_selection and not self.is_deleted: with self: