Skip to content

Commit 3e6574c

Browse files
committed
Many fix in doc, correction of warnings when documentation is generated.
1 parent 777e872 commit 3e6574c

File tree

8 files changed

+35
-23
lines changed

8 files changed

+35
-23
lines changed
File renamed without changes.

doc/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@
5555
"display_version": True
5656
}
5757

58-
html_logo = "images/visual-dialog.png"
58+
html_logo = "_static/visual-dialog.png"
5959

60-
latex_logo = "images/visual-dialog.png"
60+
latex_logo = "_static/visual-dialog.png"
6161

6262
latex_elements = {
6363
"pointsize": "12pt"

doc/source/images/demo.gif

-134 KB
Binary file not shown.

doc/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Welcome to Visual-dialog's documentation
99
**Visual-dialog** is a **Python library** that allows you to make dialog box in a terminal easily.
1010
**Visual-dialog** uses ``curses`` to display text in terminals.
1111

12-
.. image:: ./images/demo.png
12+
.. image:: _static/visual-dialog.png
1313
:align: center
1414

1515
**Features:**

doc/source/visualdialog.rst

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,26 @@
1-
Text box
2-
========
1+
Text boxes
2+
==========
33

44
.. IMPORTANT::
55
**Visual-dialog** contains two **modules**: ``visualdialog.box`` and ``visualdialog.dialog``.
66
These two **modules** are both imported when you import ``visualdialog``.
77

88
Two **classes** are defined in these modules but only ``DialogBox`` is destined to be instantiated.
99

10+
TextBox
11+
-------
12+
1013
.. autoclass:: visualdialog.box.TextBox
1114
:members:
15+
:undoc-members:
16+
:private-members:
17+
18+
DialogBox
19+
---------
20+
1221
.. autoclass:: visualdialog.dialog.DialogBox
22+
:special-members:
23+
:undoc-members:
1324
:members:
14-
:show-inheritance:
25+
:private-members:
26+

visualdialog/box.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -84,13 +84,13 @@ class TextBox:
8484
Dialog box title text attributes. It should be a single curses
8585
text attribute or a tuple of curses text attribute. This
8686
defaults to ``curses.A_BOLD``.
87-
:type title_text_attr: Optional[Union[CursesTextAttributesConstants,Tuple[CursesTextAttributesConstants],List[CursesTextAttributesConstants]]]
87+
:type title_text_attr: Optional[Union[CursesTextAttributesConstants,tuple[CursesTextAttributesConstants],list[CursesTextAttributesConstants]]]
8888
8989
:param downtime_chars:
9090
List of characters that will trigger a ``downtime_chars_delay``
9191
time second between the writing of each character.
9292
This defaults to ``(",", ".", ":", ";", "!", "?")``.
93-
:type downtime_chars: Optional[Union[Tuple[str],List[str]]]
93+
:type downtime_chars: Optional[Union[tuple[str],list[str]]]
9494
9595
:param downtime_chars_delay:
9696
Waiting time in seconds after writing a character contained in
@@ -151,7 +151,7 @@ def position(self) -> Tuple[int, int]:
151151
"""Returns a tuple contains x;y position of ``TextBox``.
152152
153153
:returns: x;y position of ``TextBox``.
154-
:rtype: Tuple[int, int]
154+
:rtype: tuple[int, int]
155155
"""
156156
return self.text_pos_x - 2, self.text_pos_y - 3
157157

@@ -160,7 +160,7 @@ def dimensions(self) -> Tuple[int, int]:
160160
"""Returns a tuple contains dimensions of ``TextBox``.
161161
162162
:returns: Length and width of ``TextBox``.
163-
:rtype: Tuple[int, int]
163+
:rtype: tuple[int, int]
164164
"""
165165
return self.length, self.width
166166

visualdialog/dialog.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@
3535

3636
class DialogBox(TextBox):
3737
"""This class provides methods and attributs to manage a dialog box.
38-
39-
Keyword arguments correspond to the instance attributes of ``TextBox``,
40-
documented below.
4138
4239
:param end_dialog_indicator: Character that will be displayed in the
4340
lower right corner the character once all the characters have
@@ -46,6 +43,9 @@ class DialogBox(TextBox):
4643
to ``"►"``.
4744
:type end_dialog_indicator: str
4845
46+
:key kwargs: Keyword arguments correspond to the instance attributes of
47+
``TextBox``.
48+
4949
.. NOTE::
5050
This class inherits all the methods and attributes of ``TextBox``.
5151
@@ -89,7 +89,7 @@ def _display_end_dialog_indicator(
8989
:param text_attr: Text attributes of
9090
``end_dialog_indicator`` method. This defaults to
9191
``(curses.A_BOLD, curses.A_BLINK)``.
92-
:type text_attr: Optional[Union[Tuple[CursesTextAttributesConstants],List[CursesTextAttributesConstants]]]
92+
:type text_attr: Optional[Union[tuple[CursesTextAttributesConstants],list[CursesTextAttributesConstants]]]
9393
"""
9494
if self.end_dialog_indicator_char:
9595
with TextAttributes(stdscr, *text_attr):
@@ -134,10 +134,10 @@ def char_by_char(
134134
:param text_attr: Dialog box curses text attributes. It should
135135
be a single curses text attribute or a tuple of curses text
136136
attribute. This defaults an empty tuple.
137-
:type text_attr: Optional[Union[CursesTextAttributesConstants,Tuple[CursesTextAttributesConstants],List[CursesTextAttributesConstants]]]
137+
:type text_attr: Optional[Union[CursesTextAttributesConstants,tuple[CursesTextAttributesConstants],list[CursesTextAttributesConstants]]]
138138
139139
:param words_attr: This defaults to an empty dictionary.
140-
:type words_atttr: Union[Dict[Tuple[str],CursesTextAttributesConstants],Dict[Tuple[str],Tuple[CursesTextAttributesConstants]]]
140+
:type words_atttr: Union[Dict[tuple[str],CursesTextAttributesConstants],Dict[tuple[str],tuple[CursesTextAttributesConstants]]]
141141
142142
:param flash_screen: Allows or not to flash screen with a short
143143
light effect done before writing the first character by
@@ -153,7 +153,7 @@ def char_by_char(
153153
character in seconds where time waited is a random number
154154
generated in ``random_delay`` interval. This defaults to
155155
``(0, 0)``.
156-
:type random_delay: Optional[Tuple[float, flot],List[float, float]]
156+
:type random_delay: Optional[tuple[float, flot],list[float, float]]
157157
158158
:param callback: Callable called after writing a character and
159159
the delay time has elapsed. This defaults to a lambda which
@@ -162,7 +162,7 @@ def char_by_char(
162162
163163
:param cargs: All the arguments that will be passed to callback.
164164
This defaults to an empty tuple.
165-
:type cargs: Optional[Union[Tuple[Any],List[Any]]]
165+
:type cargs: Optional[Union[tuple[Any],list[Any]]]
166166
167167
.. NOTE::
168168
Method flow:
@@ -280,10 +280,10 @@ def word_by_word(
280280
:param text_attr: Dialog box curses text attributes. It should
281281
be a single curses text attribute or a tuple of curses text
282282
attribute. This defaults an empty tuple.
283-
:type text_attr: Optional[Union[CursesTextAttributesConstants,Tuple[CursesTextAttributesConstants],List[CursesTextAttributesConstants]]]
283+
:type text_attr: Optional[Union[CursesTextAttributesConstants,tuple[CursesTextAttributesConstants],list[CursesTextAttributesConstants]]]
284284
285285
:param words_attr: This defaults to an empty dictionary.
286-
:type words_atttr: Union[Dict[Tuple[str],CursesTextAttributesConstants],Dict[Tuple[str],Tuple[CursesTextAttributesConstants]]]
286+
:type words_atttr: Union[Dict[tuple[str],CursesTextAttributesConstants],Dict[tuple[str],tuple[CursesTextAttributesConstants]]]
287287
288288
:param cut_char: The delimiter according which to split the text
289289
in word. This defaults to ``" "``.
@@ -303,7 +303,7 @@ def word_by_word(
303303
word in seconds where time waited is a random number
304304
generated in ``random_delay`` interval. This defaults to
305305
``(0, 0)``.
306-
:type random_delay: Optional[Tuple[float, float],List[float, float]]
306+
:type random_delay: Optional[tuple[float, float],list[float, float]]
307307
308308
:param callback: Callable called after writing a word and the
309309
delay time has elapsed. This defaults to a lambda which do
@@ -312,7 +312,7 @@ def word_by_word(
312312
313313
:param cargs: All the arguments that will be passed to callback.
314314
This defaults to an empty tuple.
315-
:type cargs: Optional[Union[Tuple[Any],List[Any]]]
315+
:type cargs: Optional[Union[tuple[Any],list[Any]]]
316316
317317
.. NOTE::
318318
Method flow:

visualdialog/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class TextAttributes:
4949
managed.
5050
5151
:param attributes: List of attributes to activate and desactivate.
52-
:type attributes: Union[Tuple[CursesTextAttributesConstants],List[CursesTextAttributesConstants]]
52+
:type attributes: Union[tuple[CursesTextAttributesConstants],list[CursesTextAttributesConstants]]
5353
"""
5454
def __init__(self,
5555
stdscr,

0 commit comments

Comments
 (0)