Skip to content

Commit 02439b5

Browse files
committed
Revert ", change lib version number."
This reverts commit 31f4a43.
1 parent 31f4a43 commit 02439b5

File tree

8 files changed

+26
-27
lines changed

8 files changed

+26
-27
lines changed

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,14 +72,11 @@ import curses
7272
from visualdialog import DialogBox
7373

7474

75-
x, y = (0, 0)
76-
length, width = (35, 6)
77-
7875
def main(stdscr):
7976
curses.curs_set(False)
8077

81-
textbox = DialogBox(x, y,
82-
length, width,
78+
textbox = DialogBox(0, 0,
79+
35, 6,
8380
title="Demo")
8481
textbox.char_by_char(stdscr,
8582
"Hello world")

tests/test.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,16 @@ def main(stdscr):
1818

1919
curses.curs_set(0)
2020

21+
curses.start_color()
2122
curses.init_pair(1, curses.COLOR_RED, curses.COLOR_BLACK)
2223
curses.init_pair(2, curses.COLOR_CYAN, curses.COLOR_BLACK)
2324
curses.init_pair(3, curses.COLOR_GREEN, curses.COLOR_BLACK)
2425

2526
textbox = DialogBox(0, 0,
2627
40, 6,
27-
# title="Tim-ats-d",
28-
# title_colors_pair_nb=3,
29-
end_indicator="o")
28+
# ~ title="Tim-ats-d",
29+
title_colors_pair_nb=3,
30+
end_dialog_indicator="o")
3031

3132
textbox.confirm_dialog_key = (32, )
3233
textbox.panic_key = (10, )
@@ -43,9 +44,9 @@ def func(text: str):
4344
textbox.char_by_char(stdscr,
4445
reply,
4546
cargs=(reply, ),
46-
callback=func,
47-
text_attr=(curses.A_ITALIC, curses.A_BOLD),
48-
words_attr=special_words)
47+
callback=func)
48+
# ~ text_attr=(curses.A_ITALIC, curses.A_BOLD),
49+
# ~ words_attr=special_words)
4950

5051
with visualdialog.TextAttributes(stdscr, curses.A_BOLD, curses.A_ITALIC):
5152
...

visualdialog/__init__.py

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

5-
__version__ = 0.7
5+
__version__ = 0.6
66
__author__ = "Timéo Arnouts"
77

88
from .dialog import DialogBox
-358 Bytes
Binary file not shown.
-6.33 KB
Binary file not shown.
-12.5 KB
Binary file not shown.
-2 KB
Binary file not shown.

visualdialog/dialog.py

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -72,21 +72,21 @@ def __init__(
7272
downtime_chars: Union[Tuple[str],
7373
List[str]] = (",", ".", ":", ";", "!", "?"),
7474
downtime_chars_delay: Numeric = .6,
75-
end_indicator: str = "►"):
75+
end_dialog_indicator: str = "►"):
7676
BaseTextBox.__init__(self,
7777
pos_x, pos_y,
7878
length, width,
7979
title,
8080
title_colors_pair_nb, title_text_attr,
8181
downtime_chars, downtime_chars_delay)
8282

83-
self.end_indicator_char = end_indicator
84-
self.end_indicator_pos_x = self.pos_x + self.length - 2
83+
self.end_dialog_indicator_char = end_dialog_indicator
84+
self.end_dialog_indicator_pos_x = self.pos_x + self.length - 2
8585

8686
if self.title:
87-
self.end_indicator_pos_y = self.pos_y + self.width + 1
87+
self.end_dialog_indicator_pos_y = self.pos_y + self.width + 1
8888
else:
89-
self.end_indicator_pos_y = self.pos_y + self.width - 1
89+
self.end_dialog_indicator_pos_y = self.pos_y + self.width - 1
9090

9191
self.text_wrapper = textwrap.TextWrapper(width=self.nb_char_max_line)
9292

@@ -96,26 +96,26 @@ def __enter__(self):
9696
def __exit__(self, type, value, traceback):
9797
...
9898

99-
def _display_end_indicator(
99+
def _display_end_dialog_indicator(
100100
self,
101101
win: CursesWindow,
102102
text_attr: CursesTextAttributesConstants = (curses.A_BOLD,
103103
curses.A_BLINK)):
104-
"""Displays an end indicator in the lower right corner of
105-
textbox.
104+
"""Displays an end of dialog indicator in the lower right corner
105+
of textbox.
106106
107107
:param win: ``curses`` window object on which the method
108108
will have effect.
109109
110110
:param text_attr: Text attributes of
111-
``end_indicator`` method. This defaults to
111+
``end_dialog_indicator`` method. This defaults to
112112
``(curses.A_BOLD, curses.A_BLINK)``.
113113
"""
114-
if self.end_indicator_char:
114+
if self.end_dialog_indicator_char:
115115
with TextAttributes(win, *text_attr):
116-
win.addch(self.end_indicator_pos_y,
117-
self.end_indicator_pos_x,
118-
self.end_indicator_char)
116+
win.addch(self.end_dialog_indicator_pos_y,
117+
self.end_dialog_indicator_pos_x,
118+
self.end_dialog_indicator_char)
119119

120120
def char_by_char(
121121
self,
@@ -249,7 +249,7 @@ def char_by_char(
249249
# Compensates for the space between words.
250250
offsetting_x += len(word) + 1
251251

252-
self._display_end_indicator(win)
252+
self._display_end_dialog_indicator(win)
253253
self.getkey(win)
254254

255255
def word_by_word(
@@ -321,6 +321,7 @@ def word_by_word(
321321
- Writing paragraph by paragraph.
322322
- Writing each line of the current paragraph, word by
323323
word.
324+
- Calling ``_display_end_dialog_indicator`` method.
324325
- Waits until a key contained in the class attribute
325326
``confirm_dialog_key`` was pressed before writing the
326327
following paragraph.
@@ -379,5 +380,5 @@ def word_by_word(
379380

380381
callback(*cargs)
381382

382-
self._display_end_indicator(win)
383+
self._display_end_dialog_indicator(win)
383384
self.getkey(win)

0 commit comments

Comments
 (0)