Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
163 commits
Select commit Hold shift + click to select a range
f0d095d
Remove the executable bit.
wmcbrine Jul 9, 2013
d952a9c
The initial version I committed to HME for Python back in 2008. This is
wmcbrine Jul 9, 2013
f998e39
has_key() is deprecated.
wmcbrine Oct 2, 2008
892a4f0
Untab Zeroconf.
wmcbrine Nov 16, 2008
f80df7b
This doesn't seem to be necessary, and it's generating a lot of excep…
wmcbrine Jun 29, 2009
4c8aac9
Suppress EBADF errors in Zeroconf.py.
wmcbrine Sep 8, 2009
f76529c
Don't need the string module here.
wmcbrine Nov 9, 2009
fe77e37
Some people are reporting bogus data coming back from Zeroconf scans,…
wmcbrine Dec 30, 2009
488de88
Skip unknown resource records in Zeroconf -- https://bugs.launchpad.n…
wmcbrine Feb 28, 2010
e814dd1
Minor simplification of the pack/unpack routines in Zeroconf.
wmcbrine Jan 18, 2011
e5d930b
80-column fixes for Zeroconf.
wmcbrine Jan 18, 2011
3e718b5
Clearer.
wmcbrine Jan 18, 2011
173350e
Minor style things for Zeroconf (use True/False instead of 1/0, etc.).
wmcbrine Jan 18, 2011
b8baed3
More.
wmcbrine Jan 19, 2011
2420505
More again.
wmcbrine Jan 19, 2011
f6d4731
In Zeroconf, use the same method of determining the default IP as els…
wmcbrine Aug 18, 2011
9a94953
HHHHHH -> 6H
wmcbrine May 3, 2012
a81f3ab
Update the version to indicate a fork.
wmcbrine May 6, 2012
ac91642
Although beacons _should_ fit within single packets, maybe we should …
wmcbrine Jul 2, 2013
d346107
Write only a byte.
wmcbrine Jul 8, 2013
656f959
Describe this fork.
wmcbrine Jul 9, 2013
d89ddfc
Don't test for NonLocalNameException, since I killed it.
wmcbrine Jul 9, 2013
0a05f42
Allow for the failure of getServiceInfo(). Not sure why it's happening,
wmcbrine Jul 9, 2013
8adab79
Remove the comment about the test programs.
wmcbrine Jul 9, 2013
c13e4fa
Untab the test programs.
wmcbrine Jul 9, 2013
21d7c95
Outdated docs.
wmcbrine Jul 9, 2013
df986ee
Excess spaces; don't use "len" as a label. After eblot.
wmcbrine Jul 10, 2013
f772d4e
If name isn't in self.names, it's unexceptional. (And yes, I actually
wmcbrine Jul 14, 2013
c36e3af
Also unexceptional.
wmcbrine Jul 14, 2013
6147a6e
Meaningless.
wmcbrine Jul 15, 2013
015bae2
Moved history to README; updated version number, etc.
wmcbrine Jul 15, 2013
f6615a9
Extraneous spaces.
wmcbrine Jun 17, 2014
416054d
testNumbersAnswers() was identical to testNumbersQuestions().
wmcbrine Jun 18, 2014
b36e7d5
Don't need range() here.
wmcbrine Jun 18, 2014
ad6b1ec
Replaced unwrapped "lgpl.txt" with traditional "COPYING".
wmcbrine Jun 18, 2014
4bb88b0
Renamed tests.
wmcbrine Jun 18, 2014
5541813
The great lowercasing.
wmcbrine Jun 18, 2014
e292868
Lowercase imports.
wmcbrine Jun 18, 2014
1dc3436
De-DOSification.
wmcbrine Jun 18, 2014
4e39602
Updated FSF address.
wmcbrine Jun 18, 2014
2a000c5
New names, numbers.
wmcbrine Jun 18, 2014
eee4530
More readable display in browser; automatically quit after giving ten
wmcbrine Jun 18, 2014
0f3b413
Allow graceful exit from announcement test.
wmcbrine Jun 18, 2014
a115187
getText() is redundant with getProperties().
wmcbrine Jun 18, 2014
2ac738f
Unneeded.
wmcbrine Jun 18, 2014
5e5e78e
Make examples executable.
wmcbrine Jun 19, 2014
0884d6a
Docstrings for examples; shorter timeout; struct.unpack() vs. ord().
wmcbrine Jun 19, 2014
5e10a20
Really these should be network order.
wmcbrine Jun 19, 2014
eee7196
Obsolete comment.
wmcbrine Jun 19, 2014
443aca8
Although SOL_IP is considered more correct here, it's undefined on some
wmcbrine Jun 19, 2014
83aa0f3
Updated for 0.14.
wmcbrine Jun 19, 2014
e2964ed
PEP8ize and clean up
jstasiak Jul 6, 2014
a2a6125
Set up Travis build
jstasiak Jul 6, 2014
41a013c
Stop catching BaseExceptions
jstasiak Jul 6, 2014
353b700
Move readme to README.rst
jstasiak Jul 6, 2014
fd3401e
Move readme to README.rst
jstasiak Jul 7, 2014
43b182c
Advertise Python 2.6 and PyPy support
jstasiak Jul 7, 2014
f8cea82
Run actual tests on Travis
jstasiak Jul 7, 2014
35eced3
Update README.rst
jstasiak Jul 8, 2014
916bd38
Add setup.py
jstasiak Jul 8, 2014
0ef1b0d
Gitignore build/
jstasiak Jul 8, 2014
b819174
Tune package description
jstasiak Jul 8, 2014
6feec34
Update README.rst
jstasiak Jul 8, 2014
09a1f4f
Update README.rst
jstasiak Jul 8, 2014
9a99aa7
Add Python 3 support
jstasiak Jul 7, 2014
cd7ca98
Update README.rst
jstasiak Jul 8, 2014
b8cfc79
Mark threads as daemonic (at least for now)
jstasiak Jul 8, 2014
0a0f7e0
Fix regression introduced with Python 3 compat
jstasiak Jul 8, 2014
c83891c
Move examples to examples directory
jstasiak Jul 8, 2014
6aae20e
Update README.rst
jstasiak Jul 8, 2014
d330918
Advertise Python 3 support
jstasiak Jul 8, 2014
6a7cd31
Update README.rst
jstasiak Jul 8, 2014
2ce95f5
Refactor examples
jstasiak Jul 8, 2014
3502198
Rename examples
jstasiak Jul 8, 2014
c7bfe63
Update README.rst
jstasiak Jul 8, 2014
fba4215
Update README.rst
jstasiak Jul 8, 2014
1ee00b3
Reuse one Zeroconf instance in browser example
jstasiak Jul 8, 2014
b9f886b
Add myself to authors
jstasiak Jul 8, 2014
77bcadd
Bump version to 0.15
jstasiak Jul 8, 2014
49af263
Update README.rst
jstasiak Jul 8, 2014
8328aed
Refactor browser example
jstasiak Jul 8, 2014
83fd618
Update README.rst
jstasiak Jul 8, 2014
7b23734
Fix readme formatting
jstasiak Jul 8, 2014
922eab0
Refactor integration test to use events
jstasiak Jul 9, 2014
4c852d4
Add PyPI version badge to the readme
jstasiak Jul 9, 2014
89531e6
Add test_coverage make target
jstasiak Jul 10, 2014
475e80b
Fix socket.error handling
jstasiak Jul 10, 2014
1d90a9f
Send coverage to coveralls
jstasiak Jul 10, 2014
8502a7e
Add coverage badge to the readme
jstasiak Jul 10, 2014
161743e
Update README.rst
jstasiak Jul 10, 2014
9e81863
Bump version to 0.15.1
jstasiak Jul 10, 2014
bf97c14
Create universal wheels
jstasiak Jul 10, 2014
b290965
Update README.rst
jstasiak Jul 10, 2014
47ff62b
Update README.rst
jstasiak Jul 10, 2014
ada563c
Rationalize exception handling a bit and setup logging
jstasiak Nov 2, 2014
5429748
Switch to snake case and clean up import order
jstasiak Nov 2, 2014
92e4713
Migrate more camel case names to snake case
jstasiak Nov 2, 2014
4a67e12
Migrate from clazz to class_
jstasiak Nov 2, 2014
05c3c02
Tune logging
jstasiak Nov 2, 2014
4e54b67
Release as 0.16.0
jstasiak Dec 2, 2014
8f18609
Update README.rst
jstasiak Dec 2, 2014
4b8f68b
Refactor exception handling here
jstasiak Dec 6, 2014
80e8e10
Remove some unused methods
jstasiak Dec 6, 2014
903cb78
Stop using Zeroconf.group attribute
jstasiak Dec 7, 2014
88f5a51
Remove dead code
jstasiak Dec 8, 2014
f6425d1
Stop dropping multicast group membership
jstasiak Dec 8, 2014
d8c1ec8
Drop "zero dependencies" feature
jstasiak Dec 8, 2014
1c2205d
Refactor version detection in the setup script
jstasiak Dec 10, 2014
54ed4b7
Use six for Python 2/3 compatibility
jstasiak Dec 10, 2014
f0c3979
Use six for Python 2/3 compatibility
jstasiak Dec 10, 2014
8d32fa4
Refactor Condition usage to use context manager interface
jstasiak Dec 12, 2014
78449ef
Make Zeroconf.socket private
jstasiak Dec 12, 2014
a0ee3d6
Rationalize error handling when sending data
jstasiak Dec 12, 2014
442a599
Add preliminary support for mulitple net interfaces
jstasiak Dec 12, 2014
f3fd4cd
Fix ServiceInfo repr and text on Python 3
jstasiak Dec 12, 2014
500a76b
Export Error and InterfaceChoice
jstasiak Dec 12, 2014
0f7c64f
Ignore EADDRINUSE when appropriate
jstasiak Feb 3, 2015
193cf47
Use all network interfaces by default
jstasiak Feb 3, 2015
0208228
Configure logging during the tests
jstasiak Feb 4, 2015
b5e9e94
Skip host only network interfaces
jstasiak Feb 4, 2015
463428f
Don't fail when the netmask is unknown
jstasiak Feb 4, 2015
af5e363
Remove duplicates from all interfaces list
jstasiak Feb 4, 2015
193ee64
Make examples nicer and make them show all logs
jstasiak Feb 5, 2015
3775c47
Remove redundant parentheses
jstasiak Feb 5, 2015
df88670
Make the code nicer
jstasiak Feb 5, 2015
451c072
Add some debug logging
jstasiak Feb 5, 2015
7cad7a4
Handle exceptions better
jstasiak Feb 5, 2015
d162e54
Change ServiceBrowser interface experimentally
jstasiak Feb 5, 2015
08e0dc2
Make examples' output quiet by default
jstasiak Feb 5, 2015
2190818
Reformat a bit
jstasiak Feb 5, 2015
b443027
Fix using binary strings as property values
jstasiak Feb 5, 2015
ac5a63e
Move self test example out of main module
jstasiak Feb 5, 2015
275a22b
Prepare for new release
jstasiak Feb 5, 2015
b5fb3e8
Fix test breakage
jstasiak Feb 5, 2015
c748294
Restore old listener interface (and example) for now
jstasiak Feb 15, 2015
a298785
Add pypy3 build
jstasiak Feb 15, 2015
5c32a27
Describe recent changes
jstasiak Feb 15, 2015
0009b5e
Handle recent flake8 change
jstasiak Feb 15, 2015
4783611
Advertise pypy3 support
jstasiak Feb 15, 2015
a6d75b3
Do 0.17.0 release
jstasiak Feb 15, 2015
93d34f9
Getting an EADDRNOTAVAIL error when adding an address to the multicas…
daid Feb 16, 2015
a22484a
Update README.rst
jstasiak Feb 17, 2015
44fa62a
Update README.rst
jstasiak Feb 17, 2015
7c64ebf
Fix some typos in the readme
jstasiak Apr 10, 2015
0b8936b
Bump version to 0.17.1
jstasiak Apr 10, 2015
4dbd04b
Restrict pep8 version as something depends on it
jstasiak Apr 10, 2015
ba89455
Use enum-compat instead of enum34 directly
jstasiak Jul 11, 2015
4435a2a
Restrict flake8-import-order version
jstasiak Jul 11, 2015
dadbbfc
Fix a typo, meant strictly lesser than 0.6 :<
jstasiak Jul 11, 2015
d1ee5ce
Release version 0.17.2
jstasiak Jul 12, 2015
e8299c0
Fix DNSText repr Python 3 issue
balloob Aug 18, 2015
c7567d6
Add a DNSText __repr__ test
jstasiak Aug 18, 2015
9c3a81a
Prepare release 0.17.3
jstasiak Aug 18, 2015
f29c0f4
Make the package's status explicit
jstasiak Aug 18, 2015
ddb1048
Make it explicit who says what in the readme
jstasiak Aug 19, 2015
023426e
Support kernel versions <3.9
Sep 1, 2015
0b9093d
Prepare release 0.17.4
jstasiak Sep 21, 2015
0f46a06
Fix multicast TTL and LOOP options on OpenBSD
foralesergi Nov 29, 2015
dd907f2
Switch from netifaces to psutil
jstasiak Dec 1, 2015
30bd44f
fix issue #23 race-condition on ServiceBrowser startup
gbiddison Nov 18, 2015
6349d19
Revert "Switch from netifaces to psutil"
jstasiak Dec 1, 2015
d5818c1
Added thread safety to Zeroconf.close()
Mar 2, 2016
c8ff62c
Removed unnecessary changes to tests.
Mar 10, 2016
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
build/

17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: python
python:
- "2.6"
- "2.7"
- "3.3"
- "3.4"
- "pypy"
- "pypy3"
matrix:
fast_finish: true
install:
- pip install -r requirements-dev.txt
script:
- make test_coverage
- make flake8
after_success:
- coveralls
30 changes: 0 additions & 30 deletions Browser.py

This file was deleted.

458 changes: 458 additions & 0 deletions COPYING

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.PHONY: all virtualenv
MAX_LINE_LENGTH=110

virtualenv: ./env/requirements.built

env:
virtualenv env

./env/requirements.built: env requirements-dev.txt
./env/bin/pip install -r requirements-dev.txt
cp requirements-dev.txt ./env/requirements.built

flake8:
flake8 --max-line-length=$(MAX_LINE_LENGTH) examples *.py

test:
nosetests -v

test_coverage:
nosetests -v --with-coverage --cover-package=zeroconf

autopep8:
autopep8 --max-line-length=$(MAX_LINE_LENGTH) -i examples *.py
4 changes: 0 additions & 4 deletions README

This file was deleted.

275 changes: 275 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,275 @@
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).

The original William McBrine's fork note::

This fork is used in all of my TiVo-related projects: HME for Python
(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
around the net -- not always well-documented, sorry.

Compatible with:

* Bonjour
* Avahi

Compared to some other Zeroconf/Bonjour/Avahi Python packages, python-zeroconf:

* isn't tied to Bonjour or Avahi
* doesn't use D-Bus
* doesn't force you to use particular event loop or Twisted
* is pip-installable
* has PyPI distribution

Python compatibility
--------------------

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

Versioning
----------

This project's versions follow the following pattern: MAJOR.MINOR.PATCH.

* MAJOR version has been 0 so far
* MINOR version is incremented on backward incompatible changes
* PATCH version is incremented on backward compatible changes

Status
------

There are some people using this package. I don't actively use it and as such
any help I can offer with regard to any issues is very limited.


How to get python-zeroconf?
===========================

* PyPI page https://pypi.python.org/pypi/zeroconf
* GitHub project https://github.com/jstasiak/python-zeroconf

The easiest way to install python-zeroconf is using pip::

pip install zeroconf



How do I use it?
================

Here's an example:

.. code-block:: python

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)
try:
input("Press enter to exit...\n\n")
finally:
zeroconf.close()

.. note::

Discovery and service registration use *all* available network interfaces by default.
If you want to customize that you need to specify ``interfaces`` argument when
constructing ``Zeroconf`` object (see the code for details).

See examples directory for more.

Changelog
=========

0.17.4
------

* Fixed support for Linux kernel versions < 3.9 (thanks to Giovanni Harting
and Luckydonald, GitHub pull request #26)

0.17.3
------

* Fixed DNSText repr on Python 3 (it'd crash when the text was longer than
10 bytes), thanks to Paulus Schoutsen for the patch, GitHub pull request #24

0.17.2
------

* Fixed installation on Python 3.4.3+ (was failing because of enum34 dependency
which fails to install on 3.4.3+, changed to depend on enum-compat instead;
thanks to Michael Brennan for the original patch, GitHub pull request #22)

0.17.1
------

* Fixed EADDRNOTAVAIL when attempting to use dummy network interfaces on Windows,
thanks to daid

0.17.0
------

* Added some Python dependencies so it's not zero-dependencies anymore
* Improved exception handling (it'll be quieter now)
* Messages are listened to and sent using all available network interfaces
by default (configurable); thanks to Marcus Müller
* Started using logging more freely
* Fixed a bug with binary strings as property values being converted to False
(https://github.com/jstasiak/python-zeroconf/pull/10); thanks to Dr. Seuss
* Added new ``ServiceBrowser`` event handler interface (see the examples)
* PyPy3 now officially supported
* Fixed ServiceInfo repr on Python 3, thanks to Yordan Miladinov

0.16.0
------

* Set up Python logging and started using it
* Cleaned up code style (includes migrating from camel case to snake case)

0.15.1
------

* Fixed handling closed socket (GitHub #4)

0.15
----

* Forked by Jakub Stasiak
* Made Python 3 compatible
* Added setup script, made installable by pip and uploaded to PyPI
* Set up Travis build
* Reformatted the code and moved files around
* Stopped catching BaseException in several places, that could hide errors
* Marked threads as daemonic, they won't keep application alive now

0.14
----

* Fix for SOL_IP undefined on some systems - thanks Mike Erdely.
* Cleaned up examples.
* Lowercased module name.

0.13
----

* Various minor changes; see git for details.
* No longer compatible with Python 2.2. Only tested with 2.5-2.7.
* Fork by William McBrine.

0.12
----

* allow selection of binding interface
* typo fix - Thanks A. M. Kuchlingi
* removed all use of word 'Rendezvous' - this is an API change

0.11
----

* correction to comments for addListener method
* support for new record types seen from OS X
- IPv6 address
- hostinfo

* ignore unknown DNS record types
* fixes to name decoding
* works alongside other processes using port 5353 (e.g. on Mac OS X)
* tested against Mac OS X 10.3.2's mDNSResponder
* corrections to removal of list entries for service browser

0.10
----

* Jonathon Paisley contributed these corrections:
- always multicast replies, even when query is unicast
- correct a pointer encoding problem
- can now write records in any order
- traceback shown on failure
- 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
----

* remove all records on service unregistration
* fix DOS security problem with readName

0.08
----

* changed licensing to LGPL

0.07
----

* faster shutdown on engine
* pointer encoding of outgoing names
* ServiceBrowser now works
* new unit tests

0.06
----
* small improvements with unit tests
* added defined exception types
* new style objects
* fixed hostname/interface problem
* fixed socket timeout problem
* fixed add_service_listener() typo bug
* using select() for socket reads
* tested on Debian unstable with Python 2.2.2

0.05
----

* ensure case insensitivty on domain names
* support for unicast DNS queries

0.04
----

* added some unit tests
* added __ne__ adjuncts where required
* ensure names end in '.local.'
* timeout on receiving socket for clean shutdown


License
=======

LGPL, see COPYING file for details.
Loading