From: Sebastien Estienne Date: Sun, 13 Nov 2005 00:40:38 +0000 (+0000) Subject: * merge the python dict support in trunk X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=93293a573bda5eae15813b4c771863f740a01dd1;p=catta * merge the python dict support in trunk git-svn-id: file:///home/lennart/svn/public/avahi/trunk@952 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-utils/avahi/__init__.py b/avahi-utils/avahi/__init__.py index 6a3a1cf..c10b85d 100644 --- a/avahi-utils/avahi/__init__.py +++ b/avahi-utils/avahi/__init__.py @@ -74,3 +74,11 @@ def string_array_to_txt_array(t): l.append(string_to_byte_array(s)) return l + +def dict_to_txt_array(txt_dict): + l = [] + + for k,v in txt_dict.items(): + l.append(string_to_byte_array("%s=%s" % (k,v))) + + return l