Skip to content

Commit 4a8a286

Browse files
author
Tim-ats-d
committed
Removing an test in core.py, change delay default value in word_by_word to 0.15 second.
1 parent 61f89d7 commit 4a8a286

File tree

1 file changed

+4
-20
lines changed

1 file changed

+4
-20
lines changed

visualdialog/core.py

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def word_by_word(self, stdscr,
169169
text: str, colors_pair_nb: int,
170170
cut_char: str = " ",
171171
flash_screen: bool = False,
172-
delay: int = .05, random_delay: Tuple[int, int] = (0, 0),
172+
delay: int = .15, random_delay: Tuple[int, int] = (0, 0),
173173
callback: Callable = None,
174174
cargs=()):
175175
"""Writes the given text word by word at position at position self.pos_x;self.pos_y.
@@ -183,7 +183,7 @@ def word_by_word(self, stdscr,
183183
dialog.
184184
185185
The delay parameter affects the waited time between the writing of each word in seconds
186-
(set by default on 0.05 seconde).
186+
(set by default on 0.15 seconde).
187187
188188
The random_delay parameter affects time between the writing of each word in seconds where
189189
waited time is a number generated in the given interval (as a tuple).
@@ -243,27 +243,11 @@ def func(reply: str):
243243

244244
for reply in text:
245245
textbox.framing_box(stdscr)
246-
textbox.char_by_char(stdscr, reply, 2, cargs=(reply,), callback=func)
246+
textbox.word_by_word(stdscr, reply, 2, cargs=(reply,), callback=func)
247247

248248
textbox.getkey(stdscr)
249249
stdscr.clear()
250250

251-
def main2(stdscr):
252-
curses.curs_set(0)
253-
254-
curses.start_color()
255-
curses.init_pair(1, curses.COLOR_RED, curses.COLOR_BLACK)
256-
curses.init_pair(2, curses.COLOR_CYAN, curses.COLOR_BLACK)
257-
curses.init_pair(3, curses.COLOR_GREEN, curses.COLOR_BLACK)
258-
259-
with DialogBox(
260-
20, 15,
261-
40, 6,
262-
title="Test", title_colors_pair_nb=3,
263-
end_dialog_indicator="t") as e:
264-
265-
e.framing_box(stdscr)
266-
e.char_by_char(stdscr, "c'est le grand test", 2)
267251

268252
if __name__ == "__main__":
269-
curses.wrapper(main2)
253+
curses.wrapper(main)

0 commit comments

Comments
 (0)