summaryrefslogtreecommitdiffstats
path: root/avahi-utils/avahi/ServiceTypeDatabase.py.in
diff options
context:
space:
mode:
Diffstat (limited to 'avahi-utils/avahi/ServiceTypeDatabase.py.in')
-rw-r--r--avahi-utils/avahi/ServiceTypeDatabase.py.in7
1 files changed, 7 insertions, 0 deletions
diff --git a/avahi-utils/avahi/ServiceTypeDatabase.py.in b/avahi-utils/avahi/ServiceTypeDatabase.py.in
index 9caeebd..93fcfd3 100644
--- a/avahi-utils/avahi/ServiceTypeDatabase.py.in
+++ b/avahi-utils/avahi/ServiceTypeDatabase.py.in
@@ -55,6 +55,13 @@ class ServiceTypeDatabase:
self.suffixes = tuple(map(lambda x: "["+x+"]", self.suffixes)) + ("", )
+ def lookup_service_type(self, stype):
+ try:
+ return self.db[stype]
+ except KeyError:
+ return "n/a"
+
+
def __getitem__(self, key):
for suffix in self.suffixes: