twisting is Python library based on Twisted deferred thread with GTK.
Requirements
To be effective the twisting needs the twisted library in addition with gtk. Then we have to do the following imports at the beginning of the main entry file of the application:
# twisted install
from twisted.internet import gtk2reactor
# install the gtk2 reactor
gtk2reactor.install()
# twisted import
from twisted.internet import reactor
Before we started the application with traditional gtk main thread starting:
# gtk thread start gtk.main()
Now we use the twisted reactor start after as follow:
# twisted reactor start
reactor.run()
Note: your main graphic window must be created before the reactor start like with gtk.
Framework overview
The gui part of the twisting framework offer the following functionalities:
1. gui elements to display the tasks progress
* taskbox object: attach to a task to inform about the task progression
* progress window: contains all the task boxes that can be hidden
* progress box: can be use in a parent window to inform about the average progression
2. several tasks management
* add task: create a thread and a taskox attach to a working method
* pause/play task: automatically managed by the framework
* stop task: return a flag to the main loop
* remove a taskbox from the progress window (stopped automatically)
nb: each task correspond with a gui widget displaying the progress status of the task
3. callbacks
* result callback: set when we add the task and call with a result by the twisted deferred thread when the worker loop ended
* error callback: set when we add the task and call by the twisted deferred thread on error
* all tasks finished callback: call by the progress window when all tasks are finished, can be used for message display, progress window hide or i don't know...
Product's homepage
Requirements:
· Python