Skip to content

Commit c03f1a9

Browse files
committed
Prepare version 0.9.
1 parent 9b1b017 commit c03f1a9

File tree

4 files changed

+13
-8
lines changed

4 files changed

+13
-8
lines changed

examples/confrontation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ def box_factory(win,
2323
height, width,
2424
title, title_colors_pair_nb,
2525
global_win=win,
26-
# Use a default window to display text.
27-
# Setting this parameter allows to avoid passing `win`
26+
# Use a default window to display text.
27+
# Setting this parameter allows to avoid passing `win`
2828
# parameter to `char_by_char` and `word_by_word` methods.
2929
# Useful when dealing with many `DialogBox` methods calls.
3030
**kwargs)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"Environment :: Console :: Curses",
2323
"Intended Audience :: Developers",
2424
"Typing :: Typed",
25-
"License :: OSI Approved :: GNU Lesser General Public License v3.0 (LGPLv3)",
25+
"License :: OSI Approved :: GNU Lesser General Public License v3.0 (LGPLv3)",
2626
"Natural Language :: English", "Natural Language :: French",
2727
"Operating System :: MacOS",
2828
"Operating System :: Microsoft :: Windows",

visualdialog/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""A library to make easier dialog box in terminal."""
22

3-
__version__ = 0.8
3+
__version__ = 0.9
44
__author__ = "Timéo Arnouts"
55

66
from .box import *

visualdialog/box.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55

66
import curses
77
import curses.textpad
8-
import functools
9-
from typing import (Any, Callable, List, Literal, NoReturn, Sequence, Tuple,
10-
Union)
8+
from typing import List, Literal, NoReturn, Sequence, Tuple, Union
119

1210
from .error import PanicError, ValueNotInBound
1311
from .type import (CursesKey, CursesTextAttribute, CursesTextAttributes,
@@ -43,7 +41,8 @@ def __set__(self, obj: "BaseTextBox", value: int) -> NoReturn:
4341
minimum_box_width = 4
4442

4543
if value < minimum_box_width:
46-
raise ValueNotInBound(f"width must be more than {minimum_box_width}")
44+
raise ValueNotInBound("width must be more than "
45+
f"{minimum_box_width}")
4746
else:
4847
obj._width = value
4948

@@ -63,9 +62,15 @@ class BaseTextBox:
6362
6463
:param height: Height of the dialog box in ``curses`` window object
6564
on which methods will have effects.
65+
This value is covered by a descriptor to avoid unexpected behavior.
66+
Set this value to a value lower than title length and title box borders
67+
height (``len(self.title) + 5``) raises a ``ValueError``.
6668
6769
:param width: Width of the dialog box in ``curses`` window object on
6870
which methods will have effects.
71+
This value is covered by a descriptor to avoid unexpected behavior.
72+
Set this value to a value lower than 4 (the minimum box width)
73+
raises a ``ValueError``.
6974
7075
:param title: String that will be displayed in the upper left corner
7176
of dialog box.

0 commit comments

Comments
 (0)