diff options
Diffstat (limited to 'Lib/bsddb')
-rw-r--r-- | Lib/bsddb/dbobj.py | 158 | ||||
-rw-r--r-- | Lib/bsddb/dbshelve.py | 4 | ||||
-rw-r--r-- | Lib/bsddb/test/test_basics.py | 2 | ||||
-rw-r--r-- | Lib/bsddb/test/test_dbobj.py | 2 | ||||
-rw-r--r-- | Lib/bsddb/test/test_join.py | 4 |
5 files changed, 85 insertions, 85 deletions
diff --git a/Lib/bsddb/dbobj.py b/Lib/bsddb/dbobj.py index 5bcf84b..4a75dd2 100644 --- a/Lib/bsddb/dbobj.py +++ b/Lib/bsddb/dbobj.py @@ -31,82 +31,82 @@ except ImportError: class DBEnv: def __init__(self, *args, **kwargs): - self._cobj = apply(db.DBEnv, args, kwargs) + self._cobj = db.DBEnv(*args, **kwargs) def close(self, *args, **kwargs): - return apply(self._cobj.close, args, kwargs) + return self._cobj.close(*args, **kwargs) def open(self, *args, **kwargs): - return apply(self._cobj.open, args, kwargs) + return self._cobj.open(*args, **kwargs) def remove(self, *args, **kwargs): - return apply(self._cobj.remove, args, kwargs) + return self._cobj.remove(*args, **kwargs) def set_shm_key(self, *args, **kwargs): - return apply(self._cobj.set_shm_key, args, kwargs) + return self._cobj.set_shm_key(*args, **kwargs) def set_cachesize(self, *args, **kwargs): - return apply(self._cobj.set_cachesize, args, kwargs) + return self._cobj.set_cachesize(*args, **kwargs) def set_data_dir(self, *args, **kwargs): - return apply(self._cobj.set_data_dir, args, kwargs) + return self._cobj.set_data_dir(*args, **kwargs) def set_flags(self, *args, **kwargs): - return apply(self._cobj.set_flags, args, kwargs) + return self._cobj.set_flags(*args, **kwargs) def set_lg_bsize(self, *args, **kwargs): - return apply(self._cobj.set_lg_bsize, args, kwargs) + return self._cobj.set_lg_bsize(*args, **kwargs) def set_lg_dir(self, *args, **kwargs): - return apply(self._cobj.set_lg_dir, args, kwargs) + return self._cobj.set_lg_dir(*args, **kwargs) def set_lg_max(self, *args, **kwargs): - return apply(self._cobj.set_lg_max, args, kwargs) + return self._cobj.set_lg_max(*args, **kwargs) def set_lk_detect(self, *args, **kwargs): - return apply(self._cobj.set_lk_detect, args, kwargs) + return self._cobj.set_lk_detect(*args, **kwargs) def set_lk_max(self, *args, **kwargs): - return apply(self._cobj.set_lk_max, args, kwargs) + return self._cobj.set_lk_max(*args, **kwargs) def set_lk_max_locks(self, *args, **kwargs): - return apply(self._cobj.set_lk_max_locks, args, kwargs) + return self._cobj.set_lk_max_locks(*args, **kwargs) def set_lk_max_lockers(self, *args, **kwargs): - return apply(self._cobj.set_lk_max_lockers, args, kwargs) + return self._cobj.set_lk_max_lockers(*args, **kwargs) def set_lk_max_objects(self, *args, **kwargs): - return apply(self._cobj.set_lk_max_objects, args, kwargs) + return self._cobj.set_lk_max_objects(*args, **kwargs) def set_mp_mmapsize(self, *args, **kwargs): - return apply(self._cobj.set_mp_mmapsize, args, kwargs) + return self._cobj.set_mp_mmapsize(*args, **kwargs) def set_timeout(self, *args, **kwargs): - return apply(self._cobj.set_timeout, args, kwargs) + return self._cobj.set_timeout(*args, **kwargs) def set_tmp_dir(self, *args, **kwargs): - return apply(self._cobj.set_tmp_dir, args, kwargs) + return self._cobj.set_tmp_dir(*args, **kwargs) def txn_begin(self, *args, **kwargs): - return apply(self._cobj.txn_begin, args, kwargs) + return self._cobj.txn_begin(*args, **kwargs) def txn_checkpoint(self, *args, **kwargs): - return apply(self._cobj.txn_checkpoint, args, kwargs) + return self._cobj.txn_checkpoint(*args, **kwargs) def txn_stat(self, *args, **kwargs): - return apply(self._cobj.txn_stat, args, kwargs) + return self._cobj.txn_stat(*args, **kwargs) def set_tx_max(self, *args, **kwargs): - return apply(self._cobj.set_tx_max, args, kwargs) + return self._cobj.set_tx_max(*args, **kwargs) def set_tx_timestamp(self, *args, **kwargs): - return apply(self._cobj.set_tx_timestamp, args, kwargs) + return self._cobj.set_tx_timestamp(*args, **kwargs) def lock_detect(self, *args, **kwargs): - return apply(self._cobj.lock_detect, args, kwargs) + return self._cobj.lock_detect(*args, **kwargs) def lock_get(self, *args, **kwargs): - return apply(self._cobj.lock_get, args, kwargs) + return self._cobj.lock_get(*args, **kwargs) def lock_id(self, *args, **kwargs): - return apply(self._cobj.lock_id, args, kwargs) + return self._cobj.lock_id(*args, **kwargs) def lock_put(self, *args, **kwargs): - return apply(self._cobj.lock_put, args, kwargs) + return self._cobj.lock_put(*args, **kwargs) def lock_stat(self, *args, **kwargs): - return apply(self._cobj.lock_stat, args, kwargs) + return self._cobj.lock_stat(*args, **kwargs) def log_archive(self, *args, **kwargs): - return apply(self._cobj.log_archive, args, kwargs) + return self._cobj.log_archive(*args, **kwargs) def set_get_returns_none(self, *args, **kwargs): - return apply(self._cobj.set_get_returns_none, args, kwargs) + return self._cobj.set_get_returns_none(*args, **kwargs) if db.version() >= (4,1): def dbremove(self, *args, **kwargs): - return apply(self._cobj.dbremove, args, kwargs) + return self._cobj.dbremove(*args, **kwargs) def dbrename(self, *args, **kwargs): - return apply(self._cobj.dbrename, args, kwargs) + return self._cobj.dbrename(*args, **kwargs) def set_encrypt(self, *args, **kwargs): - return apply(self._cobj.set_encrypt, args, kwargs) + return self._cobj.set_encrypt(*args, **kwargs) class DB(DictMixin): def __init__(self, dbenv, *args, **kwargs): # give it the proper DBEnv C object that its expecting - self._cobj = apply(db.DB, (dbenv._cobj,) + args, kwargs) + self._cobj = db.DB(dbenv._cobj, *args, **kwargs) # TODO are there other dict methods that need to be overridden? def __len__(self): @@ -119,92 +119,92 @@ class DB(DictMixin): del self._cobj[arg] def append(self, *args, **kwargs): - return apply(self._cobj.append, args, kwargs) + return self._cobj.append(*args, **kwargs) def associate(self, *args, **kwargs): - return apply(self._cobj.associate, args, kwargs) + return self._cobj.associate(*args, **kwargs) def close(self, *args, **kwargs): - return apply(self._cobj.close, args, kwargs) + return self._cobj.close(*args, **kwargs) def consume(self, *args, **kwargs): - return apply(self._cobj.consume, args, kwargs) + return self._cobj.consume(*args, **kwargs) def consume_wait(self, *args, **kwargs): - return apply(self._cobj.consume_wait, args, kwargs) + return self._cobj.consume_wait(*args, **kwargs) def cursor(self, *args, **kwargs): - return apply(self._cobj.cursor, args, kwargs) + return self._cobj.cursor(*args, **kwargs) def delete(self, *args, **kwargs): - return apply(self._cobj.delete, args, kwargs) + return self._cobj.delete(*args, **kwargs) def fd(self, *args, **kwargs): - return apply(self._cobj.fd, args, kwargs) + return self._cobj.fd(*args, **kwargs) def get(self, *args, **kwargs): - return apply(self._cobj.get, args, kwargs) + return self._cobj.get(*args, **kwargs) def pget(self, *args, **kwargs): - return apply(self._cobj.pget, args, kwargs) + return self._cobj.pget(*args, **kwargs) def get_both(self, *args, **kwargs): - return apply(self._cobj.get_both, args, kwargs) + return self._cobj.get_both(*args, **kwargs) def get_byteswapped(self, *args, **kwargs): - return apply(self._cobj.get_byteswapped, args, kwargs) + return self._cobj.get_byteswapped(*args, **kwargs) def get_size(self, *args, **kwargs): - return apply(self._cobj.get_size, args, kwargs) + return self._cobj.get_size(*args, **kwargs) def get_type(self, *args, **kwargs): - return apply(self._cobj.get_type, args, kwargs) + return self._cobj.get_type(*args, **kwargs) def join(self, *args, **kwargs): - return apply(self._cobj.join, args, kwargs) + return self._cobj.join(*args, **kwargs) def key_range(self, *args, **kwargs): - return apply(self._cobj.key_range, args, kwargs) + return self._cobj.key_range(*args, **kwargs) def has_key(self, *args, **kwargs): - return apply(self._cobj.has_key, args, kwargs) + return self._cobj.has_key(*args, **kwargs) def items(self, *args, **kwargs): - return apply(self._cobj.items, args, kwargs) + return self._cobj.items(*args, **kwargs) def keys(self, *args, **kwargs): - return apply(self._cobj.keys, args, kwargs) + return self._cobj.keys(*args, **kwargs) def open(self, *args, **kwargs): - return apply(self._cobj.open, args, kwargs) + return self._cobj.open(*args, **kwargs) def put(self, *args, **kwargs): - return apply(self._cobj.put, args, kwargs) + return self._cobj.put(*args, **kwargs) def remove(self, *args, **kwargs): - return apply(self._cobj.remove, args, kwargs) + return self._cobj.remove(*args, **kwargs) def rename(self, *args, **kwargs): - return apply(self._cobj.rename, args, kwargs) + return self._cobj.rename(*args, **kwargs) def set_bt_minkey(self, *args, **kwargs): - return apply(self._cobj.set_bt_minkey, args, kwargs) + return self._cobj.set_bt_minkey(*args, **kwargs) def set_bt_compare(self, *args, **kwargs): - return apply(self._cobj.set_bt_compare, args, kwargs) + return self._cobj.set_bt_compare(*args, **kwargs) def set_cachesize(self, *args, **kwargs): - return apply(self._cobj.set_cachesize, args, kwargs) + return self._cobj.set_cachesize(*args, **kwargs) def set_flags(self, *args, **kwargs): - return apply(self._cobj.set_flags, args, kwargs) + return self._cobj.set_flags(*args, **kwargs) def set_h_ffactor(self, *args, **kwargs): - return apply(self._cobj.set_h_ffactor, args, kwargs) + return self._cobj.set_h_ffactor(*args, **kwargs) def set_h_nelem(self, *args, **kwargs): - return apply(self._cobj.set_h_nelem, args, kwargs) + return self._cobj.set_h_nelem(*args, **kwargs) def set_lorder(self, *args, **kwargs): - return apply(self._cobj.set_lorder, args, kwargs) + return self._cobj.set_lorder(*args, **kwargs) def set_pagesize(self, *args, **kwargs): - return apply(self._cobj.set_pagesize, args, kwargs) + return self._cobj.set_pagesize(*args, **kwargs) def set_re_delim(self, *args, **kwargs): - return apply(self._cobj.set_re_delim, args, kwargs) + return self._cobj.set_re_delim(*args, **kwargs) def set_re_len(self, *args, **kwargs): - return apply(self._cobj.set_re_len, args, kwargs) + return self._cobj.set_re_len(*args, **kwargs) def set_re_pad(self, *args, **kwargs): - return apply(self._cobj.set_re_pad, args, kwargs) + return self._cobj.set_re_pad(*args, **kwargs) def set_re_source(self, *args, **kwargs): - return apply(self._cobj.set_re_source, args, kwargs) + return self._cobj.set_re_source(*args, **kwargs) def set_q_extentsize(self, *args, **kwargs): - return apply(self._cobj.set_q_extentsize, args, kwargs) + return self._cobj.set_q_extentsize(*args, **kwargs) def stat(self, *args, **kwargs): - return apply(self._cobj.stat, args, kwargs) + return self._cobj.stat(*args, **kwargs) def sync(self, *args, **kwargs): - return apply(self._cobj.sync, args, kwargs) + return self._cobj.sync(*args, **kwargs) def type(self, *args, **kwargs): - return apply(self._cobj.type, args, kwargs) + return self._cobj.type(*args, **kwargs) def upgrade(self, *args, **kwargs): - return apply(self._cobj.upgrade, args, kwargs) + return self._cobj.upgrade(*args, **kwargs) def values(self, *args, **kwargs): - return apply(self._cobj.values, args, kwargs) + return self._cobj.values(*args, **kwargs) def verify(self, *args, **kwargs): - return apply(self._cobj.verify, args, kwargs) + return self._cobj.verify(*args, **kwargs) def set_get_returns_none(self, *args, **kwargs): - return apply(self._cobj.set_get_returns_none, args, kwargs) + return self._cobj.set_get_returns_none(*args, **kwargs) if db.version() >= (4,1): def set_encrypt(self, *args, **kwargs): - return apply(self._cobj.set_encrypt, args, kwargs) + return self._cobj.set_encrypt(*args, **kwargs) diff --git a/Lib/bsddb/dbshelve.py b/Lib/bsddb/dbshelve.py index d341ab7..5cd4a53 100644 --- a/Lib/bsddb/dbshelve.py +++ b/Lib/bsddb/dbshelve.py @@ -169,7 +169,7 @@ class DBShelf(DictMixin): # given nothing is passed to the extension module. That way # an exception can be raised if set_get_returns_none is turned # off. - data = apply(self.db.get, args, kw) + data = self.db.get(*args, **kw) try: return cPickle.loads(data) except (TypeError, cPickle.UnpicklingError): @@ -236,7 +236,7 @@ class DBShelfCursor: def get(self, *args): count = len(args) # a method overloading hack method = getattr(self, 'get_%d' % count) - apply(method, args) + method(*args) def get_1(self, flags): rec = self.dbc.get(flags) diff --git a/Lib/bsddb/test/test_basics.py b/Lib/bsddb/test/test_basics.py index 24c4038..7e8f835 100644 --- a/Lib/bsddb/test/test_basics.py +++ b/Lib/bsddb/test/test_basics.py @@ -444,7 +444,7 @@ class BasicTestCase(unittest.TestCase): print "attempting to use a closed cursor's %s method" % \ method # a bug may cause a NULL pointer dereference... - apply(getattr(c, method), args) + getattr(c, method)(*args) except db.DBError, val: assert val[0] == 0 if verbose: print val diff --git a/Lib/bsddb/test/test_dbobj.py b/Lib/bsddb/test/test_dbobj.py index 6799fc9..1305883 100644 --- a/Lib/bsddb/test/test_dbobj.py +++ b/Lib/bsddb/test/test_dbobj.py @@ -39,7 +39,7 @@ class dbobjTestCase(unittest.TestCase): def put(self, key, *args, **kwargs): key = string.upper(key) # call our parent classes put method with an upper case key - return apply(dbobj.DB.put, (self, key) + args, kwargs) + return dbobj.DB.put(self, key, *args, **kwargs) self.env = TestDBEnv() self.env.open(self.homeDir, db.DB_CREATE | db.DB_INIT_MPOOL) self.db = TestDB(self.env) diff --git a/Lib/bsddb/test/test_join.py b/Lib/bsddb/test/test_join.py index 73edd11..69a1e9d 100644 --- a/Lib/bsddb/test/test_join.py +++ b/Lib/bsddb/test/test_join.py @@ -72,13 +72,13 @@ class JoinTestCase(unittest.TestCase): # create and populate primary index priDB = db.DB(self.env) priDB.open(self.filename, "primary", db.DB_BTREE, db.DB_CREATE) - map(lambda t, priDB=priDB: apply(priDB.put, t), ProductIndex) + map(lambda t, priDB=priDB: priDB.put(*t), ProductIndex) # create and populate secondary index secDB = db.DB(self.env) secDB.set_flags(db.DB_DUP | db.DB_DUPSORT) secDB.open(self.filename, "secondary", db.DB_BTREE, db.DB_CREATE) - map(lambda t, secDB=secDB: apply(secDB.put, t), ColorIndex) + map(lambda t, secDB=secDB: secDB.put(*t), ColorIndex) sCursor = None jCursor = None |