Mercurial > public > mercurial-scm > hg
diff hgext/zeroconf/__init__.py @ 7845:c2cd8d772805
zeroconf: advertise repositories with hostname
author | Alexander Solovyov <piranha@piranha.org.ua> |
---|---|
date | Thu, 05 Mar 2009 12:58:13 +0200 |
parents | e3425726b80d |
children | d812029cda85 |
line wrap: on
line diff
--- a/hgext/zeroconf/__init__.py Mon Mar 16 17:56:50 2009 -0500 +++ b/hgext/zeroconf/__init__.py Thu Mar 05 12:58:13 2009 +0200 @@ -77,8 +77,9 @@ ip = getip() localip = socket.inet_aton(ip) - parts = socket.gethostname().split('.') - host = parts[0] + ".local" + hostname = socket.gethostname().split('.')[0] + host = hostname + ".local" + name = "%s-%s" % (hostname, name) # advertise to browsers svc = Zeroconf.ServiceInfo('_http._tcp.local.',