From fced2482520ca1bcf4bd0b3e52ad077f66f8e4dd Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Mon, 6 Apr 2009 19:43:24 +0200 Subject: [PATCH] entropy.*: move from using etpRepositoriesExcluded to SystemSettings['repositories']['excluded'] --- libraries/entropy/client/interfaces/methods.py | 4 ++-- libraries/entropy/const.py | 5 ++++- spritz/src/spritz.py | 14 +++++++++----- spritz/src/views.py | 5 +++-- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/libraries/entropy/client/interfaces/methods.py b/libraries/entropy/client/interfaces/methods.py index dc22f7821..60fed0a23 100644 --- a/libraries/entropy/client/interfaces/methods.py +++ b/libraries/entropy/client/interfaces/methods.py @@ -296,8 +296,8 @@ class Repository: del etpRepositories[repoid] done = True - if etpRepositoriesExcluded.has_key(repoid): - del etpRepositoriesExcluded[repoid] + if self.SystemSettings['repositories']['excluded'].has_key(repoid): + del self.SystemSettings['repositories']['excluded'][repoid] done = True if done: diff --git a/libraries/entropy/const.py b/libraries/entropy/const.py index d05b18c9a..10edc4540 100644 --- a/libraries/entropy/const.py +++ b/libraries/entropy/const.py @@ -89,10 +89,13 @@ etpCache = { 'ugc_srv_cache': 'ugc/ugc_srv_cache' } -# Constants +# kept for backward compatibility +# XXX will be removed before 10-10-2009 etpRepositories = {} etpRepositoriesExcluded = {} etpRepositoriesOrder = [] + + etpConst = {} def initconfig_entropy_constants(rootdir): diff --git a/spritz/src/spritz.py b/spritz/src/spritz.py index c99aa2ee6..95d23bb39 100644 --- a/spritz/src/spritz.py +++ b/spritz/src/spritz.py @@ -1865,7 +1865,8 @@ class SpritzApplication(Controller): return True else: disable = False - if etpRepositoriesExcluded.has_key(repodata['repoid']): + repo_excluded = self.Equo.SystemSettings['repositories']['excluded'] + if repo_excluded.has_key(repodata['repoid']): disable = True self.Equo.remove_repository(repodata['repoid'], disable = disable) if not disable: @@ -2500,14 +2501,16 @@ class SpritzApplication(Controller): def on_ugcClearCacheButton_clicked(self, widget): if self.Equo.UGC == None: return - for repoid in list(set(etpRepositories.keys()+etpRepositoriesExcluded.keys())): + repo_excluded = self.Equo.SystemSettings['repositories']['excluded'] + for repoid in list(set(etpRepositories.keys()+repo_excluded.keys())): self.Equo.UGC.UGCCache.clear_cache(repoid) self.setStatus("%s: %s ..." % (_("Cleaning UGC cache of"),repoid,)) self.setStatus("%s" % (_("UGC cache cleared"),)) def on_ugcClearCredentialsButton_clicked(self, widget): if self.Equo.UGC == None: return - for repoid in list(set(etpRepositories.keys()+etpRepositoriesExcluded.keys())): + repo_excluded = self.Equo.SystemSettings['repositories']['excluded'] + for repoid in list(set(etpRepositories.keys()+repo_excluded.keys())): if not self.Equo.UGC.is_repository_eapi3_aware(repoid): continue logged_data = self.Equo.UGC.read_login(repoid) if logged_data: self.Equo.UGC.remove_login(repoid) @@ -2745,10 +2748,11 @@ class SpritzApplication(Controller): def load_ugc_repositories(self): self.ugcRepositoriesModel.clear() repo_order = self.Equo.SystemSettings['repositories']['order'] - for repoid in repo_order+sorted(etpRepositoriesExcluded.keys()): + repo_excluded = self.Equo.SystemSettings['repositories']['excluded'] + for repoid in repo_order+sorted(repo_excluded.keys()): repodata = etpRepositories.get(repoid) if repodata == None: - repodata = etpRepositoriesExcluded.get(repoid) + repodata = repo_excluded.get(repoid) if repodata == None: continue # wtf? self.ugcRepositoriesModel.append([repodata]) diff --git a/spritz/src/views.py b/spritz/src/views.py index a352c59fe..eca947b57 100644 --- a/spritz/src/views.py +++ b/spritz/src/views.py @@ -1760,8 +1760,9 @@ class EntropyRepoView: repodata = etpRepositories[repo] self.store.append([1,1,repodata['dbrevision'],repo,repodata['description']]) # excluded ones - for repo in etpRepositoriesExcluded: - repodata = etpRepositoriesExcluded[repo] + repo_excluded = self.Equo.SystemSettings['repositories']['excluded'] + for repo in repo_excluded: + repodata = repo_excluded[repo] self.store.append([0,0,repodata['dbrevision'],repo,repodata['description']]) def new_pixbuf( self, column, cell, model, myiter ):