summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--python-pick.spec262
-rw-r--r--sources1
3 files changed, 264 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..8dea1b0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/pick-2.2.0.tar.gz
diff --git a/python-pick.spec b/python-pick.spec
new file mode 100644
index 0000000..bbb77b8
--- /dev/null
+++ b/python-pick.spec
@@ -0,0 +1,262 @@
+%global _empty_manifest_terminate_build 0
+Name: python-pick
+Version: 2.2.0
+Release: 1
+Summary: Pick an option in the terminal with a simple GUI
+License: MIT
+URL: https://github.com/wong2/pick
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/5f/08/45f5bda20b9ad318c1cbeb911e9995e7357d4ae93cbfaccc8f2e40e96ec4/pick-2.2.0.tar.gz
+BuildArch: noarch
+
+Requires: python3-windows-curses
+
+%description
+# pick
+
+[![image](https://github.com/wong2/pick/actions/workflows/ci.yml/badge.svg)](https://github.com/wong2/pick/actions/workflows/ci.yml)
+[![PyPI](https://img.shields.io/pypi/v/pick.svg)](https://pypi.python.org/pypi/pick)
+[![PyPI](https://img.shields.io/pypi/dm/pick)](https://pypi.python.org/pypi/pick)
+
+**pick** is a small python library to help you create curses based
+interactive selection list in the terminal.
+
+| Basic | Multiselect |
+| :--------------------: | :--------------------------: |
+| ![](example/basic.gif) | ![](example/multiselect.gif) |
+
+## Installation
+
+ $ pip install pick
+
+## Usage
+
+**pick** comes with a simple api:
+
+ >>> from pick import pick
+
+ >>> title = 'Please choose your favorite programming language: '
+ >>> options = ['Java', 'JavaScript', 'Python', 'PHP', 'C++', 'Erlang', 'Haskell']
+ >>> option, index = pick(options, title)
+ >>> print(option)
+ >>> print(index)
+
+**outputs**:
+
+ >>> C++
+ >>> 4
+
+**pick** multiselect example:
+
+ >>> from pick import pick
+
+ >>> title = 'Please choose your favorite programming language (press SPACE to mark, ENTER to continue): '
+ >>> options = ['Java', 'JavaScript', 'Python', 'PHP', 'C++', 'Erlang', 'Haskell']
+ >>> selected = pick(options, title, multiselect=True, min_selection_count=1)
+ >>> print(selected)
+
+**outputs**:
+
+ >>> [('Java', 0), ('C++', 4)]
+
+## Options
+
+- `options`: a list of options to choose from
+- `title`: (optional) a title above options list
+- `indicator`: (optional) custom the selection indicator, defaults to `*`
+- `default_index`: (optional) set this if the default selected option
+ is not the first one
+- `multiselect`: (optional), if set to True its possible to select
+ multiple items by hitting SPACE
+- `min_selection_count`: (optional) for multi select feature to
+ dictate a minimum of selected items before continuing
+- `screen`: (optional), if you are using `pick` within an existing curses application set this to your existing `screen` object. It is assumed this has initialised in the standard way (e.g. via `curses.wrapper()`, or `curses.noecho(); curses.cbreak(); screen.kepad(True)`)
+
+## Community Projects
+
+[pickpack](https://github.com/anafvana/pickpack): A fork of `pick` to select tree data.
+
+
+%package -n python3-pick
+Summary: Pick an option in the terminal with a simple GUI
+Provides: python-pick
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-pick
+# pick
+
+[![image](https://github.com/wong2/pick/actions/workflows/ci.yml/badge.svg)](https://github.com/wong2/pick/actions/workflows/ci.yml)
+[![PyPI](https://img.shields.io/pypi/v/pick.svg)](https://pypi.python.org/pypi/pick)
+[![PyPI](https://img.shields.io/pypi/dm/pick)](https://pypi.python.org/pypi/pick)
+
+**pick** is a small python library to help you create curses based
+interactive selection list in the terminal.
+
+| Basic | Multiselect |
+| :--------------------: | :--------------------------: |
+| ![](example/basic.gif) | ![](example/multiselect.gif) |
+
+## Installation
+
+ $ pip install pick
+
+## Usage
+
+**pick** comes with a simple api:
+
+ >>> from pick import pick
+
+ >>> title = 'Please choose your favorite programming language: '
+ >>> options = ['Java', 'JavaScript', 'Python', 'PHP', 'C++', 'Erlang', 'Haskell']
+ >>> option, index = pick(options, title)
+ >>> print(option)
+ >>> print(index)
+
+**outputs**:
+
+ >>> C++
+ >>> 4
+
+**pick** multiselect example:
+
+ >>> from pick import pick
+
+ >>> title = 'Please choose your favorite programming language (press SPACE to mark, ENTER to continue): '
+ >>> options = ['Java', 'JavaScript', 'Python', 'PHP', 'C++', 'Erlang', 'Haskell']
+ >>> selected = pick(options, title, multiselect=True, min_selection_count=1)
+ >>> print(selected)
+
+**outputs**:
+
+ >>> [('Java', 0), ('C++', 4)]
+
+## Options
+
+- `options`: a list of options to choose from
+- `title`: (optional) a title above options list
+- `indicator`: (optional) custom the selection indicator, defaults to `*`
+- `default_index`: (optional) set this if the default selected option
+ is not the first one
+- `multiselect`: (optional), if set to True its possible to select
+ multiple items by hitting SPACE
+- `min_selection_count`: (optional) for multi select feature to
+ dictate a minimum of selected items before continuing
+- `screen`: (optional), if you are using `pick` within an existing curses application set this to your existing `screen` object. It is assumed this has initialised in the standard way (e.g. via `curses.wrapper()`, or `curses.noecho(); curses.cbreak(); screen.kepad(True)`)
+
+## Community Projects
+
+[pickpack](https://github.com/anafvana/pickpack): A fork of `pick` to select tree data.
+
+
+%package help
+Summary: Development documents and examples for pick
+Provides: python3-pick-doc
+%description help
+# pick
+
+[![image](https://github.com/wong2/pick/actions/workflows/ci.yml/badge.svg)](https://github.com/wong2/pick/actions/workflows/ci.yml)
+[![PyPI](https://img.shields.io/pypi/v/pick.svg)](https://pypi.python.org/pypi/pick)
+[![PyPI](https://img.shields.io/pypi/dm/pick)](https://pypi.python.org/pypi/pick)
+
+**pick** is a small python library to help you create curses based
+interactive selection list in the terminal.
+
+| Basic | Multiselect |
+| :--------------------: | :--------------------------: |
+| ![](example/basic.gif) | ![](example/multiselect.gif) |
+
+## Installation
+
+ $ pip install pick
+
+## Usage
+
+**pick** comes with a simple api:
+
+ >>> from pick import pick
+
+ >>> title = 'Please choose your favorite programming language: '
+ >>> options = ['Java', 'JavaScript', 'Python', 'PHP', 'C++', 'Erlang', 'Haskell']
+ >>> option, index = pick(options, title)
+ >>> print(option)
+ >>> print(index)
+
+**outputs**:
+
+ >>> C++
+ >>> 4
+
+**pick** multiselect example:
+
+ >>> from pick import pick
+
+ >>> title = 'Please choose your favorite programming language (press SPACE to mark, ENTER to continue): '
+ >>> options = ['Java', 'JavaScript', 'Python', 'PHP', 'C++', 'Erlang', 'Haskell']
+ >>> selected = pick(options, title, multiselect=True, min_selection_count=1)
+ >>> print(selected)
+
+**outputs**:
+
+ >>> [('Java', 0), ('C++', 4)]
+
+## Options
+
+- `options`: a list of options to choose from
+- `title`: (optional) a title above options list
+- `indicator`: (optional) custom the selection indicator, defaults to `*`
+- `default_index`: (optional) set this if the default selected option
+ is not the first one
+- `multiselect`: (optional), if set to True its possible to select
+ multiple items by hitting SPACE
+- `min_selection_count`: (optional) for multi select feature to
+ dictate a minimum of selected items before continuing
+- `screen`: (optional), if you are using `pick` within an existing curses application set this to your existing `screen` object. It is assumed this has initialised in the standard way (e.g. via `curses.wrapper()`, or `curses.noecho(); curses.cbreak(); screen.kepad(True)`)
+
+## Community Projects
+
+[pickpack](https://github.com/anafvana/pickpack): A fork of `pick` to select tree data.
+
+
+%prep
+%autosetup -n pick-2.2.0
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-pick -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Tue Apr 11 2023 Python_Bot <Python_Bot@openeuler.org> - 2.2.0-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..bfb8718
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+211f75b2a915c9d8c435962a28864b9d pick-2.2.0.tar.gz