def searchCertificate(self): pubKeyPath = Path.config('pubKey.pem') prvKeyPath = Path.config('prvKey.pem') if not os.path.isfile(pubKeyPath) or not os.path.isfile(prvKeyPath) : createCertificate() with open(pubKeyPath, 'rb') as f : _str = f.read() self.servPubKey = _str.encode('utf-8') with open(prvKeyPath, 'rb') as f : _str = f.read() self.servPrvKey = _str.encode('utf-8')
def loadTree(self): fileName = QtGui.QFileDialog.getOpenFileName(self, "Path_to_", Path.config("treeBackup")) if fileName != "": self.Obj.saveTemporaryData() if "serverThread" in dir(self.Obj): self.Obj.stopServices(True, fileName, "REINIT") else: self.preInitServer("reINIT:", fileName)
def saveTree(self): tmpFile = "sharedSourceBackup_" + dateStamp() S = SharedSourceTree2XMLFile(tmpFile, self.treeModel.rootItem) fileName = QtGui.QFileDialog.getSaveFileName(self, "Path_to_", Path.config("treeBackup")) if not moveFile(Path.multiPath(Path.tempStruct, "server", tmpFile), QtCore.QString(fileName).toUtf8().data()): showHelp = ListingText("MSG: tree not saved.", self) showHelp.exec_()