From: Zac Medico Date: Fri, 26 Jun 2009 23:38:01 +0000 (-0000) Subject: Use a property to implement portdbapi.settings. X-Git-Tag: v2.2_rc34~138 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=22c35abb9152c909b429e6190eab50f0500a00c5;p=portage.git Use a property to implement portdbapi.settings. svn path=/main/trunk/; revision=13703 --- 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