summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-06-20 09:17:16 +0000
committerCoprDistGit <infra@openeuler.org>2023-06-20 09:17:16 +0000
commit439841070ef899e73a43c87cc81c593ff5de6951 (patch)
treeacf5a54cf2f5095fd4a9444329b027c1cd53e548
parenta3ebfe77b84131ffc20f54f9265068bd80b7884d (diff)
automatic import of python-interrogatioopeneuler20.03
-rw-r--r--.gitignore1
-rw-r--r--python-interrogatio.spec677
-rw-r--r--sources1
3 files changed, 679 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..5894ad9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/interrogatio-2.3.1.tar.gz
diff --git a/python-interrogatio.spec b/python-interrogatio.spec
new file mode 100644
index 0000000..b0bd2a1
--- /dev/null
+++ b/python-interrogatio.spec
@@ -0,0 +1,677 @@
+%global _empty_manifest_terminate_build 0
+Name: python-interrogatio
+Version: 2.3.1
+Release: 1
+Summary: Prompting library for terminals.
+License: BSD-3-Clause
+URL: https://github.com/ffaraone/interrogatio
+Source0: https://mirrors.aliyun.com/pypi/web/packages/a9/d0/71bcff650e74354d3c10c4e15bf8dd97daa3b4ff9e73bb14285346225320/interrogatio-2.3.1.tar.gz
+BuildArch: noarch
+
+Requires: python3-prompt-toolkit
+Requires: python3-PyYAML
+Requires: python3-validators
+Requires: python3-pytz
+Requires: python3-tzlocal
+
+%description
+# interrogatio
+
+![Python versions](https://img.shields.io/pypi/pyversions/interrogatio.svg) [![PyPi Status](https://img.shields.io/pypi/v/interrogatio.svg)](https://pypi.org/project/interrogatio/) ![Read the Docs](https://img.shields.io/readthedocs/interrogatio) [![Build Status](https://img.shields.io/github/workflow/status/ffaraone/interrogatio/Build%20interrogatio)](https://github.com/ffaraone/interrogatio/actions) [![codecov](https://codecov.io/gh/ffaraone/interrogatio/branch/master/graph/badge.svg)](https://codecov.io/gh/ffaraone/interrogatio)
+
+
+A python library to prompt users for inputs in a terminal application.
+
+
+## What is interrogatio
+
+`interrogatio` is a python 3.8+ library based on the [python-prompt-toolkit](https://github.com/prompt-toolkit/python-prompt-toolkit) and inspired by [PyInquirer](https://github.com/CITGuru/PyInquirer/) that help CLI developers to ask users for inputs.
+
+Questions can be rendered onto the terminal prompt or as curses-like dialogs.
+
+
+## Documentation
+
+[`interrogatio` documentation](https://interrogatio.readthedocs.io/en/latest/) is hosted on _Read the Docs_.
+
+
+
+## Getting started
+
+
+### Requirements
+
+`interrogatio` depends on the python-prompt-toolkit library and its dependencies.
+
+### Installation
+
+
+#### Using pip
+
+
+```
+$ pip install interrogatio
+```
+
+
+#### Extra dependencies
+
+If you want to use the shell command with yml files you can install the yml dependency:
+
+```
+$ pip install interrogatio[yml]
+```
+
+
+### Basic usage
+
+`interrogatio` needs a list of questions to prompt the user for answers.
+
+Each question is a python dictionary with at least the following keys:
+
+* **name**: it has to be unique within the list of questions. It represents the variable name;
+* **type**: the type of question;
+* **message**: the text of the prompt.
+
+Optionally you should specify:
+
+* a **default**: a default value;
+* a **validators**: a list of children of Validator class
+* a **values**: a list of tuples (value, label) to provide a list of choices
+ for the ``selectone`` or ``selectmany`` question types.
+
+
+`interrogatio` can run into two modes: dialog and prompt.
+
+#### Dialog mode
+
+![Dialog mode showcase](docs/showcase/dialogus.gif)
+
+```
+from interrogatio import dialogus
+
+questions = [
+ {
+ 'name': 'name',
+ 'type': 'input',
+ 'message': "What's your name ?",
+ 'description': 'Please enter your full name. This field is required.',
+ 'validators': [{'name': 'required'}],
+ },
+ {
+ 'name': 'birth_date',
+ 'type': 'date',
+ 'message': "What's your birth date ?",
+ 'description': 'Enter your birth date.',
+ },
+ {
+ 'name': 'nationality',
+ 'type': 'selectone',
+ 'message': "What's your nationality ?",
+ 'description': 'Please choose one from the list.',
+ 'validators': [{'name': 'required'}],
+ 'values': [
+ ('IT', 'Italian'),
+ ('ES', 'Spanish'),
+ ('US', 'American'),
+ ('UK', 'English'),
+ ],
+ },
+ {
+ 'name': 'languages',
+ 'type': 'selectmany',
+ 'message': "What are your favorite programming languages ?",
+ 'description': 'Please choose your favorites from the list.',
+ 'values': [
+ ('py', 'Python'),
+ ('rb', 'Ruby'),
+ ('js', 'Javascript'),
+ ('go', 'Golang'),
+ ('rs', 'Rust'),
+ ('c', 'C'),
+ ('cpp', 'C++'),
+ ('java', 'Java'),
+ ],
+ },
+]
+
+intro = """<blue>Welcome to <b><i>interrogatio 2.0</i></b>!
+
+This is the second major release of interrogatio with nice improvements.</blue>
+
+<b>What's new</b>
+<b>----------</b>
+
+* Curses-like dialog experience had been completely rewritten.
+* New questions handlers for dates, date ranges and masked inputs.
+* Validators are now based on the <u>validators</u> library.
+"""
+
+
+answers = dialogus(questions, 'interrogatio showcase', intro=intro, summary=True)
+```
+
+#### Prompt mode
+
+![Prompt mode showcase](docs/showcase/interrogatio.gif)
+
+```
+from interrogatio import interrogatio
+
+questions = [
+ {
+ 'name': 'name',
+ 'type': 'input',
+ 'message': "What's your name ?",
+ 'description': 'Please enter your full name. This field is required.',
+ 'validators': [{'name': 'required'}],
+ },
+ {
+ 'name': 'birth_date',
+ 'type': 'date',
+ 'message': "What's your birth date ?",
+ 'description': 'Enter your birth date.',
+ },
+ {
+ 'name': 'nationality',
+ 'type': 'selectone',
+ 'message': "What's your nationality ?",
+ 'description': 'Please choose one from the list.',
+ 'validators': [{'name': 'required'}],
+ 'values': [
+ ('IT', 'Italian'),
+ ('ES', 'Spanish'),
+ ('US', 'American'),
+ ('UK', 'English'),
+ ],
+ },
+ {
+ 'name': 'languages',
+ 'type': 'selectmany',
+ 'message': "What are your favorite programming languages ?",
+ 'description': 'Please choose your favorites from the list.',
+ 'values': [
+ ('py', 'Python'),
+ ('rb', 'Ruby'),
+ ('js', 'Javascript'),
+ ('go', 'Golang'),
+ ('rs', 'Rust'),
+ ('c', 'C'),
+ ('cpp', 'C++'),
+ ('java', 'Java'),
+ ],
+ },
+]
+
+
+answers = interrogatio(questions)
+```
+
+### Contributing
+
+If you want to contribute to the project, you can submit bugs, feature requests or fork the github repository and submit your pull request.
+
+
+### License
+
+`interrogatio` is released under the [BSD 3-Clause "New" or "Revised" License](https://opensource.org/licenses/BSD-3-Clause>).
+
+
+%package -n python3-interrogatio
+Summary: Prompting library for terminals.
+Provides: python-interrogatio
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-interrogatio
+# interrogatio
+
+![Python versions](https://img.shields.io/pypi/pyversions/interrogatio.svg) [![PyPi Status](https://img.shields.io/pypi/v/interrogatio.svg)](https://pypi.org/project/interrogatio/) ![Read the Docs](https://img.shields.io/readthedocs/interrogatio) [![Build Status](https://img.shields.io/github/workflow/status/ffaraone/interrogatio/Build%20interrogatio)](https://github.com/ffaraone/interrogatio/actions) [![codecov](https://codecov.io/gh/ffaraone/interrogatio/branch/master/graph/badge.svg)](https://codecov.io/gh/ffaraone/interrogatio)
+
+
+A python library to prompt users for inputs in a terminal application.
+
+
+## What is interrogatio
+
+`interrogatio` is a python 3.8+ library based on the [python-prompt-toolkit](https://github.com/prompt-toolkit/python-prompt-toolkit) and inspired by [PyInquirer](https://github.com/CITGuru/PyInquirer/) that help CLI developers to ask users for inputs.
+
+Questions can be rendered onto the terminal prompt or as curses-like dialogs.
+
+
+## Documentation
+
+[`interrogatio` documentation](https://interrogatio.readthedocs.io/en/latest/) is hosted on _Read the Docs_.
+
+
+
+## Getting started
+
+
+### Requirements
+
+`interrogatio` depends on the python-prompt-toolkit library and its dependencies.
+
+### Installation
+
+
+#### Using pip
+
+
+```
+$ pip install interrogatio
+```
+
+
+#### Extra dependencies
+
+If you want to use the shell command with yml files you can install the yml dependency:
+
+```
+$ pip install interrogatio[yml]
+```
+
+
+### Basic usage
+
+`interrogatio` needs a list of questions to prompt the user for answers.
+
+Each question is a python dictionary with at least the following keys:
+
+* **name**: it has to be unique within the list of questions. It represents the variable name;
+* **type**: the type of question;
+* **message**: the text of the prompt.
+
+Optionally you should specify:
+
+* a **default**: a default value;
+* a **validators**: a list of children of Validator class
+* a **values**: a list of tuples (value, label) to provide a list of choices
+ for the ``selectone`` or ``selectmany`` question types.
+
+
+`interrogatio` can run into two modes: dialog and prompt.
+
+#### Dialog mode
+
+![Dialog mode showcase](docs/showcase/dialogus.gif)
+
+```
+from interrogatio import dialogus
+
+questions = [
+ {
+ 'name': 'name',
+ 'type': 'input',
+ 'message': "What's your name ?",
+ 'description': 'Please enter your full name. This field is required.',
+ 'validators': [{'name': 'required'}],
+ },
+ {
+ 'name': 'birth_date',
+ 'type': 'date',
+ 'message': "What's your birth date ?",
+ 'description': 'Enter your birth date.',
+ },
+ {
+ 'name': 'nationality',
+ 'type': 'selectone',
+ 'message': "What's your nationality ?",
+ 'description': 'Please choose one from the list.',
+ 'validators': [{'name': 'required'}],
+ 'values': [
+ ('IT', 'Italian'),
+ ('ES', 'Spanish'),
+ ('US', 'American'),
+ ('UK', 'English'),
+ ],
+ },
+ {
+ 'name': 'languages',
+ 'type': 'selectmany',
+ 'message': "What are your favorite programming languages ?",
+ 'description': 'Please choose your favorites from the list.',
+ 'values': [
+ ('py', 'Python'),
+ ('rb', 'Ruby'),
+ ('js', 'Javascript'),
+ ('go', 'Golang'),
+ ('rs', 'Rust'),
+ ('c', 'C'),
+ ('cpp', 'C++'),
+ ('java', 'Java'),
+ ],
+ },
+]
+
+intro = """<blue>Welcome to <b><i>interrogatio 2.0</i></b>!
+
+This is the second major release of interrogatio with nice improvements.</blue>
+
+<b>What's new</b>
+<b>----------</b>
+
+* Curses-like dialog experience had been completely rewritten.
+* New questions handlers for dates, date ranges and masked inputs.
+* Validators are now based on the <u>validators</u> library.
+"""
+
+
+answers = dialogus(questions, 'interrogatio showcase', intro=intro, summary=True)
+```
+
+#### Prompt mode
+
+![Prompt mode showcase](docs/showcase/interrogatio.gif)
+
+```
+from interrogatio import interrogatio
+
+questions = [
+ {
+ 'name': 'name',
+ 'type': 'input',
+ 'message': "What's your name ?",
+ 'description': 'Please enter your full name. This field is required.',
+ 'validators': [{'name': 'required'}],
+ },
+ {
+ 'name': 'birth_date',
+ 'type': 'date',
+ 'message': "What's your birth date ?",
+ 'description': 'Enter your birth date.',
+ },
+ {
+ 'name': 'nationality',
+ 'type': 'selectone',
+ 'message': "What's your nationality ?",
+ 'description': 'Please choose one from the list.',
+ 'validators': [{'name': 'required'}],
+ 'values': [
+ ('IT', 'Italian'),
+ ('ES', 'Spanish'),
+ ('US', 'American'),
+ ('UK', 'English'),
+ ],
+ },
+ {
+ 'name': 'languages',
+ 'type': 'selectmany',
+ 'message': "What are your favorite programming languages ?",
+ 'description': 'Please choose your favorites from the list.',
+ 'values': [
+ ('py', 'Python'),
+ ('rb', 'Ruby'),
+ ('js', 'Javascript'),
+ ('go', 'Golang'),
+ ('rs', 'Rust'),
+ ('c', 'C'),
+ ('cpp', 'C++'),
+ ('java', 'Java'),
+ ],
+ },
+]
+
+
+answers = interrogatio(questions)
+```
+
+### Contributing
+
+If you want to contribute to the project, you can submit bugs, feature requests or fork the github repository and submit your pull request.
+
+
+### License
+
+`interrogatio` is released under the [BSD 3-Clause "New" or "Revised" License](https://opensource.org/licenses/BSD-3-Clause>).
+
+
+%package help
+Summary: Development documents and examples for interrogatio
+Provides: python3-interrogatio-doc
+%description help
+# interrogatio
+
+![Python versions](https://img.shields.io/pypi/pyversions/interrogatio.svg) [![PyPi Status](https://img.shields.io/pypi/v/interrogatio.svg)](https://pypi.org/project/interrogatio/) ![Read the Docs](https://img.shields.io/readthedocs/interrogatio) [![Build Status](https://img.shields.io/github/workflow/status/ffaraone/interrogatio/Build%20interrogatio)](https://github.com/ffaraone/interrogatio/actions) [![codecov](https://codecov.io/gh/ffaraone/interrogatio/branch/master/graph/badge.svg)](https://codecov.io/gh/ffaraone/interrogatio)
+
+
+A python library to prompt users for inputs in a terminal application.
+
+
+## What is interrogatio
+
+`interrogatio` is a python 3.8+ library based on the [python-prompt-toolkit](https://github.com/prompt-toolkit/python-prompt-toolkit) and inspired by [PyInquirer](https://github.com/CITGuru/PyInquirer/) that help CLI developers to ask users for inputs.
+
+Questions can be rendered onto the terminal prompt or as curses-like dialogs.
+
+
+## Documentation
+
+[`interrogatio` documentation](https://interrogatio.readthedocs.io/en/latest/) is hosted on _Read the Docs_.
+
+
+
+## Getting started
+
+
+### Requirements
+
+`interrogatio` depends on the python-prompt-toolkit library and its dependencies.
+
+### Installation
+
+
+#### Using pip
+
+
+```
+$ pip install interrogatio
+```
+
+
+#### Extra dependencies
+
+If you want to use the shell command with yml files you can install the yml dependency:
+
+```
+$ pip install interrogatio[yml]
+```
+
+
+### Basic usage
+
+`interrogatio` needs a list of questions to prompt the user for answers.
+
+Each question is a python dictionary with at least the following keys:
+
+* **name**: it has to be unique within the list of questions. It represents the variable name;
+* **type**: the type of question;
+* **message**: the text of the prompt.
+
+Optionally you should specify:
+
+* a **default**: a default value;
+* a **validators**: a list of children of Validator class
+* a **values**: a list of tuples (value, label) to provide a list of choices
+ for the ``selectone`` or ``selectmany`` question types.
+
+
+`interrogatio` can run into two modes: dialog and prompt.
+
+#### Dialog mode
+
+![Dialog mode showcase](docs/showcase/dialogus.gif)
+
+```
+from interrogatio import dialogus
+
+questions = [
+ {
+ 'name': 'name',
+ 'type': 'input',
+ 'message': "What's your name ?",
+ 'description': 'Please enter your full name. This field is required.',
+ 'validators': [{'name': 'required'}],
+ },
+ {
+ 'name': 'birth_date',
+ 'type': 'date',
+ 'message': "What's your birth date ?",
+ 'description': 'Enter your birth date.',
+ },
+ {
+ 'name': 'nationality',
+ 'type': 'selectone',
+ 'message': "What's your nationality ?",
+ 'description': 'Please choose one from the list.',
+ 'validators': [{'name': 'required'}],
+ 'values': [
+ ('IT', 'Italian'),
+ ('ES', 'Spanish'),
+ ('US', 'American'),
+ ('UK', 'English'),
+ ],
+ },
+ {
+ 'name': 'languages',
+ 'type': 'selectmany',
+ 'message': "What are your favorite programming languages ?",
+ 'description': 'Please choose your favorites from the list.',
+ 'values': [
+ ('py', 'Python'),
+ ('rb', 'Ruby'),
+ ('js', 'Javascript'),
+ ('go', 'Golang'),
+ ('rs', 'Rust'),
+ ('c', 'C'),
+ ('cpp', 'C++'),
+ ('java', 'Java'),
+ ],
+ },
+]
+
+intro = """<blue>Welcome to <b><i>interrogatio 2.0</i></b>!
+
+This is the second major release of interrogatio with nice improvements.</blue>
+
+<b>What's new</b>
+<b>----------</b>
+
+* Curses-like dialog experience had been completely rewritten.
+* New questions handlers for dates, date ranges and masked inputs.
+* Validators are now based on the <u>validators</u> library.
+"""
+
+
+answers = dialogus(questions, 'interrogatio showcase', intro=intro, summary=True)
+```
+
+#### Prompt mode
+
+![Prompt mode showcase](docs/showcase/interrogatio.gif)
+
+```
+from interrogatio import interrogatio
+
+questions = [
+ {
+ 'name': 'name',
+ 'type': 'input',
+ 'message': "What's your name ?",
+ 'description': 'Please enter your full name. This field is required.',
+ 'validators': [{'name': 'required'}],
+ },
+ {
+ 'name': 'birth_date',
+ 'type': 'date',
+ 'message': "What's your birth date ?",
+ 'description': 'Enter your birth date.',
+ },
+ {
+ 'name': 'nationality',
+ 'type': 'selectone',
+ 'message': "What's your nationality ?",
+ 'description': 'Please choose one from the list.',
+ 'validators': [{'name': 'required'}],
+ 'values': [
+ ('IT', 'Italian'),
+ ('ES', 'Spanish'),
+ ('US', 'American'),
+ ('UK', 'English'),
+ ],
+ },
+ {
+ 'name': 'languages',
+ 'type': 'selectmany',
+ 'message': "What are your favorite programming languages ?",
+ 'description': 'Please choose your favorites from the list.',
+ 'values': [
+ ('py', 'Python'),
+ ('rb', 'Ruby'),
+ ('js', 'Javascript'),
+ ('go', 'Golang'),
+ ('rs', 'Rust'),
+ ('c', 'C'),
+ ('cpp', 'C++'),
+ ('java', 'Java'),
+ ],
+ },
+]
+
+
+answers = interrogatio(questions)
+```
+
+### Contributing
+
+If you want to contribute to the project, you can submit bugs, feature requests or fork the github repository and submit your pull request.
+
+
+### License
+
+`interrogatio` is released under the [BSD 3-Clause "New" or "Revised" License](https://opensource.org/licenses/BSD-3-Clause>).
+
+
+%prep
+%autosetup -n interrogatio-2.3.1
+
+%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-interrogatio -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 2.3.1-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..2fca4fc
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+60e9ddcb111e064f94ae09c32519ee09 interrogatio-2.3.1.tar.gz