- fixed spritz repositories implementation

- fixed some glitches in equo


git-svn-id: http://svn.sabayonlinux.org/projects/entropy/trunk@993 cd1c1023-2f26-0410-ae45-c471fc1f0318
This commit is contained in:
(no author)
2008-01-04 19:04:10 +00:00
parent a205a498aa
commit ad3faba1eb
4 changed files with 30 additions and 11 deletions
+15 -5
View File
@@ -3245,9 +3245,9 @@ class RepoInterface:
self.__validate_repository_id(repo)
url, filepath = self.__construct_paths(item, repo, cmethod)
fetchConn = self.Entropy.urlFetcher(url, filepath)
fetchConn = self.Entropy.urlFetcher(url, filepath, resume = False)
fetchConn.progress = self.Entropy.progress
rc = fetchConn.download()
rc = fetchConn.download()
del fetchConn
if rc in ("-1","-2","-3"):
return False
@@ -3275,7 +3275,11 @@ class RepoInterface:
def sync(self):
# let's dance!
print_info(darkred(" @@ ")+darkgreen("Repositories syncronization..."))
self.Entropy.updateProgress( darkgreen("Repositories syncronization..."),
importance = 2,
type = "info",
header = darkred(" @@ ")
)
repocount = 0
repolength = len(self.reponames)
@@ -3289,7 +3293,7 @@ class RepoInterface:
count = (repocount, repolength),
header = blue(" # ")
)
self.Entropy.updateProgress( red("Database URL:") + darkgreen(etpRepositories[repo]['database']),
self.Entropy.updateProgress( red("Database URL: ") + darkgreen(etpRepositories[repo]['database']),
importance = 1,
type = "info",
header = blue(" # ")
@@ -3297,7 +3301,7 @@ class RepoInterface:
self.Entropy.updateProgress( red("Database local path: ") + darkgreen(etpRepositories[repo]['dbpath']),
importance = 0,
type = "info",
header = "\t"
header = blue(" # ")
)
# check if database is already updated to the latest revision
@@ -3836,6 +3840,12 @@ class urlFetcher:
# get file size if available
try:
self.remotefile = urllib2.urlopen(self.url)
except:
self.close()
self.status = "-3"
return self.status
try:
self.remotesize = int(self.remotefile.headers.get("content-length"))
self.remotefile.close()
except:
+5 -2
View File
@@ -38,10 +38,11 @@ from entropy import EquoInterface, urlFetcher
class Equo(EquoInterface):
def connect_to_gui(self, progress):
def connect_to_gui(self, progress, progressLog):
self.progress = progress
self.urlFetcher = urlFetcher
self.urlFetcher = GuiUrlFetcher
self.nocolor()
self.progressLog = progressLog
def updateProgress(self, text, header = "", footer = "", back = False, importance = 0, type = "info", count = [], percent = False):
@@ -63,6 +64,8 @@ class Equo(EquoInterface):
# FIXME: interface with popup !
myfunc = self.progress.set_extraLabel
myfunc(count_str+text)
if not back:
self.progressLog(count_str+text)
def cycleDone(self):
self.progress.total.next()
+8 -2
View File
@@ -376,7 +376,7 @@ class YumexGUI:
context_id = self.ui.status.get_context_id( "Status" )
self.ui.status.push( context_id, text )
def progressLog(self,msg, extra = None):
def progressLog(self, msg, extra = None):
self.logger.info(msg)
self.progress.set_subLabel( msg )
self.progress.set_progress( 0, " " ) # Blank the progress bar.
@@ -384,7 +384,13 @@ class YumexGUI:
self.output.write_line(extra+": "+msg+"\n")
else:
self.output.write_line(msg+"\n")
def progressLogWrite(self, msg, extra = None):
if extra:
self.output.write_line(extra+": "+msg+"\n")
else:
self.output.write_line(msg+"\n")
def pkgInfoClear( self ):
self.pkgDesc.clear()
self.pkgInfo.clear()
+2 -2
View File
@@ -425,7 +425,7 @@ class YumexApplication(YumexController,YumexGUI):
#self.addPackages()
self.setPage('repos')
self.Equo = Equo()
self.Equo.connect_to_gui(self.progress)
self.Equo.connect_to_gui(self.progress, self.progressLogWrite)
def startWorking(self):
self.isWorking = True
@@ -470,7 +470,7 @@ class YumexApplication(YumexController,YumexGUI):
self.setupRepoView()
self.endWorking()
def setupRepoView(self):
self.repoView.populate()