From: Zac Medico Date: Sat, 10 Dec 2011 07:04:24 +0000 (-0800) Subject: Make portdbapi.eclassdb a property. X-Git-Tag: v2.2.0_alpha80~24 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=716ad204d2107092704e4188f3a73736ec836d44;p=portage.git Make portdbapi.eclassdb a property. --- diff --git a/pym/portage/dbapi/porttree.py b/pym/portage/dbapi/porttree.py index e483edb93..233a2c1d1 100644 --- a/pym/portage/dbapi/porttree.py +++ b/pym/portage/dbapi/porttree.py @@ -59,6 +59,13 @@ class portdbapi(dbapi): def porttree_root(self): return self.settings.repositories.mainRepoLocation() + @property + def eclassdb(self): + main_repo = self.repositories.mainRepo() + if main_repo is None: + return None + return main_repo.eclass_db + def __init__(self, _unused_param=None, mysettings=None): """ @param _unused_param: deprecated, use mysettings['PORTDIR'] instead @@ -102,7 +109,6 @@ class portdbapi(dbapi): ":".join(filter(None, sandbox_write)) self.porttrees = list(self.settings.repositories.repoLocationList()) - self.eclassdb = self.repositories.mainRepo().eclass_db # This is used as sanity check for aux_get(). If there is no # root eclass dir, we assume that PORTDIR is invalid or