diff options
author | Dan Langille <dvl@FreeBSD.org> | 2023-04-26 15:21:18 +0000 |
---|---|---|
committer | Dan Langille <dvl@FreeBSD.org> | 2023-04-26 15:21:18 +0000 |
commit | 2eaee51bf1827b7b70a22906c675489ae4c232d0 (patch) | |
tree | 25464a18a471dd811d2cacad7e8be6232c65eb58 | |
parent | 8048e04e01f6b5feaf8ef3512f2f77c45e8e1f50 (diff) | |
download | ports-2eaee51bf1827b7b70a22906c675489ae4c232d0.tar.gz ports-2eaee51bf1827b7b70a22906c675489ae4c232d0.zip |
devel/py-simple-term-menu: New port
Simple menus for interactive command line programs.
-rw-r--r-- | devel/Makefile | 1 | ||||
-rw-r--r-- | devel/py-simple-term-menu/Makefile | 19 | ||||
-rw-r--r-- | devel/py-simple-term-menu/distinfo | 3 | ||||
-rw-r--r-- | devel/py-simple-term-menu/pkg-descr | 24 |
4 files changed, 47 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile index 44bce3d4a10c..12c00f08c31a 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -5483,6 +5483,7 @@ SUBDIR += py-simplejson SUBDIR += py-simpleparse SUBDIR += py-simpletal + SUBDIR += py-simple-term-menu SUBDIR += py-simpy SUBDIR += py-single-version SUBDIR += py-sip diff --git a/devel/py-simple-term-menu/Makefile b/devel/py-simple-term-menu/Makefile new file mode 100644 index 000000000000..0e235a0375ed --- /dev/null +++ b/devel/py-simple-term-menu/Makefile @@ -0,0 +1,19 @@ +PORTNAME= simple-term-menu +PORTVERSION= 1.6.1 +CATEGORIES= devel +MASTER_SITES= CHEESESHOP +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= dvl@FreeBSD.org +COMMENT= Creates simple menus for interactive command line programs +WWW= https://github.com/IngoMeyer441/simple-term-menu + +LICENSE= MIT +LICENSE_FILE= ${WRKSRC}/LICENSE + +USES= python:3.5+ +USE_PYTHON= autoplist distutils + +NO_ARCH= yes + +.include <bsd.port.mk> diff --git a/devel/py-simple-term-menu/distinfo b/devel/py-simple-term-menu/distinfo new file mode 100644 index 000000000000..52f5a9192485 --- /dev/null +++ b/devel/py-simple-term-menu/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1679495483 +SHA256 (simple-term-menu-1.6.1.tar.gz) = 368b4158d1749b868552fb6c054b8301785086c71a7253dac8404cc3cb2d30e8 +SIZE (simple-term-menu-1.6.1.tar.gz) = 35179 diff --git a/devel/py-simple-term-menu/pkg-descr b/devel/py-simple-term-menu/pkg-descr new file mode 100644 index 000000000000..1bff3d7ea51f --- /dev/null +++ b/devel/py-simple-term-menu/pkg-descr @@ -0,0 +1,24 @@ +simple-term-menu creates simple menus for interactive command line programs. It +can be used to offer a choice of different options to the user. Menu entries +can be selected with the arrow, j/k, or emacs (C-n/C-p) keys. The module uses +the terminfo database to detect terminal features automatically and disables +styles that are not available. Currently, Linux and macOS are supported. + +Usage: Create a menu with the default style + +Create an instance of the class TerminalMenu and pass the menu entries as a +list of strings to the constructor. Call the show method to output the menu +and wait for keyboard input: + +#!/usr/bin/env python3 + +from simple_term_menu import TerminalMenu + +def main(): + options = ["entry 1", "entry 2", "entry 3"] + terminal_menu = TerminalMenu(options) + menu_entry_index = terminal_menu.show() + print(f"You have selected {options[menu_entry_index]}!") + +if __name__ == "__main__": + main() |