From 68866491c5b743f03ea2fb36909267f6a6d411db Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Wed, 31 May 2023 06:51:05 +0000 Subject: automatic import of python-resettabletimer --- .gitignore | 1 + python-resettabletimer.spec | 318 ++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 320 insertions(+) create mode 100644 python-resettabletimer.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..3ff4cdd 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/resettabletimer-1.0.0.tar.gz diff --git a/python-resettabletimer.spec b/python-resettabletimer.spec new file mode 100644 index 0000000..c689355 --- /dev/null +++ b/python-resettabletimer.spec @@ -0,0 +1,318 @@ +%global _empty_manifest_terminate_build 0 +Name: python-resettabletimer +Version: 1.0.0 +Release: 1 +Summary: Wrapper for threading.Timer to allow resetting +License: MIT License +URL: https://github.com/kangasta/resettabletimer +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/87/5f/7c7dc782c934d1a6c8af64b2b9a37541b995da02ec238f06a9b088df41e8/resettabletimer-1.0.0.tar.gz +BuildArch: noarch + + +%description +# resettabletimer + +[![CI](https://github.com/kangasta/resettabletimer/actions/workflows/ci.yml/badge.svg)](https://github.com/kangasta/resettabletimer/actions/workflows/ci.yml) +[![Release](https://github.com/kangasta/resettabletimer/actions/workflows/release.yml/badge.svg)](https://github.com/kangasta/resettabletimer/actions/workflows/release.yml) + +Wrapper for `threading.Timer` to provide a resettable Timer implementation. Also provides fake timer for testing. + +## Usage + +### ResettableTimer + +```python +from resettabletimer import ResettableTimer + +delay = 5 # seconds +function = print + +# Create resettable timer +t = ResettableTimer(delay, function, ["Hello"], {"end":" timer!\n"}) + +# Starting and canceling work similarly than with threading.Timer +t.start() + +# Wait 1-5 seconds + +# Reset the timer +t.reset() + +# Hello should be printed after five seconds + +``` + +### FakeTimer + +```python +from resettabletimer import FakeTimer + +t = FakeTimer(2, print, ["Hello"], {"end":" timer!\n"}) + +# Starting and canceling work similarly than with threading.Timer +t.start() + +# Wait >2 seconds +# Nothing happens + +# Time passage is controlled with pass_time +t.pass_time(2) + +# Hello should be printed + +``` + +## Testing + +Check and automatically fix formatting with: + +```bash +pycodestyle resettabletimer +autopep8 -aaar --in-place resettabletimer +``` + +Run static analysis with: + +```bash +pylint -E --enable=invalid-name,unused-import,useless-object-inheritance resettabletimer +``` + +Run unit tests: + +```bash +# Run unit tests +python3 -m unittest discover -s tst/ + +# Run unit tests with coverage analysis +coverage run \ + --branch \ + --source resettabletimer/ \ + -m unittest discover -s tst/ +coverage report -m +``` + + + + +%package -n python3-resettabletimer +Summary: Wrapper for threading.Timer to allow resetting +Provides: python-resettabletimer +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-resettabletimer +# resettabletimer + +[![CI](https://github.com/kangasta/resettabletimer/actions/workflows/ci.yml/badge.svg)](https://github.com/kangasta/resettabletimer/actions/workflows/ci.yml) +[![Release](https://github.com/kangasta/resettabletimer/actions/workflows/release.yml/badge.svg)](https://github.com/kangasta/resettabletimer/actions/workflows/release.yml) + +Wrapper for `threading.Timer` to provide a resettable Timer implementation. Also provides fake timer for testing. + +## Usage + +### ResettableTimer + +```python +from resettabletimer import ResettableTimer + +delay = 5 # seconds +function = print + +# Create resettable timer +t = ResettableTimer(delay, function, ["Hello"], {"end":" timer!\n"}) + +# Starting and canceling work similarly than with threading.Timer +t.start() + +# Wait 1-5 seconds + +# Reset the timer +t.reset() + +# Hello should be printed after five seconds + +``` + +### FakeTimer + +```python +from resettabletimer import FakeTimer + +t = FakeTimer(2, print, ["Hello"], {"end":" timer!\n"}) + +# Starting and canceling work similarly than with threading.Timer +t.start() + +# Wait >2 seconds +# Nothing happens + +# Time passage is controlled with pass_time +t.pass_time(2) + +# Hello should be printed + +``` + +## Testing + +Check and automatically fix formatting with: + +```bash +pycodestyle resettabletimer +autopep8 -aaar --in-place resettabletimer +``` + +Run static analysis with: + +```bash +pylint -E --enable=invalid-name,unused-import,useless-object-inheritance resettabletimer +``` + +Run unit tests: + +```bash +# Run unit tests +python3 -m unittest discover -s tst/ + +# Run unit tests with coverage analysis +coverage run \ + --branch \ + --source resettabletimer/ \ + -m unittest discover -s tst/ +coverage report -m +``` + + + + +%package help +Summary: Development documents and examples for resettabletimer +Provides: python3-resettabletimer-doc +%description help +# resettabletimer + +[![CI](https://github.com/kangasta/resettabletimer/actions/workflows/ci.yml/badge.svg)](https://github.com/kangasta/resettabletimer/actions/workflows/ci.yml) +[![Release](https://github.com/kangasta/resettabletimer/actions/workflows/release.yml/badge.svg)](https://github.com/kangasta/resettabletimer/actions/workflows/release.yml) + +Wrapper for `threading.Timer` to provide a resettable Timer implementation. Also provides fake timer for testing. + +## Usage + +### ResettableTimer + +```python +from resettabletimer import ResettableTimer + +delay = 5 # seconds +function = print + +# Create resettable timer +t = ResettableTimer(delay, function, ["Hello"], {"end":" timer!\n"}) + +# Starting and canceling work similarly than with threading.Timer +t.start() + +# Wait 1-5 seconds + +# Reset the timer +t.reset() + +# Hello should be printed after five seconds + +``` + +### FakeTimer + +```python +from resettabletimer import FakeTimer + +t = FakeTimer(2, print, ["Hello"], {"end":" timer!\n"}) + +# Starting and canceling work similarly than with threading.Timer +t.start() + +# Wait >2 seconds +# Nothing happens + +# Time passage is controlled with pass_time +t.pass_time(2) + +# Hello should be printed + +``` + +## Testing + +Check and automatically fix formatting with: + +```bash +pycodestyle resettabletimer +autopep8 -aaar --in-place resettabletimer +``` + +Run static analysis with: + +```bash +pylint -E --enable=invalid-name,unused-import,useless-object-inheritance resettabletimer +``` + +Run unit tests: + +```bash +# Run unit tests +python3 -m unittest discover -s tst/ + +# Run unit tests with coverage analysis +coverage run \ + --branch \ + --source resettabletimer/ \ + -m unittest discover -s tst/ +coverage report -m +``` + + + + +%prep +%autosetup -n resettabletimer-1.0.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-resettabletimer -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 31 2023 Python_Bot - 1.0.0-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..8cd7f92 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +541ee88be619e91959b2c08a9da6aec3 resettabletimer-1.0.0.tar.gz -- cgit v1.2.3