Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
cp requirements-dev.txt ./env/requirements.built

flake8:
flake8 --max-line-length=$(MAX_LINE_LENGTH) examples *.py
flake8 --max-line-length=$(MAX_LINE_LENGTH) --import-order-style=smarkets examples *.py

test:
nosetests -v
Expand Down
22 changes: 11 additions & 11 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ python-zeroconf

.. image:: https://travis-ci.org/jstasiak/python-zeroconf.svg?branch=master
:target: https://travis-ci.org/jstasiak/python-zeroconf

.. image:: https://img.shields.io/pypi/v/zeroconf.svg
:target: https://pypi.python.org/pypi/zeroconf

.. image:: https://img.shields.io/coveralls/jstasiak/python-zeroconf.svg
:target: https://coveralls.io/r/jstasiak/python-zeroconf


This is fork of pyzeroconf, Multicast DNS Service Discovery for Python,
originally by Paul Scott-Murphy (https://github.com/paulsm/pyzeroconf),
modified by William McBrine (https://github.com/wmcbrine/pyzeroconf).
Expand All @@ -21,7 +21,7 @@ The original William McBrine's fork note::
(and therefore HME/VLC), Network Remote, Remote Proxy, and pyTivo.
Before this, I was tracking the changes for zeroconf.py in three
separate repos. I figured I should have an authoritative source.

Although I make changes based on my experience with TiVos, I expect that
they're generally applicable. This version also includes patches found
on the now-defunct (?) Launchpad repo of pyzeroconf, and elsewhere
Expand All @@ -43,7 +43,7 @@ Compared to some other Zeroconf/Bonjour/Avahi Python packages, python-zeroconf:
Python compatibility
--------------------

* CPython 2.6, 2.7, 3.3+
* CPython 2.7, 3.3+
* PyPy 2.2+ (possibly 1.9-2.1 as well)
* PyPy3 2.4+

Expand Down Expand Up @@ -84,18 +84,18 @@ Here's an example of browsing for a service:

from six.moves import input
from zeroconf import ServiceBrowser, Zeroconf


class MyListener(object):

def remove_service(self, zeroconf, type, name):
print("Service %s removed" % (name,))

def add_service(self, zeroconf, type, name):
info = zeroconf.get_service_info(type, name)
print("Service %s added, service info: %s" % (name, info))


zeroconf = Zeroconf()
listener = MyListener()
browser = ServiceBrowser(zeroconf, "_http._tcp.local.", listener)
Expand Down Expand Up @@ -269,7 +269,7 @@ Changelog
- better TXT record parsing
- server is now separate from name
- can cancel a service browser

* modified some unit tests to accommodate these changes

0.09
Expand Down
1 change: 1 addition & 0 deletions examples/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def on_service_state_change(zeroconf, service_type, name, state_change):
print(" No info")
print('\n')


if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
if len(sys.argv) > 1:
Expand Down
1 change: 1 addition & 0 deletions examples/old_browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ def add_service(self, zeroconf, type, name):
print(" No info")
print('\n')


if __name__ == '__main__':
logging.basicConfig(level=logging.DEBUG)
if len(sys.argv) > 1:
Expand Down
3 changes: 1 addition & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ coverage
enum34
flake8
flake8-blind-except
# Upper bound because of https://github.com/public/flake8-import-order/issues/42
flake8-import-order>=0.4.0, <0.6.0
flake8-import-order>=0.4.0
mock
netifaces
nose
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
'Topic :: Software Development :: Libraries',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
Expand Down
9 changes: 1 addition & 8 deletions zeroconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,7 @@
__license__ = 'LGPL'


try:
NullHandler = logging.NullHandler
except AttributeError:
# Python 2.6 fallback
class NullHandler(logging.Handler):

def emit(self, record):
pass
NullHandler = logging.NullHandler

__all__ = [
"__version__",
Expand Down