[Pythonmac-SIG] Using UKKQueue with PyObjC

Florian Munz newsletter at theflow.de
Mon Mar 7 23:11:12 CET 2005


Hi,

I'm currently trying to use the UKKQueue class to monitor file changes
from my PyObjC application.

After some fiddling I got the basics working, but encountered some
problems and questions:

* What is the minimal way to include such an ObjC wrapper class with
py2app? I am using the setup.py from RestEdit [1] right now, but this
looks overly complicated. Also this setup doesn't work when using
--alias

* I'm using the notifications provided by NSWorkspace:

NSWorkspace.sharedWorkspace().notificationCenter().addObserver_selector_
name_object_(
    self, "documentChanged:",
    None,
    None)

Is there a way to register an observer which listens to specific objects
only? UKKQueue sends notifications with the filename as object, but as
<type 'objc.pyobjc_unicode'> and simply replacing the last None in the
above method with the filename string didn't work.

* This is more a PyObjC question: Can I use any Python class as a
delegate for UKKQueue? Or have these to subclass NSObject or something
else?


thanks a lot,
Florian


[1] http://svn.red-bean.com/restedit/trunk/source/setup.py


More information about the Pythonmac-SIG mailing list