diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-12-22 23:27:28 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-12-22 23:27:28 +0000 |
commit | 345338127788f8cb73aeb70c16f3529dd9630f52 (patch) | |
tree | a4b866ae2532f5d0bfbbe5ee51799c88d91f8c0a | |
parent | b7c4d023faa00a6c93658550567b8fce2a3c6457 (diff) | |
download | portage-345338127788f8cb73aeb70c16f3529dd9630f52.tar.gz portage-345338127788f8cb73aeb70c16f3529dd9630f52.tar.bz2 portage-345338127788f8cb73aeb70c16f3529dd9630f52.zip |
Add volatile cache module missing from the previous commit.
svn path=/main/trunk/; revision=5355
-rw-r--r-- | pym/cache/volatile.py | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/pym/cache/volatile.py b/pym/cache/volatile.py new file mode 100644 index 000000000..068a4b817 --- /dev/null +++ b/pym/cache/volatile.py @@ -0,0 +1,25 @@ +# Copyright 1999-2006 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: $ + +import copy +if not hasattr(__builtins__, "set"): + from sets import Set as set +from cache import template + +class database(template.database): + + autocommits = True + serialize_eclasses = False + + def __init__(self, *args, **config): + config.pop("gid", None) + super(database, self).__init__(*args, **config) + self._data = {} + self.iterkeys = self._data.iterkeys + self._setitem = self._data.__setitem__ + self._delitem = self._data.__delitem__ + self.__contains__ = self._data.__contains__ + + def _getitem(self, cpv): + return copy.deepcopy(self._data[cpv]) |