Commit e63ae0d8 authored by D1plo1d's avatar D1plo1d

Removing pymdns and using pybonjour directly because pybonjour works on linux...

Removing pymdns and using pybonjour directly because pybonjour works on linux so pymdns was entirely redundant.
parent 0882a4af
......@@ -27,8 +27,8 @@ A precompiled version is available at http://koti.kapsi.fi/~kliment/printrun/
You can run Printrun directly from source, as there are no packages available yet. Fetch and install the dependencies using
1. `sudo apt-get install python-serial python-wxgtk2.8 python-pyglet python-tornado python-setuptools python-libxml2 python-gobject`
2. `sudo apt-get install avahi-daemon python-avahi tornado`
1. `sudo apt-get install python-serial python-wxgtk2.8 python-pyglet python-tornado python-setuptools python-libxml2 python-gobject avahi-daemon libavahi-compat-libdnssd1`
2. `sudo easy_install pybonjour tornado`
3. `sudo easy_install https://github.com/D1plo1d/py-mdns/archive/master.zip`
### Fedora 15 and newer (untested)
......
......@@ -24,8 +24,8 @@ import json
import textwrap
import SocketServer
import socket
import mdns
from mdns.service import servicegroup, service
import pybonjour
import atexit
import uuid
import re
import traceback
......@@ -266,22 +266,17 @@ class Printserve(pronsole.pronsole, EventEmitter):
self.previous_job_progress = 0
self.silent = True
self.init_mdns()
self.jobs.listeners.add(self)
def init_mdns(self):
# create the group
group = servicegroup()
group.name = self.settings.name
# create the services
svc = service(type='_construct._tcp', port=8888, name='Pronsere',
sysname='training', state='SCHEMA-READY')
svc.txt = { }
group.services = [ svc ]
#services = ({'type': '_construct._tcp', 'port': 8888, 'domain': "local."})
#self.mdns = mdns.publisher().save_group({'name': self.settings.name, 'services': services })
self.mdns = mdns.publisher().save_group(group)
self.jobs.listeners.add(self)
sdRef = pybonjour.DNSServiceRegister(name = self.settings.name,
regtype = '_construct._tcp',
port = 8888,
domain = "local.")
atexit.register(self.cleanup_service, sdRef)
def cleanup_service(self, sdRef):
sdRef.close()
def do_print(self):
if not self.p.online: raise "not online"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment