diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-04-11 03:54:46 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-04-11 03:54:46 +0000 |
| commit | 24ce4b91a62b02c40edb3a93da3ecbd9ee8e444d (patch) | |
| tree | d3ef689e0f94c13fbab65981fad485e0df90fc67 | |
| parent | 21c8744c923f2edaeaff075a58e5e26e57fb9776 (diff) | |
automatic import of python-pick
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-pick.spec | 262 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 264 insertions, 0 deletions
@@ -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 + +[](https://github.com/wong2/pick/actions/workflows/ci.yml) +[](https://pypi.python.org/pypi/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 | +| :--------------------: | :--------------------------: | +|  |  | + +## 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 + +[](https://github.com/wong2/pick/actions/workflows/ci.yml) +[](https://pypi.python.org/pypi/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 | +| :--------------------: | :--------------------------: | +|  |  | + +## 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 + +[](https://github.com/wong2/pick/actions/workflows/ci.yml) +[](https://pypi.python.org/pypi/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 | +| :--------------------: | :--------------------------: | +|  |  | + +## 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 @@ -0,0 +1 @@ +211f75b2a915c9d8c435962a28864b9d pick-2.2.0.tar.gz |
