def showMSG(self, str_ = "README"): if str_ == "README" : STR_ = '..' + self.SEP + '..' + self.SEP + 'README' else : STR_ = "MSG: " + str_ showHelp = ListingText(STR_, self) showHelp.exec_()
def getPath(self): _nameDir = QtGui.QFileDialog.getExistingDirectory(self, 'Path_to_', '~', QtGui.QFileDialog.ShowDirsOnly) nameDir = QtCore.QString(_nameDir).toUtf8().data() if os.access(nameDir, os.R_OK) and os.access(nameDir, os.W_OK) and os.access(nameDir, os.X_OK) : self.upLoadPathString.setText(_nameDir) else : showHelp = ListingText("MSG: uncorrect Path (or access denied) : " + nameDir, self) showHelp.exec_()
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_()
def addFilePaths(self): fileNames = QtGui.QFileDialog.getOpenFileNames(self, "Path_to_", "~") for _name in fileNames: name_ = _name.toLocal8Bit().data() if not stat.S_ISLNK(os.lstat(name_).st_mode) and os.access(name_, os.R_OK): P = PathToTree(_name, self.treeModel.rootItem, "file") self.treeModel.reset() else: showHelp = ListingText("MSG: uncorrect Path\n(access denied) or symLink : " + name_, self) showHelp.exec_()
def addDirPath(self): _nameDir = QtGui.QFileDialog.getExistingDirectory(self, "Path_to_", "~", QtGui.QFileDialog.ShowDirsOnly) nameDir = _nameDir.toLocal8Bit().data() if os.access(nameDir, os.R_OK) and os.access(nameDir, os.X_OK): ## and os.access(nameDir, os.W_OK) : # print nameDir P = PathToTree(_nameDir, self.treeModel.rootItem, "dir") self.treeModel.reset() else: showHelp = ListingText("MSG: uncorrect Path (or access denied): " + nameDir, self) showHelp.exec_()
def avatarPath(self): fileName = QtGui.QFileDialog.getOpenFileName(self, 'Path_to_', '~', 'Images PNG (*.png);; Images GIF (*.gif);; Images JPEG (*.jpeg);; Images JPG (*.jpg)') name_ = QtCore.QString(fileName).toUtf8().data() if not stat.S_ISLNK(os.lstat(name_).st_mode) and os.access(name_, os.R_OK) : if os.lstat(name_).st_size < 25600 : self.avatarPathString.setText(unicode(fileName)) self.Obj.avatarPath = unicode(fileName) else : showHelp = ListingText("MSG: file more then 25 KBytes : " + name_, self) showHelp.exec_() else : showHelp = ListingText("MSG: incorrect Path\n(access denied) or symLink : " + name_, self) showHelp.exec_()
def showMSG(self, s=""): msg = ListingText(HELP if s == "" else s, self) msg.exec_()
def threadMSG(self, str_): showHelp = ListingText("MSG: Available files not found in " + str_, self) showHelp.exec_()
def showErrorMSG(self, str_): print 'Message : ', str(str_) showHelp = ListingText("MSG: " + str(str_), self) showHelp.exec_()