[yum-commits] Branch 'yum-3_2_X' - yum/repos.py
James Antill
james at osuosl.org
Thu Mar 19 16:08:55 UTC 2009
yum/repos.py | 20 +++++++-------------
1 file changed, 7 insertions(+), 13 deletions(-)
New commits:
commit 2c6a8434342496c21ba1b43685f102342bab0cc8
Author: James Antill <james at and.org>
Date: Thu Mar 19 12:07:29 2009 -0400
Revert " Really fix the leak due to gpg_import_func."
This reverts commit 3fd8ca8835044f859fa9556b2425307289a3f9b4.
Wait until post 3.2.22 to add this.
diff --git a/yum/repos.py b/yum/repos.py
index 5185d98..63d1493 100644
--- a/yum/repos.py
+++ b/yum/repos.py
@@ -25,18 +25,6 @@ from packageSack import MetaSack
from weakref import proxy as weakref
-class _wrap_ayum_getKeyForRepo:
- """ This is a wrapper for calling YumBase.getKeyForRepo() because
- otherwise we take a real reference through the bound method and
- that is d00m (this applies to YumBase and RepoStorage, hence why
- we have a seperate class).
- A "better" fix might be to explicitly pass the YumBase instance to
- the callback ... API change! """
- def __init__(self, ayum):
- self.ayum = weakref(ayum)
- def __call__(self, repo, callback=None):
- return self.ayum.getKeyForRepo(repo, callback)
-
class RepoStorage:
"""This class contains multiple repositories and core configuration data
about them."""
@@ -56,9 +44,15 @@ class RepoStorage:
# need to be set from outside of the repos object to do anything
# even quasi-useful
# defaults to what is probably sane-ish
- self.gpg_import_func = _wrap_ayum_getKeyForRepo(ayum)
+ self.gpg_import_func = self._wrap_ayum_getKeyForRepo
self.confirm_func = None
+ def _wrap_ayum_getKeyForRepo(repo, callback=None):
+ """ This is a wrapper for calling self.ayum.getKeyForRepo() because
+ otherwise we take a real reference through the bound method and
+ that is d00m. """
+ return self.ayum.getKeyForRepo(repo, callback)
+
def doSetup(self, thisrepo = None):
self.ayum.plugins.run('prereposetup')
More information about the Yum-commits
mailing list