diff --git a/pisi/dbshelve.py b/pisi/dbshelve.py index 2927e421..0adfe8e7 100644 --- a/pisi/dbshelve.py +++ b/pisi/dbshelve.py @@ -38,6 +38,7 @@ Now added support for overriding the marshalling method import cPickle import bsddb3.db as db import bsddb3.dbobj as dbobj +import string import pisi @@ -60,6 +61,10 @@ class DBShelf: #def __del__(self): # self.close() + allowed_chars = string.letters + string.digits + '-' + def check_key(key): + return pisi.util.all(lambda x: x in allowed_chars, key) + def has_key(self, key, txn = None): if txn: return self.db.has_key(key, txn)