Ejemplo n.º 1
0
 def open(self):
     if not self.saveQuestion(): return()
     try:
         self.pasoinfo.hide()
         self.pasopackages.hide()
         self.horizontalLayout.removeWidget(self.pasoinfo)
         self.horizontalLayout.removeWidget(self.pasopackages)
     except:
         pass
     fileName = QtGui.QFileDialog.getOpenFileName(self, "",self.preferences.config.workspace, "Paso (*%s)" %const.PASO_EXT)
     if fileName:
         data = loadPaso(unicode(fileName))
         if data:
             self.pasoFName = os.path.basename(unicode(fileName))
             self.pasoinfo = pasoInfo()
             self.pasopackages = pasoPackages()
             self.pasoinfo.setHeader(data.header)
             self.pasoinfo.setTitle(self.pasoFName)
             self.pasopackages.setFromList(data.packages.files.keys())
             self.horizontalLayout.addWidget(self.pasoinfo)
             self.horizontalLayout.addWidget(self.pasopackages)
             self.actionBuild_from_Installation.setEnabled(True)
             self.actionSave.setEnabled(True)
             self.actionSave_as.setEnabled(True)
             self.actionExport.setEnabled(False)
             self.actionBuild_installation_image.setEnabled(True)
             self.setWindowTitle("%s   -   %s" %(const.NAME, self.pasoFName))
         else:
             self.message(self.msg[23])
Ejemplo n.º 2
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)