# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
# USA.
-import anydbm
+import gdbm
import locale
locale.setlocale(locale.LC_ALL, '')
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)
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")
# 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]
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")