diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-18 03:30:42 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-18 03:30:42 +0000 |
| commit | ca8fca6950e9394c2d631ed474399cc4076d2044 (patch) | |
| tree | 24b2397c652d89f4730f274e949ea224c021921c | |
| parent | fa94d56a610265b37bec5ca87f0efaebb4b05e21 (diff) | |
automatic import of python-nibeuplink
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-nibeuplink.spec | 175 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 177 insertions, 0 deletions
@@ -0,0 +1 @@ +/nibeuplink-1.3.0.tar.gz diff --git a/python-nibeuplink.spec b/python-nibeuplink.spec new file mode 100644 index 0000000..a82131c --- /dev/null +++ b/python-nibeuplink.spec @@ -0,0 +1,175 @@ +%global _empty_manifest_terminate_build 0 +Name: python-nibeuplink +Version: 1.3.0 +Release: 1 +Summary: A python wrapper around Nibe Uplink REST API +License: MIT +URL: https://github.com/elupus/nibeuplink +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/49/4e/e433ca8b079190698727b01b8f87dd4a68eed6ad3d8d3b619687b19423aa/nibeuplink-1.3.0.tar.gz +BuildArch: noarch + +Requires: python3-asyncio +Requires: python3-aiohttp +Requires: python3-attrs +Requires: python3-typing-extensions +Requires: python3-pytest +Requires: python3-pytest-aiohttp +Requires: python3-pytest-cov +Requires: python3-coveralls +Requires: python3-asynctest +Requires: python3-aioresponses + +%description +The module is an asyncio driven interface to nibe uplink public API. It is throttled to one http request every 4 seconds so +try to make the most of your requests by batching requests. +Status +______ +Example +_______ + def token_read(): + return None + def token_write(token): + pass + async def run(): + async with nibeuplink.Uplink(client_id = 'XXX', + client_secret = 'YYY', + redirect_uri = 'ZZZ', + access_data = token_read(), + access_data_write = token_write, + scope = 'READSYSTEM') as uplink: + if not uplink.access_data: + auth_uri = uplink.get_authorize_url() + print(auth_uri) + result = input('Enter full redirect url: ') + await uplink.get_access_token(uplink.get_code_from_url(result)) + # Request all systems + print(uplink.get_systems()) + # Request data for specific system + print(uplink.get_system(12345)) + # Request data for parameters. Note request them in paralell using gather semantics + # that way, the module with batch up the requests into a single request to api + print(await asyncio.gather(uplink.get_parameter(12345, 11111), + uplink.get_parameter(12345, 22222))) + loop = asyncio.get_event_loop() + loop.run_until_complete (run()) + +%package -n python3-nibeuplink +Summary: A python wrapper around Nibe Uplink REST API +Provides: python-nibeuplink +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-nibeuplink +The module is an asyncio driven interface to nibe uplink public API. It is throttled to one http request every 4 seconds so +try to make the most of your requests by batching requests. +Status +______ +Example +_______ + def token_read(): + return None + def token_write(token): + pass + async def run(): + async with nibeuplink.Uplink(client_id = 'XXX', + client_secret = 'YYY', + redirect_uri = 'ZZZ', + access_data = token_read(), + access_data_write = token_write, + scope = 'READSYSTEM') as uplink: + if not uplink.access_data: + auth_uri = uplink.get_authorize_url() + print(auth_uri) + result = input('Enter full redirect url: ') + await uplink.get_access_token(uplink.get_code_from_url(result)) + # Request all systems + print(uplink.get_systems()) + # Request data for specific system + print(uplink.get_system(12345)) + # Request data for parameters. Note request them in paralell using gather semantics + # that way, the module with batch up the requests into a single request to api + print(await asyncio.gather(uplink.get_parameter(12345, 11111), + uplink.get_parameter(12345, 22222))) + loop = asyncio.get_event_loop() + loop.run_until_complete (run()) + +%package help +Summary: Development documents and examples for nibeuplink +Provides: python3-nibeuplink-doc +%description help +The module is an asyncio driven interface to nibe uplink public API. It is throttled to one http request every 4 seconds so +try to make the most of your requests by batching requests. +Status +______ +Example +_______ + def token_read(): + return None + def token_write(token): + pass + async def run(): + async with nibeuplink.Uplink(client_id = 'XXX', + client_secret = 'YYY', + redirect_uri = 'ZZZ', + access_data = token_read(), + access_data_write = token_write, + scope = 'READSYSTEM') as uplink: + if not uplink.access_data: + auth_uri = uplink.get_authorize_url() + print(auth_uri) + result = input('Enter full redirect url: ') + await uplink.get_access_token(uplink.get_code_from_url(result)) + # Request all systems + print(uplink.get_systems()) + # Request data for specific system + print(uplink.get_system(12345)) + # Request data for parameters. Note request them in paralell using gather semantics + # that way, the module with batch up the requests into a single request to api + print(await asyncio.gather(uplink.get_parameter(12345, 11111), + uplink.get_parameter(12345, 22222))) + loop = asyncio.get_event_loop() + loop.run_until_complete (run()) + +%prep +%autosetup -n nibeuplink-1.3.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-nibeuplink -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Thu May 18 2023 Python_Bot <Python_Bot@openeuler.org> - 1.3.0-1 +- Package Spec generated @@ -0,0 +1 @@ +87a9eb071193e97e138e357675cccbf9 nibeuplink-1.3.0.tar.gz |
