예제 #1
0
파일: main.py 프로젝트: alierkanimrek/paso
 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 on_actionButton_clicked(self):
     prg = progress()
     prg.show()
     self.pluginsOutputOverwriteStatus = pos_None
     self.pluginActionRunStatus = True
     jobCounter = 0
     for action in self.actionList.getActionItems():
         jobCounter += 1
         act = action.activePlugin.action(action.activePlugin.mconf, \
                                         action.jobItem.getList(), \
                                         action.pluginDataList[action.activePlugin.mconf.install.mname], \
                                         self.askOverwriteOutputFile)
         prg.setTotalJobs(len(self.actionList.getActionItems()))
         prg.setCurrentJob(jobCounter)
         act.onLogging.addEventListener(prg.addLog)
         act.onProcessing.addEventListener(prg.updateJobValue)
         prg.onStop.addEventListener(act.stopOperation)
         act.runPlugin()
         prg.onStop.removeEventListener(act.stopOperation)
         if prg.stopFlag or not self.pluginActionRunStatus:  break
     prg.operationCompleted()
     prg.exec_()
예제 #3
0
파일: main.py 프로젝트: alierkanimrek/paso
 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() )