From b0698d3fd5437c4ef23fd9ec6ca993d126ec917a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 13 Mar 2009 13:09:44 -0700 Subject: [PATCH] Advertise the calibre content server for Stanza via BonJour, needs testing --- src/calibre/library/server.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/calibre/library/server.py b/src/calibre/library/server.py index a93f16d981..c2f7377102 100644 --- a/src/calibre/library/server.py +++ b/src/calibre/library/server.py @@ -7,7 +7,7 @@ __docformat__ = 'restructuredtext en' HTTP server for remote access to the calibre database. ''' -import sys, textwrap, operator, os, re, logging +import sys, textwrap, operator, os, re, logging, subprocess from itertools import repeat from logging.handlers import RotatingFileHandler from datetime import datetime @@ -171,6 +171,12 @@ class LibraryServer(object): try: cherrypy.engine.start() self.is_running = True + try: + subprocess.Popen(('dns-sd -R "calibre Books" ' + '_stanza._tcp local %d')% + self.opts.port, shell=True) + except: + pass cherrypy.engine.block() except Exception, e: self.exception = e