summaryrefslogtreecommitdiffstats
path: root/avahi-python/avahi/ServiceTypeDatabase.py.in
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2012-02-14 22:43:03 +0100
committerLennart Poettering <lennart@poettering.net>2012-02-14 22:43:03 +0100
commite98b5b0df0b6241a59a39cda8f78c7d8d4622881 (patch)
tree8e50f0bf79d4424a70b7c8ce309e70c0638e01f4 /avahi-python/avahi/ServiceTypeDatabase.py.in
parent826ad91480c05fb3672aa938fc9f1ced3034a0e8 (diff)
build-sys: compatibility with newer automake
Place the service type database in $(prefix)/lib/avahi instead of $(libdir)/avahi.
Diffstat (limited to 'avahi-python/avahi/ServiceTypeDatabase.py.in')
-rw-r--r--avahi-python/avahi/ServiceTypeDatabase.py.in16
1 files changed, 8 insertions, 8 deletions
diff --git a/avahi-python/avahi/ServiceTypeDatabase.py.in b/avahi-python/avahi/ServiceTypeDatabase.py.in
index 8ad8d5e..b2035fd 100644
--- a/avahi-python/avahi/ServiceTypeDatabase.py.in
+++ b/avahi-python/avahi/ServiceTypeDatabase.py.in
@@ -26,7 +26,7 @@ locale.setlocale(locale.LC_ALL, '')
class ServiceTypeDatabase:
"""ServiceTypeDatabase maps service types to descriptions"""
- def __init__(self, filename = "@pkglibdir@/service-types.db"):
+ def __init__(self, filename = "@pkglibdatadir@/service-types.db"):
self.db = @DBM@.open(filename, "r")
@@ -46,13 +46,13 @@ class ServiceTypeDatabase:
if i >= 0:
k = l[0][:i]
-
+
if not l[1] is None:
self.suffixes += (k + "@" + l[1], )
self.suffixes += (k, )
-
-
+
+
self.suffixes = tuple(map(lambda x: "["+x+"]", self.suffixes)) + ("", )
def __getitem__(self, key):
@@ -75,7 +75,7 @@ class ServiceTypeDatabase:
if self.db.has_key(key + suffix):
return True
-
+
return False
def __contains__(self, item):
@@ -86,7 +86,7 @@ class ServiceTypeDatabase:
return True
return False
-
+
def __iter__(self):
@@ -134,9 +134,9 @@ class ServiceTypeDatabase:
def values(self):
return list(self.itervalues())
-
+
if __name__ == "__main__":
-
+
b = ServiceTypeDatabase()
print b.items()