%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.aliyun.com/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 * Fri Jun 09 2023 Python_Bot - 1.0.0-1 - Package Spec generated