From 63359c358c0cb7e708a31e53e4a782e78cb3ad6d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 7 Dec 2016 10:27:09 +0530 Subject: [PATCH] __repr__ for windows and tabs --- kitty/tabs.py | 3 +++ kitty/window.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/kitty/tabs.py b/kitty/tabs.py index 51d4cb4c0..4bcab61a9 100644 --- a/kitty/tabs.py +++ b/kitty/tabs.py @@ -147,6 +147,9 @@ class Tab: def render(self): self.borders.render(get_boss().borders_program) + def __repr__(self): + return 'Tab(title={}, id={})'.format(self.name or self.title, hex(id(self))) + class TabManager: diff --git a/kitty/window.py b/kitty/window.py index 78dd3adb3..35876a05d 100644 --- a/kitty/window.py +++ b/kitty/window.py @@ -42,6 +42,9 @@ class Window: self.write_buf = memoryview(b'') self.char_grid = CharGrid(self.screen, opts) + def __repr__(self): + return 'Window(title={}, id={})'.format(self.title, hex(id(self))) + @property def is_visible_in_layout(self): return self._is_visible_in_layout