[pygtk] Threading in nautilus-python extensions

Jason Heeris jason.heeris at gmail.com
Sat Jul 4 16:13:56 WST 2009


Hi,

I'm working on NautilusSVN, a Python-based extension to integrate
Subversion into Nautilus. I've run into some confusing issues regarding
threading and I was hoping for some advice.

Basically, what I've found is that threads spawned by the Python
extension do not run unless the user specifically interacts with
Nautilus (eg. refreshes, selects files, opens context menu).

I've attached some code - it's the smallest possible example (I think)
that illustrates the problem. Drop it in ~/.nautilus/python-extensions
and use "nautilus -q && nautilus --no-desktop" to kill and restart
nautilus and log to the console.

What I would expect is that the test extension logs once every 1/100th
of a second. What actually happens is that it only logs when I interact
with Nautilus.

So what exactly is happening here? Is it expected?

I would appreciate any advice on this.

Just some background: one of the previous maintainers for this project
had the same problems[1], but I couldn't find any resolution. I asked a
few days ago on the Nautilus Dev list[2], and I was directed here.

Cheers,
Jason Heeris

[1] http://mail.gnome.org/archives/nautilus-list/2006-December/msg00053.html

[2] http://mail.gnome.org/archives/nautilus-list/2009-July/msg00000.html

PS. I think a 48 hour moderation queue might just be a little on the
extreme side... :)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: AsyncTest.py
Type: text/x-python
Size: 1914 bytes
Desc: not available
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20090704/ea38ba87/attachment.py 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 835 bytes
Desc: OpenPGP digital signature
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20090704/ea38ba87/attachment.pgp 


More information about the pygtk mailing list