diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-05 15:08:55 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-05 15:08:55 +0000 |
| commit | afc1b0f469238ce0991ae7bb5a025ceb4e12b2ea (patch) | |
| tree | 8cfb0e3928bad365a88a685b8483ba00ae2eacb9 | |
| parent | ab7e38d1c0729ff5bc44fd1858025380dfaef1c5 (diff) | |
automatic import of python-django-docopt-commandopeneuler20.03
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-django-docopt-command.spec | 301 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 303 insertions, 0 deletions
@@ -0,0 +1 @@ +/django-docopt-command-1.1.0.tar.gz diff --git a/python-django-docopt-command.spec b/python-django-docopt-command.spec new file mode 100644 index 0000000..e811513 --- /dev/null +++ b/python-django-docopt-command.spec @@ -0,0 +1,301 @@ +%global _empty_manifest_terminate_build 0 +Name: python-django-docopt-command +Version: 1.1.0 +Release: 1 +Summary: Django-docopt-command allows you to write Django manage.py commands using the docopt library. +License: Apache License, Version 2.0 +URL: https://github.com/mbraak/django-docopt-command +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/e1/6d/c51cb829d25ec2090cd3f286b5d6c9a95200fe277fa79be9d3c691acd2e9/django-docopt-command-1.1.0.tar.gz +BuildArch: noarch + +Requires: python3-docopt + +%description +# Django docopt command + +[](https://travis-ci.org/mbraak/django-docopt-command) [](https://pypi.python.org/pypi/django-docopt-command/) + +[](https://coveralls.io/r/mbraak/django-docopt-command?branch=master) [](https://requires.io/github/mbraak/django-docopt-command/requirements/?branch=master) + +[](https://pypi.python.org/pypi/django-docopt-command/) + +Django-docopt-command allows you to write [Django](https://www.djangoproject.com) [manage.py](https://docs.djangoproject.com/en/dev/howto/custom-management-commands/) commands using the [docopt](http://www.docopt.org) library. This means that you can define commands using usage strings. + +References: + +* [Django](https://www.djangoproject.com): The Web framework for perfectionists with deadlines +* [The docopt library](http://www.docopt.org): Command-line interface description language +* [Writing custom django-admin commands](https://docs.djangoproject.com/en/dev/howto/custom-management-commands/) + +```python +class Command(DocOptCommand): + # This usage string defines the command options: + docs = "Usage: command <option1> <option2> [--flag1]" + + def handle_docopt(self, arguments): + # arguments contains a dictionary with the options + pass +``` + +Django-docopt-command is tested with Django 2.2 - 3.1 and Python 3.5 - 3.8 and is hosted on [github](https://github.com/mbraak/django-docopt-command). + +Note that version 1.0.0 also supports Django 2.1 and version 0.5.0 supports Django 1.11 and Django 2.0. + +### Example + +See the *testproject/docopt_example* in the django-docopt-command github repository. + +## Usage + +Install django-docopt-command. + +``` +pip install django-docopt-command +``` + +**Step 1 - management command** + +Write a Django custom management command, as described in [Writing custom django-admin commands](https://docs.djangoproject.com/en/dev/howto/custom-management-commands/). + +**Step 2 - inherit from DocOptCommand** + +```python +class Command(DocOptCommand): + pass +``` + +**Step 3 - add a docs string** + +```python +class Command(DocOptCommand): + docs = "Usage: command <option1> <option2> [--flag1]" +``` + +**Step 4 - override handle_docopt** + +```python +class Command(DocOptCommand): + docs = "Usage: command <option1> <option2> [--flag1]" + + def handle_docopt(self, arguments): + option1 = arguments['option1'] + option2 = arguments['option2'] +``` + +## License + +Django-docopt-command is licensed under the Apache 2.0 License. + + + + +%package -n python3-django-docopt-command +Summary: Django-docopt-command allows you to write Django manage.py commands using the docopt library. +Provides: python-django-docopt-command +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-django-docopt-command +# Django docopt command + +[](https://travis-ci.org/mbraak/django-docopt-command) [](https://pypi.python.org/pypi/django-docopt-command/) + +[](https://coveralls.io/r/mbraak/django-docopt-command?branch=master) [](https://requires.io/github/mbraak/django-docopt-command/requirements/?branch=master) + +[](https://pypi.python.org/pypi/django-docopt-command/) + +Django-docopt-command allows you to write [Django](https://www.djangoproject.com) [manage.py](https://docs.djangoproject.com/en/dev/howto/custom-management-commands/) commands using the [docopt](http://www.docopt.org) library. This means that you can define commands using usage strings. + +References: + +* [Django](https://www.djangoproject.com): The Web framework for perfectionists with deadlines +* [The docopt library](http://www.docopt.org): Command-line interface description language +* [Writing custom django-admin commands](https://docs.djangoproject.com/en/dev/howto/custom-management-commands/) + +```python +class Command(DocOptCommand): + # This usage string defines the command options: + docs = "Usage: command <option1> <option2> [--flag1]" + + def handle_docopt(self, arguments): + # arguments contains a dictionary with the options + pass +``` + +Django-docopt-command is tested with Django 2.2 - 3.1 and Python 3.5 - 3.8 and is hosted on [github](https://github.com/mbraak/django-docopt-command). + +Note that version 1.0.0 also supports Django 2.1 and version 0.5.0 supports Django 1.11 and Django 2.0. + +### Example + +See the *testproject/docopt_example* in the django-docopt-command github repository. + +## Usage + +Install django-docopt-command. + +``` +pip install django-docopt-command +``` + +**Step 1 - management command** + +Write a Django custom management command, as described in [Writing custom django-admin commands](https://docs.djangoproject.com/en/dev/howto/custom-management-commands/). + +**Step 2 - inherit from DocOptCommand** + +```python +class Command(DocOptCommand): + pass +``` + +**Step 3 - add a docs string** + +```python +class Command(DocOptCommand): + docs = "Usage: command <option1> <option2> [--flag1]" +``` + +**Step 4 - override handle_docopt** + +```python +class Command(DocOptCommand): + docs = "Usage: command <option1> <option2> [--flag1]" + + def handle_docopt(self, arguments): + option1 = arguments['option1'] + option2 = arguments['option2'] +``` + +## License + +Django-docopt-command is licensed under the Apache 2.0 License. + + + + +%package help +Summary: Development documents and examples for django-docopt-command +Provides: python3-django-docopt-command-doc +%description help +# Django docopt command + +[](https://travis-ci.org/mbraak/django-docopt-command) [](https://pypi.python.org/pypi/django-docopt-command/) + +[](https://coveralls.io/r/mbraak/django-docopt-command?branch=master) [](https://requires.io/github/mbraak/django-docopt-command/requirements/?branch=master) + +[](https://pypi.python.org/pypi/django-docopt-command/) + +Django-docopt-command allows you to write [Django](https://www.djangoproject.com) [manage.py](https://docs.djangoproject.com/en/dev/howto/custom-management-commands/) commands using the [docopt](http://www.docopt.org) library. This means that you can define commands using usage strings. + +References: + +* [Django](https://www.djangoproject.com): The Web framework for perfectionists with deadlines +* [The docopt library](http://www.docopt.org): Command-line interface description language +* [Writing custom django-admin commands](https://docs.djangoproject.com/en/dev/howto/custom-management-commands/) + +```python +class Command(DocOptCommand): + # This usage string defines the command options: + docs = "Usage: command <option1> <option2> [--flag1]" + + def handle_docopt(self, arguments): + # arguments contains a dictionary with the options + pass +``` + +Django-docopt-command is tested with Django 2.2 - 3.1 and Python 3.5 - 3.8 and is hosted on [github](https://github.com/mbraak/django-docopt-command). + +Note that version 1.0.0 also supports Django 2.1 and version 0.5.0 supports Django 1.11 and Django 2.0. + +### Example + +See the *testproject/docopt_example* in the django-docopt-command github repository. + +## Usage + +Install django-docopt-command. + +``` +pip install django-docopt-command +``` + +**Step 1 - management command** + +Write a Django custom management command, as described in [Writing custom django-admin commands](https://docs.djangoproject.com/en/dev/howto/custom-management-commands/). + +**Step 2 - inherit from DocOptCommand** + +```python +class Command(DocOptCommand): + pass +``` + +**Step 3 - add a docs string** + +```python +class Command(DocOptCommand): + docs = "Usage: command <option1> <option2> [--flag1]" +``` + +**Step 4 - override handle_docopt** + +```python +class Command(DocOptCommand): + docs = "Usage: command <option1> <option2> [--flag1]" + + def handle_docopt(self, arguments): + option1 = arguments['option1'] + option2 = arguments['option2'] +``` + +## License + +Django-docopt-command is licensed under the Apache 2.0 License. + + + + +%prep +%autosetup -n django-docopt-command-1.1.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-django-docopt-command -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Fri May 05 2023 Python_Bot <Python_Bot@openeuler.org> - 1.1.0-1 +- Package Spec generated @@ -0,0 +1 @@ +a0fb22b78d8c3bb1308cba2ad093613a django-docopt-command-1.1.0.tar.gz |
