From 83367943421c60524604d1491784043d4d27953c Mon Sep 17 00:00:00 2001 From: Joscha Date: Sun, 9 Jun 2019 14:44:35 +0000 Subject: [PATCH] Clean up a bit --- cheuph/cursor_rendering.py | 16 ++++++++++++++++ cheuph/message_editor_widget.py | 13 ------------- cheuph/user_list_widget.py | 12 ------------ 3 files changed, 16 insertions(+), 25 deletions(-) delete mode 100644 cheuph/message_editor_widget.py delete mode 100644 cheuph/user_list_widget.py diff --git a/cheuph/cursor_rendering.py b/cheuph/cursor_rendering.py index d2750c2..dc9f088 100644 --- a/cheuph/cursor_rendering.py +++ b/cheuph/cursor_rendering.py @@ -77,6 +77,16 @@ class CursorTreeRenderer(Generic[E]): # Configurable variables if indent_width < 0: raise ValueError("indent width must be 0 or greater") + if len(indent) != 1: + raise ValueError() # TODO add description to exception + if len(indent_fill) != 1: + raise ValueError() # TODO add description to exception + if len(cursor_indent) != 1: + raise ValueError() # TODO add description to exception + if len(cursor_corner) != 1: + raise ValueError() # TODO add description to exception + if len(cursor_fill) != 1: + raise ValueError() # TODO add description to exception if scrolloff < 0: raise ValueError("scrolloff must be 0 or greater") self._indent_width = indent_width @@ -89,6 +99,8 @@ class CursorTreeRenderer(Generic[E]): self._cursor_indent_attrs = cursor_indent_attrs self._scrolloff = scrolloff + # Some properties + @property def lines(self) -> AttributedLines: # Not sure if the between() is necessary @@ -98,6 +110,10 @@ class CursorTreeRenderer(Generic[E]): def hit_top(self) -> bool: return self._hit_top + @property + def cursor_id(self) -> Optional[Id]: + return self._cursor_id + # Offsets @staticmethod diff --git a/cheuph/message_editor_widget.py b/cheuph/message_editor_widget.py deleted file mode 100644 index e050a4f..0000000 --- a/cheuph/message_editor_widget.py +++ /dev/null @@ -1,13 +0,0 @@ -__all__ = ["MessageEditorWidget"] - - -class MessageEditorWidget: - """ - This widget allows the user to compose a new message. It is based on - urwid's Edit widget. - - One day, it will (hopefully) support syntax highlighting and tab - completion. - """ - - pass diff --git a/cheuph/user_list_widget.py b/cheuph/user_list_widget.py deleted file mode 100644 index 797958a..0000000 --- a/cheuph/user_list_widget.py +++ /dev/null @@ -1,12 +0,0 @@ -__all__ = ["UserListWidget"] - - -class UserListWidget: - """ - This widget displays the users currently connected to a Room. - - It must be notified of changes in the user list by the RoomWidget it is a - part of. - """ - - pass