def __addRepository(self): repoName = self.repoDialog.repoName.text() repoAddress = self.repoDialog.repoAddress.currentText() if not re.match("^[0-9%s\-\\_\\.\s]*$" % str(pmutils.letters()), str(repoName)): KMessageBox.error(self.settings, i18n("Not a valid repository name"), i18n("Pisi Error")) return if not repoAddress.endsWith("xml") and not repoAddress.endsWith("xml.bz2"): KMessageBox.error(self.settings, i18n('<qt>Repository address should end with xml or xml.bz2 suffix.<p>Please try again.</qt>'), i18n("Pisi Error")) return self.__insertRow(repoName, repoAddress) self.markChanged()
def __addRepository(self): repoName = self.repoDialog.repoName.text() repoAddress = self.repoDialog.repoAddress.currentText() if not re.match("^[0-9%s\-\\_\\.\s]*$" % str(pmutils.letters()), str(repoName)) or str(repoName) == '': QMessageBox.warning(self.settings, i18n("Pisi Error"), i18n("Not a valid repository name")) return if not repoAddress.endsWith("xml") and not repoAddress.endsWith("xml.bz2") and not repoAddress.endsWith('xz'): QMessageBox.warning(self.settings, i18n("Pisi Error"), i18n('<qt>Repository address should end with xml or xml.bz2 or xz suffix.<p>Please try again.</qt>')) return self.__insertRow(repoName, repoAddress) self.markChanged()
def __addRepository(self): repoName = str(self.repoDialog.repoName.text()) repoAddress = str(self.repoDialog.repoAddress.currentText()) if not re.match("^[0-9%s\-\\_\\.\s]*$" % str(pmutils.letters()), str(repoName)) or str(repoName) == '': QMessageBox.warning(self.settings, _translate("Packaga Manager","Pisi Error"), _translate("Packaga Manager","Not a valid repository name")) return print dir(repoAddress) if not repoAddress.endswith("xml") and not repoAddress.endswith("xml.bz2") and not repoAddress.endswith('xz'): QMessageBox.warning(self.settings, _translate("Packaga Manager","Pisi Error"), _translate("Packaga Manager",'<qt>Repository address should end with xml or xml.bz2 or xz suffix.<p>Please try again.</qt>')) return self.__insertRow(repoName, repoAddress) self.markChanged()