On Oct 20, 2005, at 4:13 PM, Paul Volpato wrote:
> I have an app that starts a zope instance on the local machine,
> but I want it to be able to allow remote computers (that also have
> this app running) to 'discover' the zope instance running's IP
> Is it possible for cocoa (with bonjour or something) to do this
> (with pyobjc)?
Yeah, but it's probably easier to just use the command-line tool..
here's how I did it for TurboGears (it's in the source, too):
DNS_SD = '/usr/bin/dns-sd'
DNS_SD_PID = None
# bonjour advertise
if not hasattr(cherrypy, "root") or not cherrypy.root:
package = cherrypy.root.__module__
package = package[:package.find(".")]
args = [
package + ": " + cherrypy.config.get('server.environment'),
cherrypy.config.get('server.socketHost') or '.',
# it might be nice to use subprocess and redirect IO to /dev/
DNS_SD_PID = os.spawnv(os.P_NOWAIT, args, args)
if not DNS_SD_PID: