diff options
author | Lennart Poettering <lennart@poettering.net> | 2005-08-09 00:32:32 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2005-08-09 00:32:32 +0000 |
commit | aa458a0a13d18882354f33c07b0a4e8e82e7a424 (patch) | |
tree | fe2798a3f057d2ef9e177a183afec43e973c28a5 /avahi-utils/avahi | |
parent | 707e763398063186c20d8aba3abdef20e3d39253 (diff) |
* Update HACKING
* Change DBUS API: txt record lists are now coded as "aay" instead of "as".
Unfortunately this triggers this bug:
https://bugs.freedesktop.org/show_bug.cgi?id=4023
If you want to use avahi-publish-service you need to apply the included patch.
* change avahi-bookmarks to listen on 127.0.0.1 only
* add ftp and https browsing support to avahi-bookmarks, but disable it due to python-dbus bugs
* update avahi module for python to provide functions to convert between tring lists and lists of lists of bytes
* add avahi_strlst_add_anonymous()
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@281 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
Diffstat (limited to 'avahi-utils/avahi')
-rw-r--r-- | avahi-utils/avahi/__init__.py | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/avahi-utils/avahi/__init__.py b/avahi-utils/avahi/__init__.py index c68e177..90d2b76 100644 --- a/avahi-utils/avahi/__init__.py +++ b/avahi-utils/avahi/__init__.py @@ -18,7 +18,7 @@ # USA. # Some definitions matching those in core.h -import socket +import socket, dbus SERVER_INVALID, SERVER_REGISTERING, SERVER_RUNNING, SERVER_COLLISION = range(-1, 3) @@ -37,3 +37,40 @@ DBUS_INTERFACE_ENTRY_GROUP = DBUS_NAME + ".EntryGroup" DBUS_INTERFACE_DOMAIN_BROWSER = DBUS_NAME + ".DomainBrowser" DBUS_INTERFACE_SERVICE_TYPE_BROWSER = DBUS_NAME + ".ServiceTypeBrowser" DBUS_INTERFACE_SERVICE_BROWSER = DBUS_NAME + ".ServiceBrowser" + +def byte_array_to_string(s): + r = "" + + for c in s: + + if c >= 32 and c < 127: + r += "%c" % c + else: + r += "." + + return r + +def txt_array_to_string_array(t): + l = [] + + for s in t: + l.append(byte_array_to_string(s)) + + return l + + +def string_to_byte_array(s): + r = [] + + for c in s: + r.append(dbus.Byte(ord(c))) + + return r + +def string_array_to_txt_array(t): + l = [] + + for s in t: + l.append(string_to_byte_array(s)) + + return l |