Tag: python
-
D-Bus and Python: asynchronous method implementation
This is a quick demonstration of how to implement a D-Bus method in Python using asynchronous callbacks. I recently added support in system-config-printer for determining the best driver to use for a particular printer. This is an expensive operation, largely because of the time it takes to get a list of available drivers from CUPS,…
-
Profiling Python
Yesterday I spent a little bit of time improving the speed of adding a new printer using system-config-printer. The main problem was that several bugs had conspired to make it search for all printer drivers three times instead of just once (oops). After fixing that I tried profiling it to see what was taking the…
-
CUPS, GTK+, Python, and threading
I’ve been trying to prevent a Python GTK+ application (the system-config-printer printing troubleshooter) from appearing to freeze when performing CUPS operations such as fetching a list of available devices. Let me describe the problem. In the libcups API the main worker function is cupsDoRequest() and this function blocks until the request is complete. It may…