diff --git a/mopidy/utils/zeroconf.py b/mopidy/utils/zeroconf.py index 4e802f7c..c69fb950 100644 --- a/mopidy/utils/zeroconf.py +++ b/mopidy/utils/zeroconf.py @@ -1,17 +1,30 @@ -import dbus +from __future__ import unicode_literals -__all__ = ["Zeroconf"] +try: + import dbus +except ImportError: + dbus = None -avahi_IF_UNSPEC = -1 -avahi_PROTO_UNSPEC = -1 -avahi_PublishFlags_None = 0 +import re + +_AVAHI_IF_UNSPEC = -1 +_AVAHI_PROTO_UNSPEC = -1 +_AVAHI_PUBLISHFLAGS_NONE = 0 + + +def _filter_loopback_and_meta_addresses(host): + # TODO: see if we can find a cleaner way of handling this. + if re.search(r'(?