]> git.meshlink.io Git - catta/commitdiff
python: use module gdbm exclusively (dropping anydbm, dbm)
authorLennart Poettering <lennart@poettering.net>
Wed, 7 Sep 2005 17:51:01 +0000 (17:51 +0000)
committerLennart Poettering <lennart@poettering.net>
Wed, 7 Sep 2005 17:51:01 +0000 (17:51 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@524 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-utils/avahi/ServiceTypeDatabase.py.in
configure.ac
service-type-database/build-db.in

index 863c85d0d6ea4b939941227650e3ecdd74535965..9caeebd91cd74ca9cdd17743a6c306baa862c8a0 100644 (file)
@@ -19,7 +19,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 # USA.
 
-import anydbm
+import gdbm
 import locale
 
 locale.setlocale(locale.LC_ALL, '')
@@ -28,7 +28,7 @@ class ServiceTypeDatabase:
 
     def __init__(self, filename = "@pkgdatadir@/service-types.db"):
 
-        self.db = anydbm.open(filename, "r")
+        self.db = gdbm.open(filename, "r")
 
         l = locale.getlocale(locale.LC_MESSAGES)
 
index aee779aac7ee00f044587d478fce78d832f254bf..c9de6ae8bd5cbd1767183d35661f791b654f09ab 100644 (file)
@@ -381,8 +381,7 @@ if test "x$HAVE_PYTHON" = "xyes" ; then
     fi
 
     AM_CHECK_PYMOD(socket,,,[AC_MSG_ERROR(Could not find Python module socket)])
-    AM_CHECK_PYMOD(dbm,,,[AC_MSG_ERROR(Could not find Python module dbm)])
-    AM_CHECK_PYMOD(anydbm,,,[AC_MSG_ERROR(Could not find Python module anydbm)])
+    AM_CHECK_PYMOD(gdbm,,,[AC_MSG_ERROR(Could not find Python module gdbm)])
 fi
 AM_CONDITIONAL(HAVE_PYTHON, [test "x$HAVE_PYTHON" = "xyes" ])
 AM_CONDITIONAL(HAVE_PYGTK, test "x$HAVE_PYGTK" = "xyes")
index c27eb90b6215ab83702658a810c24135db7f32c0..21d057d45e86755eb0abec3f4f2776ddde90c830 100755 (executable)
@@ -19,7 +19,7 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 # USA.
 
-import dbm, sys
+import gdbm, sys
 
 if len(sys.argv) > 1:
     infn = sys.argv[1]
@@ -29,12 +29,9 @@ else:
 if len(sys.argv) > 2:
     outfn = sys.argv[2]
 else:
-    outfn = infn
+    outfn = infn + ".db"
 
-if outfn.endswith(".db"):
-    outfn = outfn[:-3]
-
-db = dbm.open(outfn, "n")
+db = gdbm.open(outfn, "n")
 
 for ln in file(infn, "r"):
     ln = ln.strip(" \r\n\t")