]> git.meshlink.io Git - catta/blobdiff - avahi-python/avahi/ServiceTypeDatabase.py.in
get rid of a lot of old svn cruft
[catta] / avahi-python / avahi / ServiceTypeDatabase.py.in
index 25807f36c7e6e22ab5737d2e8fe6e0f626c82ed3..8a77a31b28bfcd78bbc816d27cd747315a6d26fb 100644 (file)
@@ -1,7 +1,5 @@
 #!@PYTHON@
 # -*-python-*-
-# $Id$
-
 # This file is part of avahi.
 #
 # avahi is free software; you can redistribute it and/or modify it
@@ -19,7 +17,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 # USA.
 
-import gdbm
+import @DBM@
 import locale
 import re
 
@@ -27,9 +25,9 @@ locale.setlocale(locale.LC_ALL, '')
 
 class ServiceTypeDatabase:
 
-    def __init__(self, filename = "@pkgdatadir@/service-types.db"):
+    def __init__(self, filename = "@pkglibdir@/service-types.db"):
 
-        self.db = gdbm.open(filename, "r")
+        self.db = @DBM@.open(filename, "r")
 
         l = locale.getlocale(locale.LC_MESSAGES)
 
@@ -69,12 +67,12 @@ class ServiceTypeDatabase:
     def items(self):
 
         items = []
-        key = self.db.firstkey()
-        while key is not None:
+        @FIRST_KEY@
+        @CHECK_KEY@
             if re.search('_[a-zA-Z0-9-]+\._[a-zA-Z0-9-]+', key) and not re.search('_[a-zA-Z0-9-]+\._[a-zA-Z0-9-]+\[.*\]', key):
                 localized_service_name = self[key]
                 items.append((key, localized_service_name))
-            key = self.db.nextkey(key)
+            @NEXT_KEY@
         return items
 
     def has_key(self, key):