From 2b56229ff0b96e420ea866804e209289f83d4078 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Mon, 15 May 2023 07:50:43 +0000 Subject: automatic import of python-jinja2-getenv-extension --- .gitignore | 1 + python-jinja2-getenv-extension.spec | 277 ++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 279 insertions(+) create mode 100644 python-jinja2-getenv-extension.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..b50d156 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/jinja2_getenv_extension-1.0.2.tar.gz diff --git a/python-jinja2-getenv-extension.spec b/python-jinja2-getenv-extension.spec new file mode 100644 index 0000000..a549d6d --- /dev/null +++ b/python-jinja2-getenv-extension.spec @@ -0,0 +1,277 @@ +%global _empty_manifest_terminate_build 0 +Name: python-jinja2-getenv-extension +Version: 1.0.2 +Release: 1 +Summary: a jinja2 extension to access to system environment variables +License: BSD +URL: https://github.com/metwork-framework/jinja2_getenv_extension +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/1c/b2/5923d18de44203788bd1bf8dbc5ebad64217ebcebc0b1d6bfc5b0717ac9a/jinja2_getenv_extension-1.0.2.tar.gz +BuildArch: noarch + +Requires: python3-jinja2 + +%description +# jinja2_getenv_extension + +[//]: # (automatically generated from https://github.com/metwork-framework/github_organization_management/blob/master/common_files/README.md) + +**Status (master branch)** + + + +[![GitHub CI](https://github.com/metwork-framework/jinja2_getenv_extension/workflows/CI/badge.svg?branch=master)](https://github.com/metwork-framework/jinja2_getenv_extension/actions?query=workflow%3ACI+branch%3Amaster) +[![Maintenance](https://raw.githubusercontent.com/metwork-framework/resources/master/badges/maintained.svg)](https://github.com/metwork-framework/resources/blob/master/badges/maintained.svg) + + + + +## What is it ? + +This is a [jinja2](http://jinja.pocoo.org/) extension to access to system +environment variables. It is usefull if you have dynamically generated +variable names. + +## Syntax + +The syntax is `{{ 'ENV_VAR'|getenv }}` to access to the `ENV_VAR` environment +variable. Don't forget the quotes around `ENV_VAR` ! + +If you want to provide a default value to avoid an exception if the corresponding +environment variable does not exist, you can use the following syntax: +`{{ 'ENV_VAR'|getenv('default_value') }}`. + +## Examples + +```python + +from jinja2 import Template, Environment + +# We load the extension in a jinja2 Environment +env = Environment(extensions=["jinja2_getenv_extension.GetenvExtension"]) + +# For the example, we use a template from a simple string +template = env.from_string("the value of HOME environment variable is: " + "{{ 'HOME'|getenv }}") +result = template.render() + +# [...] +``` + + + + + + +## Contributing guide + +See [CONTRIBUTING.md](CONTRIBUTING.md) file. + + + +## Code of Conduct + +See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) file. + + + +## Sponsors + +*(If you are officially paid to work on MetWork Framework, please contact us to add your company logo here!)* + +[![logo](https://raw.githubusercontent.com/metwork-framework/resources/master/sponsors/meteofrance-small.jpeg)](http://www.meteofrance.com) + + +%package -n python3-jinja2-getenv-extension +Summary: a jinja2 extension to access to system environment variables +Provides: python-jinja2-getenv-extension +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-jinja2-getenv-extension +# jinja2_getenv_extension + +[//]: # (automatically generated from https://github.com/metwork-framework/github_organization_management/blob/master/common_files/README.md) + +**Status (master branch)** + + + +[![GitHub CI](https://github.com/metwork-framework/jinja2_getenv_extension/workflows/CI/badge.svg?branch=master)](https://github.com/metwork-framework/jinja2_getenv_extension/actions?query=workflow%3ACI+branch%3Amaster) +[![Maintenance](https://raw.githubusercontent.com/metwork-framework/resources/master/badges/maintained.svg)](https://github.com/metwork-framework/resources/blob/master/badges/maintained.svg) + + + + +## What is it ? + +This is a [jinja2](http://jinja.pocoo.org/) extension to access to system +environment variables. It is usefull if you have dynamically generated +variable names. + +## Syntax + +The syntax is `{{ 'ENV_VAR'|getenv }}` to access to the `ENV_VAR` environment +variable. Don't forget the quotes around `ENV_VAR` ! + +If you want to provide a default value to avoid an exception if the corresponding +environment variable does not exist, you can use the following syntax: +`{{ 'ENV_VAR'|getenv('default_value') }}`. + +## Examples + +```python + +from jinja2 import Template, Environment + +# We load the extension in a jinja2 Environment +env = Environment(extensions=["jinja2_getenv_extension.GetenvExtension"]) + +# For the example, we use a template from a simple string +template = env.from_string("the value of HOME environment variable is: " + "{{ 'HOME'|getenv }}") +result = template.render() + +# [...] +``` + + + + + + +## Contributing guide + +See [CONTRIBUTING.md](CONTRIBUTING.md) file. + + + +## Code of Conduct + +See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) file. + + + +## Sponsors + +*(If you are officially paid to work on MetWork Framework, please contact us to add your company logo here!)* + +[![logo](https://raw.githubusercontent.com/metwork-framework/resources/master/sponsors/meteofrance-small.jpeg)](http://www.meteofrance.com) + + +%package help +Summary: Development documents and examples for jinja2-getenv-extension +Provides: python3-jinja2-getenv-extension-doc +%description help +# jinja2_getenv_extension + +[//]: # (automatically generated from https://github.com/metwork-framework/github_organization_management/blob/master/common_files/README.md) + +**Status (master branch)** + + + +[![GitHub CI](https://github.com/metwork-framework/jinja2_getenv_extension/workflows/CI/badge.svg?branch=master)](https://github.com/metwork-framework/jinja2_getenv_extension/actions?query=workflow%3ACI+branch%3Amaster) +[![Maintenance](https://raw.githubusercontent.com/metwork-framework/resources/master/badges/maintained.svg)](https://github.com/metwork-framework/resources/blob/master/badges/maintained.svg) + + + + +## What is it ? + +This is a [jinja2](http://jinja.pocoo.org/) extension to access to system +environment variables. It is usefull if you have dynamically generated +variable names. + +## Syntax + +The syntax is `{{ 'ENV_VAR'|getenv }}` to access to the `ENV_VAR` environment +variable. Don't forget the quotes around `ENV_VAR` ! + +If you want to provide a default value to avoid an exception if the corresponding +environment variable does not exist, you can use the following syntax: +`{{ 'ENV_VAR'|getenv('default_value') }}`. + +## Examples + +```python + +from jinja2 import Template, Environment + +# We load the extension in a jinja2 Environment +env = Environment(extensions=["jinja2_getenv_extension.GetenvExtension"]) + +# For the example, we use a template from a simple string +template = env.from_string("the value of HOME environment variable is: " + "{{ 'HOME'|getenv }}") +result = template.render() + +# [...] +``` + + + + + + +## Contributing guide + +See [CONTRIBUTING.md](CONTRIBUTING.md) file. + + + +## Code of Conduct + +See [CODE_OF_CONDUCT.md](CODE_OF_CONDUCT.md) file. + + + +## Sponsors + +*(If you are officially paid to work on MetWork Framework, please contact us to add your company logo here!)* + +[![logo](https://raw.githubusercontent.com/metwork-framework/resources/master/sponsors/meteofrance-small.jpeg)](http://www.meteofrance.com) + + +%prep +%autosetup -n jinja2-getenv-extension-1.0.2 + +%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-jinja2-getenv-extension -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Mon May 15 2023 Python_Bot - 1.0.2-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..bf97402 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +38b24d7dcca73e3b2e6757c98c86241d jinja2_getenv_extension-1.0.2.tar.gz -- cgit v1.2.3