Clean up a bit

This commit is contained in:
Joscha 2019-06-09 14:44:35 +00:00
parent 5e7089f320
commit 8336794342
3 changed files with 16 additions and 25 deletions

View file

@ -77,6 +77,16 @@ class CursorTreeRenderer(Generic[E]):
# Configurable variables # Configurable variables
if indent_width < 0: if indent_width < 0:
raise ValueError("indent width must be 0 or greater") 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: if scrolloff < 0:
raise ValueError("scrolloff must be 0 or greater") raise ValueError("scrolloff must be 0 or greater")
self._indent_width = indent_width self._indent_width = indent_width
@ -89,6 +99,8 @@ class CursorTreeRenderer(Generic[E]):
self._cursor_indent_attrs = cursor_indent_attrs self._cursor_indent_attrs = cursor_indent_attrs
self._scrolloff = scrolloff self._scrolloff = scrolloff
# Some properties
@property @property
def lines(self) -> AttributedLines: def lines(self) -> AttributedLines:
# Not sure if the between() is necessary # Not sure if the between() is necessary
@ -98,6 +110,10 @@ class CursorTreeRenderer(Generic[E]):
def hit_top(self) -> bool: def hit_top(self) -> bool:
return self._hit_top return self._hit_top
@property
def cursor_id(self) -> Optional[Id]:
return self._cursor_id
# Offsets # Offsets
@staticmethod @staticmethod

View file

@ -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

View file

@ -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