items(), and values() methods appropriatly for the current python version.
(trunk r12584)
svn path=/main/branches/2.1.6/; revision=12865
pass
return self._selinux_enabled
+ if sys.hexversion >= 0x3000000:
+ keys = __iter__
+ items = iteritems
+
def _shell_quote(s):
"""
Quote a string in double-quotes and use backslashes to
except ImportError:
import pickle
import os
+import sys
from portage.cache import fs_template
from portage.cache import cache_errors
if "__db" in self.__dict__ and self.__db != None:
self.__db.sync()
self.__db.close()
+
+ if sys.hexversion >= 0x3000000:
+ items = iteritems
# License: GPL2
# $Id$
+import sys
import UserDict
import warnings
import weakref
DeprecationWarning)
return key in self
+ if sys.hexversion >= 0x3000000:
+ keys = __iter__
+ items = iteritems
+
class LazyLoad(UserDict.DictMixin):
"""
Lazy loading of values for a dict
self.pull = None
return key in self.d
+ if sys.hexversion >= 0x3000000:
+ keys = __iter__
+ items = iteritems
+
_slot_dict_classes = weakref.WeakValueDictionary()
def slot_dict_class(keys, prefix="_val_"):
def __str__(self):
return str(dict(self.iteritems()))
+ if sys.hexversion >= 0x3000000:
+ items = iteritems
+ keys = __iter__
+ values = itervalues
+
v = SlotDict
_slot_dict_classes[v.allowed_keys] = v
return v
# License: GPL2
# $Id$
+import sys
from portage.cache import template, cache_errors
from portage.cache.template import reconstruct_eclasses
return [ row[0] for row in self.con.fetchall() ]
+ if sys.hexversion >= 0x3000000:
+ items = iteritems
from portage.cache import cache_errors
from portage.cache.cache_errors import InvalidRestriction
from portage.cache.mappings import ProtectedDict
+import sys
import warnings
class database(object):
if cont:
yield cpv
+ if sys.hexversion >= 0x3000000:
+ keys = __iter__
+ items = iteritems
def serialize_eclasses(eclass_dict):
"""takes a dict, returns a string representing said dict"""