def startDownloadThread(self, pkgName):
     '''Start download thread.'''
     # Add in download list.
     utils.addInList(self.downloadingQueue, pkgName)
     
     # Start download thread.
     self.portTicker += 1 # generate new rpc listen port
     download = Download(pkgName, self.portTicker, self.updateCallback, self.finishDownloadCallback, self.messageCallback)
     download.start()
     
     # Add signal channel.
     self.downloadingChannel[pkgName] = download
    def startDownloadThread(self, pkgName):
        '''Start download thread.'''
        # Add in download list.
        utils.addInList(self.downloadingQueue, pkgName)

        # Start download thread.
        self.portTicker += 1  # generate new rpc listen port
        download = Download(pkgName, self.portTicker, self.updateCallback,
                            self.finishDownloadCallback, self.messageCallback)
        download.start()

        # Add signal channel.
        self.downloadingChannel[pkgName] = download
 def addPkgInIgnoreList(self, pkgNames):
     '''Add package in ignore list.'''
     for pkgName in pkgNames:
         # Add package in ignore list.
         utils.addInList(self.ignorePkgs, pkgName)
             
         # Remove package from upgradable list.
         self.removePkgFromUpgradableList(pkgName)
     
     # Record.
     self.ignorePkgs = self.sortPackages(self.ignorePkgs)
             
     # Update file content.
     writeFile("./ignorePkgs", str(self.ignorePkgs))
 def addPkgInIgnoreList(self, pkgNames):
     '''Add package in ignore list.'''
     for pkgName in pkgNames:
         # Add package in ignore list.
         utils.addInList(self.ignorePkgs, pkgName)
             
         # Remove package from upgradable list.
         self.removePkgFromUpgradableList(pkgName)
     
     # Record.
     self.ignorePkgs = self.sortPackages(self.ignorePkgs)
             
     # Update file content.
     writeFile("./ignorePkgs", str(self.ignorePkgs))
 def selectPkg(self, pkgName):
     '''Select package.'''
     utils.addInList(self.selectList, pkgName)
 def addDownload(self, pkgName):
     '''Add new download'''
     if len(self.downloadingQueue) >= self.maxConcurrentDownloads:
         utils.addInList(self.waitQueue, pkgName)
     else:
         self.startDownloadThread(pkgName)
 def selectPkg(self, pkgName):
     '''Select package.'''
     utils.addInList(self.selectList, pkgName)
 def addDownload(self, pkgName):
     '''Add new download'''
     if len(self.downloadingQueue) >= self.maxConcurrentDownloads:
         utils.addInList(self.waitQueue, pkgName)
     else:
         self.startDownloadThread(pkgName)