![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
A tool for dispatching tasks using multiprocessing, and viewing/controlling live feedback with a GUI array of progress bars.
multiprogressbars is a Python library for processing tasks via pickled processes using the multiprocessing library. It uses the localhost to communicate progress, which is displayed in real time using a GUI built with PyQt5. The GUI offers some features custom interrupting and throttling tasks for convenience.
Menu appears when right clicking on any bar with the following options:
The two interface objects are:
The Multibar and BarUpdater objects both have an underlying driver which they inherit from. The Multibar object handles the main GUI and has information about the
The tasks are distributed using QThreads to a multiprogressbars.helpers.process_handler.ProcessHandler object. Each ProcessHandler uses a multiprocessing.Pool to asynchronously run its given task as pickled process. It has a two-way local host multiprocessing.Pipe for the task to communicate its results as they come in, and for the ProcessHandler to signal to interrupt processing if requested.
Use the package manager pip to install multiprogressbars.
pip install multiprogressbars
For now, PyQt5 must be installed separately with the following command:
pip install pyqt5
For tasks that would benefit from python multiprocessing this is a vast improvement on serial execution. It does not improve on the speed of the multiprocessing library alone.
It is likely to be best used when there are tasks that could be done in parallel that have a long enough iterative execution that individual task progress is worth monitoring. Some examples would be loading and processing a log file, or processing and saving results of a calculation.
For a quick test to see everything is working as it should, try:
python multiprogressbars/example.py
or
python multiprogressbars/example.py --with_exceptions
For testing with control over the parameters for the number of tasks, task names, iteration speeds and totals, import the examples into a python script. First example running randomly generated tasks that take different amounts of time to execute
from multiprogressbars.example import run_example
run_example()
Second example where some tasks will raise an exception
from multiprogressbars.example import run_example_exceptions
run_example_exceptions()
from multiprogressbars.multibar import Multibar
# create the Multibar object - can add tasks and get results through this
mbar = Multibar()
# tasks are created using the following example arguments - they are not run immediately
mbar.add_task(
func=target_func,
func_args=(target_func_arg1, target_func_arg2, ...), # optional
func_kwargs={'target_func_kwarg1_key': target_func_kwarg1_value} # optional
)
# processing begins by calling 'begin_processing()', or 'get()'
# both are blocking until the tasks are finished or the app is quit.
# this quits all processes and returns the results that have already finished
results_dict, failed_tasks_dict = mbar.get()
from multiprogressbars.bar_updater import BarUpdater
def target_func(
target_func_arg1,
target_func_arg2,
target_func_kwarg1_key=target_func_kwarg1_value,
pbar: BarUpdater = None):
# wrap an iterator in the BarUpdater object to automatically yield and update the internally designated progress bar
for _ in pbar(iterator, desc=description_str, total=len(iterator)):
# execute code
return results
from multiprogressbars.bar_updater import BarUpdater
def target_func(
target_func_arg1,
target_func_arg2,
target_func_kwarg1_key=target_func_kwarg1_value,
pbar: BarUpdater = None):
# wrap an iterator in the BarUpdater object to automatically yield and update the internally designated progress bar
pbar.update_name(description_string)
pbar.update_total(total)
while True:
# execute code
# more complicated user progress calculation
pbar.update_value(new_total_progress)
# break condition
return results
Please make any pull requests that would add or fix functionality. This is not intended for major use.
FAQs
A tool for dispatching tasks using multiprocessing, and viewing/controlling live feedback with a GUI array of progress bars.
We found that multiprogressbars 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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.