diff options
author | Zac Medico <zmedico@gentoo.org> | 2009-06-26 23:38:01 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2009-06-26 23:38:01 +0000 |
commit | 22c35abb9152c909b429e6190eab50f0500a00c5 (patch) | |
tree | c7181cf307ec732140abdf5619be35abc50ad39b | |
parent | 80d8bce1a6be1f869d7eb26247ae14351193fa7a (diff) | |
download | portage-22c35abb9152c909b429e6190eab50f0500a00c5.tar.gz portage-22c35abb9152c909b429e6190eab50f0500a00c5.tar.bz2 portage-22c35abb9152c909b429e6190eab50f0500a00c5.zip |
Use a property to implement portdbapi.settings.
svn path=/main/trunk/; revision=13703
-rw-r--r-- | pym/portage/dbapi/porttree.py | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index e55db1487..7c886ae25 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -110,6 +110,20 @@ class portdbapi(dbapi): """this tree will scan a portage directory located at root (passed to init)""" portdbapi_instances = [] _use_mutable = True + + def _get_settings(self): + return self.mysettings + + def _set_settings(self, settings): + self.mysettings = settings + + def _del_settings (self): + del self.mysettings + + settings = property(_get_settings, _set_settings, _del_settings, + "Define self.settings as an alias for self.mysettings, " + \ + "for conformity with other dbapi classes.") + def __init__(self, porttree_root, mysettings=None): portdbapi.portdbapi_instances.append(self) @@ -119,8 +133,6 @@ class portdbapi(dbapi): else: from portage import settings self.mysettings = config(clone=settings) - # Define self.settings, for conformity with other dbapi classes. - self.settings = self.mysettings self._iuse_implicit = self.mysettings._get_implicit_iuse() self._categories = self.mysettings.categories # This is strictly for use in aux_get() doebuild calls when metadata |