Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
resettabletimer
Readme
Wrapper for threading.Timer
to provide a resettable Timer implementation. Also provides fake timer for testing.
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
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
Check and automatically fix formatting with:
pycodestyle resettabletimer
autopep8 -aaar --in-place resettabletimer
Run static analysis with:
pylint -E --enable=invalid-name,unused-import,useless-object-inheritance resettabletimer
Run unit tests:
# 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
FAQs
Wrapper for threading.Timer to allow resetting
We found that resettabletimer demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.