Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Tools for terminal-based wait animations
.. code-block:: bash
git clone http://github.com/bprinty/animation.git
cd animation
python setup.py install
Documentation for the package can be found at Read The Docs <http://animation.readthedocs.org/>
_.
The animation module provides decorators for doing terminal-based wait animations. To add a wait animation to a function that requires some processing time, simply decorate the function with the wait animation you want to use.
Here is an example of how to use it in a project:
.. code-block:: python
import animation
import time
@animation.simple_wait
def long_running_function():
... 5 seconds later ...
return
This will print an animated waiting message like this (the elipses at the end of the text grow and shrink while the function executes):
.. code-block:: bash
waiting ...
The animation types provided by default are:
And you can use any of these built-in animations like so:
.. code-block:: python
import animation
import time
@animation.wait('bar')
def long_running_function():
... 5 seconds later ...
return
@animation.wait('spinner')
def long_running_function():
... 5 seconds later ...
return
In addition to these default types, the module also supports custom animations. For example, to create an animation with a counter-clockwise spinning wheel:
.. code-block:: python
wheel = ('-', '/', '|', '\\')
@animation.wait(wheel)
def long_running_function():
... 5 seconds later ...
return
If you want to manually start and stop the wait animation, you can use the animation.Wait
class:
.. code-block:: python
wait = animation.Wait()
wait.start()
long_running_function()
wait.stop()
Finally, you can change the color of animations with the color=
argument:
.. code-block:: python
import animation
@animation.wait('bar', color='blue')
def long_running_function():
... 5 seconds later ...
return
File an issue in the GitHub issue tracker <https://github.com/bprinty/animation/issues>
_.
FAQs
Decorators for terminal-based wait animations.
We found that animation 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.