示例#1
0
 def pasoBuildfromIns(self):
     self.message(self.msg[25], self.msg[26])
     dirName = QtGui.QFileDialog.getExistingDirectory(self, "", "/", QtGui.QFileDialog.ShowDirsOnly )
     if dirName:
         packages = buildFromPath()
         pkgList = packages.loadList(unicode(dirName))
         if not pkgList:
             self.message(self.msg[3])
             return()
         prg = progress()
         prg.show()
         total = len(pkgList)
         current = 0
         for pkg in pkgList:
             self.setProgress(prg, self.msg[4], pkg, ratioCalc(total, current))
             if not packages.loadPackageInfo(pkg):
                 self.message(self.msg[5], pkg)
                 return()
             current += 1
         if const.INSTALLER_NAME not in packages.getNameList():
             self.message(self.msg[27], self.msg[28])
             return()
         try:
             self.pasopackages.hide()
             self.horizontalLayout.removeWidget(self.pasopackages)
         except:
             pass
         header = self.pasoinfo.getHeader()
         header.r = lib.getPardusRelease(unicode(dirName))
         header.d = lib.getDate()
         header.a = packages.getArch()
         header.ds = packages.getDist()
         header.pn = self.preferences.config.name
         header.pm = self.preferences.config.email
         self.pasoinfo.setHeader(header)
         self.pasopackages = pasoPackages()
         self.pasopackages.setFromList(packages.getFileList(), packages.getNameList())
         self.pasopackages.changed = True
         self.horizontalLayout.addWidget(self.pasopackages)
         self.actionSave.setEnabled(True)
         self.actionBuild_installation_image.setEnabled(True)
         self.actionSave_as.setEnabled(True)
         self.actionExport.setEnabled(True)
示例#2
0
 def isoBuild(self):
     iso = builder()
     iso.loadSources()
     if not iso.pisiconfLoaded:
         self.message(self.msg[6])
         return()
     if not iso.repoUrlsLoaded:
         self.message(self.msg[7])
         return()
     remoteSources = iso.getRemoteSources() + self.preferences.getRemoteSources()
     localSources = iso.getLocalSources() + self.preferences.getLocalSources()
     isoDialog = isoPackageSource()
     isoDialog.setRemoteSources(remoteSources)
     isoDialog.setLocalSources(localSources)
     isoDialog.setWorkspace(self.preferences.config.workspace)
     if self.pasoFName:
         isoDialog.setProjectName( unicode(os.path.basename(self.pasoFName)[:len(os.path.basename(self.pasoFName))-len(const.PASO_EXT)]) )
     else:
         isoDialog.setProjectName( self.pasoinfo.getHeader().n.__str__() )
     isoDialog.setPIMPath(self.preferences.config.pim)
     if not isoDialog.exec_():
         return()
     iso.setSources(isoDialog.getLocalSources(), isoDialog.getRemoteSources())
     iso.setTarget(isoDialog.getWorkspace(), isoDialog.getProjectName()+"-"+self.pasoinfo.getHeader().a)
     iso.setPIMPath(isoDialog.getPIMPath())
     self.preferences.config.pim = isoDialog.getPIMPath()
     self.preferences.save()
     prg = progress()
     self.setProgress(prg, self.msg[22], isoDialog.getProjectName() )
     prg.show()
     if not iso.makeDirs():
         self.message(self.msg[8])
         return()
     total = len( self.pasopackages.getFileList() )
     current = 0
     for pkg in self.pasopackages.getFileList():
         if prg.stop:
             return()
         self.setProgress(prg, self.msg[9] , pkg, ratioCalc(total, current, 5, 1))
         pkgInfo = iso.searchPackage(pkg)
         if not pkgInfo:
             self.message(self.msg[10], pkg)
             return()
         elif not pkgInfo.path:
             pass    #already on repo
         else:
             self.setProgress(prg, self.msg[11] , os.path.join(pkgInfo.path, pkg), ratioCalc(total, current, 5, 1))
             if not iso.bringPackage(pkgInfo):
                 self.message(self.msg[29], pkg)
                 return()
         current += 1
     self.setProgress(prg, self.msg[12],self.msg[13], ratioCalc(100, 50, 5, 2))
     if not iso.buildIndex():
         self.message(self.msg[14])
         return()
     self.setProgress(prg, self.msg[15] , self.msg[13], ratioCalc(100, 50, 5, 3) )
     if not iso.transferInstallationSystem():
         self.message(self.msg[16])
         return()
     self.setProgress(prg, self.msg[17] , self.msg[13], ratioCalc(100, 50, 5, 4) )
     if not iso.createISO():
         self.message(self.msg[18])
         return()
     self.setProgress(prg, self.msg[19] , self.msg[13], ratioCalc(100, 50, 5, 5))
     if not iso.calcSUM():
         self.message(self.msg[20])
         return()
     prg.hide()
     self.message(self.msg[21], iso.getTargetName() )