equal
deleted
inserted
replaced
19 |
19 |
20 # You should have received a copy of the GNU Lesser General Public |
20 # You should have received a copy of the GNU Lesser General Public |
21 # License along with this library; if not, write to the Free Software |
21 # License along with this library; if not, write to the Free Software |
22 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
22 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
23 |
23 |
|
24 |
|
25 from __future__ import print_function |
24 import socket |
26 import socket |
25 import threading |
27 import threading |
26 from util import Zeroconf |
28 from util import Zeroconf |
27 |
29 |
28 service_type = '_PYRO._tcp.local.' |
30 service_type = '_PYRO._tcp.local.' |
52 self.service_name = 'Beremiz_%s.%s' % (name, service_type) |
54 self.service_name = 'Beremiz_%s.%s' % (name, service_type) |
53 self.name = name |
55 self.name = name |
54 self.port = port |
56 self.port = port |
55 |
57 |
56 self.server = Zeroconf.Zeroconf(ip) |
58 self.server = Zeroconf.Zeroconf(ip) |
57 print "MDNS brodcasting on :"+ip |
59 print("MDNS brodcasting on :" + ip) |
58 |
60 |
59 if ip == "0.0.0.0": |
61 if ip == "0.0.0.0": |
60 ip = self.gethostaddr() |
62 ip = self.gethostaddr() |
61 print "MDNS brodcasted service address :"+ip |
63 print("MDNS brodcasted service address :" + ip) |
62 self.ip_32b = socket.inet_aton(ip) |
64 self.ip_32b = socket.inet_aton(ip) |
63 |
65 |
64 self.server.registerService( |
66 self.server.registerService( |
65 Zeroconf.ServiceInfo(service_type, |
67 Zeroconf.ServiceInfo(service_type, |
66 self.service_name, |
68 self.service_name, |