fix: Maks1m_s исправил ошибки (Code woth me)

This commit is contained in:
Почти Демон 2023-09-28 14:51:44 +03:00
parent 3552e93dde
commit de77ea6bfc
2 changed files with 2 additions and 14 deletions

View File

@ -120,18 +120,6 @@ class MainWindow(QMainWindow):
msgBox.setStandardButtons(buttons)
msgBox.setDefaultButton(defaultButton)
if msgBox.button(QMessageBox.Yes) is not None:
msgBox.button(QMessageBox.Yes).setText("Да")
if msgBox.button(QMessageBox.No) is not None:
msgBox.button(QMessageBox.No).setText("Нет")
if msgBox.button(QMessageBox.Ok) is not None:
msgBox.button(QMessageBox.Ok).setText("Ок")
if msgBox.button(QMessageBox.Cancel) is not None:
msgBox.button(QMessageBox.Cancel).setText("Отмена")
return msgBox
def closeEvent(self, event):

View File

@ -8,7 +8,7 @@ class FileSLCModel:
self.file_name = None
def saveFile(self, data):
if self.file_name is None:
if not self.file_name:
self.file_name, _ = QFileDialog.getSaveFileName(None, "Сохранить файл", "", "Text Files (*.txt);;CSV Files (*.csv)")
if self.file_name:
np.savetxt(self.file_name, data, delimiter=",")
@ -17,7 +17,7 @@ class FileSLCModel:
def loadFile(self):
self.file_name, _ = QFileDialog.getOpenFileName(None, "Загрузить файл", "", "Files (*.txt;*.csv)")
if self.file_name:
if not self.file_name:
try:
content = np.genfromtxt(self.file_name, delimiter=',', invalid_raise=True)
except ValueError as e: