Skip to content

Commit 379ba30

Browse files
committed
ADD: assets for README.md
UPDATE: setup README.md
1 parent 2851f3d commit 379ba30

File tree

12 files changed

+37
-26
lines changed

12 files changed

+37
-26
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,11 @@ jobs:
2121
uses: actions/setup-python@v2
2222
with:
2323
python-version: ${{ matrix.python-version }}
24-
- name: Install dependencies (Unix like Os)
25-
if: matrix.os != 'windows-latest'
24+
- name: Install dependencies
2625
run: |
2726
python -m pip install --upgrade pip
27+
pip install -r requirements.txt
2828
pip install pylint pycodestyle
29-
- name: Install dependencies(Only windows)
30-
if: matrix.os == 'windows-latest'
31-
run: |
32-
python -m pip install --upgrade pip
33-
pip install windows-curses pycodestyle
3429
- name: Tests
3530
run: python -m unittest tests/creation.py
3631
- name: Pylint (Unix like Os)

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extension-pkg-whitelist=
1717
fail-on=
1818

1919
# Specify a score threshold to be exceeded before program exits with error.
20-
fail-under=10.0
20+
fail-under=8.0
2121

2222
# Files or directories to be skipped. They should be base names, not paths.
2323
ignore=CVS, venv

README.md

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
# PyConsoleMenu
22
![Language](https://img.shields.io/badge/Language-Python3.7+-blue.svg?style=flat)
3-
[![BUILD-STATUS](https://github.com/BaggerFast/Snake/workflows/CI/badge.svg)](https://github.com/BaggerFast/Snake/actions?query=workflow%3Aci)
3+
[![BUILD-STATUS](https://github.com/BaggerFast/PyConsoleMenu/workflows/CI/badge.svg)](https://github.com/BaggerFast/PyConsoleMenu/actions)
44

55
A simple Python menu in the terminal using curses.
66
Ideal for people who want to quickly make a menu without writing their own complicated crutches.
7-
Includes: SelectorMenu, MultipleSelectorMenu, FunctionalMenu
7+
Includes: SelectorMenu, MultipleSelectorMenu, FunctionalMenu.
8+
9+
## Preview
10+
![Selector](https://github.com/BaggerFast/PyConsoleMenu/tree/main/assets/selector.gif)
11+
12+
[See other](https://github.com/BaggerFast/PyConsoleMenu/tree/main/assets)
813

914
## Installation 💾
1015
- using pip
@@ -14,12 +19,17 @@ $ pip install py_menu_console
1419

1520
- using GitHub *(требуется [git](https://git-scm.com/downloads))*
1621
```
17-
$ git clone https://github.com/BaggerFast/PyConsoleMemu
22+
$ git clone https://github.com/BaggerFast/PyConsoleMenu
1823
$ cd PyConsoleMemu
1924
$ pip install -r requirements.txt
2025
```
2126

22-
## Usage example ⌨️
27+
## Additionally ⌨️
28+
- Docs in code
29+
- Type hints
30+
31+
32+
## Usage example 👨‍💻
2333
```py
2434
from py_menu_console import MultiSelectorMenu, FunctionalOption, SelectorMenu, FunctionalMenu
2535

@@ -38,8 +48,8 @@ def selector():
3848

3949
def functional():
4050
data = [
41-
FunctionalOption('Cheburashka', lambda _: print('I am a Parrot')),
42-
FunctionalOption('Parrot', lambda _: print('I am a Cheburashka')),
51+
FunctionalOption('Cheburashka', lambda: print('I am a Parrot')),
52+
FunctionalOption('Parrot', lambda: print('I am a Cheburashka')),
4353
]
4454
menu = FunctionalMenu(data, title='Functional')
4555
ans = menu.input()

assets/functional.gif

425 KB
Loading

assets/multi_selector.gif

748 KB
Loading

assets/selector.gif

571 KB
Loading

examples/.gitkeep

Whitespace-only changes.

examples/example.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ def selector():
1515

1616
def functional():
1717
data = [
18-
FunctionalOption('Cheburashka', lambda _: print('I am a Parrot')),
19-
FunctionalOption('Parrot', lambda _: print('I am a Cheburashka')),
18+
FunctionalOption('Cheburashka', lambda: print('I am a Parrot')),
19+
FunctionalOption('Parrot', lambda: print('I am a Cheburashka')),
2020
]
2121
menu = FunctionalMenu(data, title='Functional')
2222
ans = menu.input()

py_menu_console/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
from .menu import MultiSelectorMenu, FunctionalMenu, SelectorMenu
2-
from .misc import FunctionalOption, Option
2+
from .misc import FunctionalOption, Option

py_menu_console/base.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class BaseMenu(ABC):
1212
:param options: a list of options to choose from
1313
:param title: (optional) a title above options list
1414
:param default_index: (optional) set this if the default selected option is not the first one
15-
:param indicator: (optional) customize the selection indicator
15+
:param indicator: (optional) customize the selection indicator.
1616
"""
1717

1818
def __init__(self, options: List[str], title: str = '', default_index: int = 0, indicator: str = "->") -> None:
@@ -100,6 +100,9 @@ def _draw_options(self, screen, max_x: int) -> None:
100100
# region Public
101101

102102
def input(self) -> Any:
103+
"""
104+
Return input info from menu
105+
"""
103106
return wrapper(self._run_loop)
104107

105108
# endregion

0 commit comments

Comments
 (0)