Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@

# Visual-dialog

<p align="center">
<a href="#features">Features</a> •
<a href="#installation">Installation</a> •
Expand All @@ -10,14 +12,13 @@
</p>

<p align="center">
<img width="300" src="https://user-images.githubusercontent.com/59396366/100594532-188c6900-32fa-11eb-8372-4796f53b122f.png" alt="Visual-dialog">
<br>
Library to make easier dialog box in terminal.
<img width="400" src="https://user-images.githubusercontent.com/59396366/100594532-188c6900-32fa-11eb-8372-4796f53b122f.png" alt="Visual-dialog">
<br>
This library is still under development.
API can change.
A library to make easier dialog box in terminal.
</p>

This library is still under development. API can change.

## Features

📃 Automatic text scrolling.
Expand Down Expand Up @@ -46,7 +47,7 @@ python3 -m pip install git+git://github.com/Tim-ats-d/Visual-dialog --upgrade
```sh
git clone https://github.com/Tim-ats-d/Visual-dialog.git
cd Visual-dialog
pip install .
python3 -m pip install .
```

## Requirements
Expand Down
4 changes: 2 additions & 2 deletions examples/confrontation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# confrontation.py
# confrontation.py
#
A concrete example exploiting the possibilities of Visual-dialog.
# A concrete example exploiting the possibilities of Visual-dialog.

import curses

Expand Down
4 changes: 2 additions & 2 deletions examples/context.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# context.py
# context.py
#
# An example of how to use a text box as a context manager.
# An example of how to use a text box as a context manager.

import curses

Expand Down
4 changes: 2 additions & 2 deletions examples/monologue.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# monologue.py
# monologue.py
#
A simple example of how to use Visual-dialog.
# A simple example of how to use Visual-dialog.

import curses

Expand Down
4 changes: 2 additions & 2 deletions examples/text_attributes.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# text_attributes.py
# text_attributes.py
#
# An example showing the possibilities of text formatting.
# An example showing the possibilities of text formatting.

import curses

Expand Down
4 changes: 2 additions & 2 deletions examples/word.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# words.py
# words.py
#
An example of using the word_by_word method from text boxes.
# An example of using the word_by_word method from text boxes.

import curses

Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

from setuptools import find_packages, setup

from visualdialog import __author__, __version__
Expand Down
4 changes: 2 additions & 2 deletions tests/test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# test.py
# test.py
#
This file contains the tests used to debug the library.
# This file contains the tests used to debug the library.

import curses

Expand Down
1 change: 1 addition & 0 deletions visualdialog/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

"""
A library to make easier dialog box in terminal.
"""
Expand Down
21 changes: 2 additions & 19 deletions visualdialog/box.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
# box.py
#
# 2020 Timéo Arnouts <tim.arnouts@protonmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
# box.py
#
# 2020 Timéo Arnouts <tim.arnouts@protonmail.com>

__all__ = ["BaseTextBox"]

Expand Down
21 changes: 2 additions & 19 deletions visualdialog/choices.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
# choices.py
#
# 2020 Timéo Arnouts <tim.arnouts@protonmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
# choices.py
#
# 2020 Timéo Arnouts <tim.arnouts@protonmail.com>

import curses
from typing import Any, Dict, Tuple, Union
Expand Down
21 changes: 2 additions & 19 deletions visualdialog/dialog.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,6 @@
# dialog.py
#
# 2020 Timéo Arnouts <tim.arnouts@protonmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
# dialog.py
#
# 2020 Timéo Arnouts <tim.arnouts@protonmail.com>

__all__ = ["DialogBox"]

Expand Down
29 changes: 6 additions & 23 deletions visualdialog/utils.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,11 @@
# utils.py
#
# 2020 Timéo Arnouts <tim.arnouts@protonmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
# utils.py
#
# 2020 Timéo Arnouts <tim.arnouts@protonmail.com>

from contextlib import ContextDecorator
import _curses
from typing import (Generator, Iterable, List, NoReturn, Tuple, TypeVar,
Union)
Union)


CursesWindow = _curses.window
Expand All @@ -46,17 +29,17 @@ def _make_chunk(iterable: Union[Tuple, List],
:returns: Generator separated into ``chunk_length`` bundles.
"""
return (iterable[chunk:chunk + chunk_length]
for chunk in range(0, len(iterable), chunk_length))
for chunk in range(0, len(iterable), chunk_length))


class TextAttributes(ContextDecorator):
"""A context manager to manage ``curses`` text attributes.

:param win: ``curses`` window object for which the attributes will
be managed.
be managed.

:param attributes: Iterable of ``curses`` text attributes to activate
and desactivate.
and desactivate.
"""
def __init__(self,
win: CursesWindow,
Expand Down